?
Unicode.php 0000666 00000010417 15125451366 0006662 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Text_Table
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Unicode.php 12529 2008-11-10 21:05:43Z dasprid $
*/
/**
* @see Zend_Text_Table_Decorator_Interface
*/
require_once 'Zend/Text/Table/Decorator/Interface.php';
/**
* Unicode Decorator for Zend_Text_Table
*
* @category Zend
* @package Zend_Text_Table
* @uses Zend_Text_Table_Decorator_Interface
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Text_Table_Decorator_Unicode implements Zend_Text_Table_Decorator_Interface
{
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getTopLeft()
{
return $this->_uniChar(0x250C);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getTopRight()
{
return $this->_uniChar(0x2510);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getBottomLeft()
{
return $this->_uniChar(0x2514);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getBottomRight()
{
return $this->_uniChar(0x2518);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVertical()
{
return $this->_uniChar(0x2502);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontal()
{
return $this->_uniChar(0x2500);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getCross()
{
return $this->_uniChar(0x253C);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVerticalRight()
{
return $this->_uniChar(0x251C);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVerticalLeft()
{
return $this->_uniChar(0x2524);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontalDown()
{
return $this->_uniChar(0x252C);
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontalUp()
{
return $this->_uniChar(0x2534);
}
/**
* Convert am unicode character code to a character
*
* @param integer $code
* @return string|false
*/
protected function _uniChar($code)
{
if ($code <= 0x7F) {
$char = chr($code);
} else if ($code <= 0x7FF) {
$char = chr(0xC0 | $code >> 6)
. chr(0x80 | $code & 0x3F);
} else if ($code <= 0xFFFF) {
$char = chr(0xE0 | $code >> 12)
. chr(0x80 | $code >> 6 & 0x3F)
. chr(0x80 | $code & 0x3F);
} else if ($code <= 0x10FFFF) {
$char = chr(0xF0 | $code >> 18)
. chr(0x80 | $code >> 12 & 0x3F)
. chr(0x80 | $code >> 6 & 0x3F)
. chr(0x80 | $code & 0x3F);
} else {
return false;
}
return $char;
}
}
Ascii.php 0000666 00000006262 15125451366 0006327 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Text_Table
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Ascii.php 12529 2008-11-10 21:05:43Z dasprid $
*/
/**
* @see Zend_Text_Table_Decorator_Interface
*/
require_once 'Zend/Text/Table/Decorator/Interface.php';
/**
* ASCII Decorator for Zend_Text_Table
*
* @category Zend
* @package Zend_Text_Table
* @uses Zend_Text_Table_Decorator_Interface
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Text_Table_Decorator_Ascii implements Zend_Text_Table_Decorator_Interface
{
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getTopLeft()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getTopRight()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getBottomLeft()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getBottomRight()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVertical()
{
return '|';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontal()
{
return '-';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getCross()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVerticalRight()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getVerticalLeft()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontalDown()
{
return '+';
}
/**
* Defined by Zend_Text_Table_Decorator_Interface
*
* @return string
*/
public function getHorizontalUp()
{
return '+';
}
}
Interface.php 0000666 00000005212 15125451366 0007171 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Text_Table
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 12529 2008-11-10 21:05:43Z dasprid $
*/
/**
* Interface for Zend_Text_Table decorators
*
* @category Zend
* @package Zend_Text_Table
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Text_Table_Decorator_Interface
{
/**
* Get a single character for the top left corner
*
* @return string
*/
public function getTopLeft();
/**
* Get a single character for the top right corner
*
* @return string
*/
public function getTopRight();
/**
* Get a single character for the bottom left corner
*
* @return string
*/
public function getBottomLeft();
/**
* Get a single character for the bottom right corner
*
* @return string
*/
public function getBottomRight();
/**
* Get a single character for a vertical line
*
* @return string
*/
public function getVertical();
/**
* Get a single character for a horizontal line
*
* @return string
*/
public function getHorizontal();
/**
* Get a single character for a crossing line
*
* @return string
*/
public function getCross();
/**
* Get a single character for a vertical divider right
*
* @return string
*/
public function getVerticalRight();
/**
* Get a single character for a vertical divider left
*
* @return string
*/
public function getVerticalLeft();
/**
* Get a single character for a horizontal divider down
*
* @return string
*/
public function getHorizontalDown();
/**
* Get a single character for a horizontal divider up
*
* @return string
*/
public function getHorizontalUp();
}
Captcha/Word.php 0000666 00000004426 15125470765 0007561 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Form_Decorator_Abstract */
require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Word-based captcha decorator
*
* Adds hidden field for ID and text input field for captcha text
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: $
*/
class Zend_Form_Decorator_Captcha_Word extends Zend_Form_Decorator_Abstract
{
/**
* Render captcha
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$name = $element->getFullyQualifiedName();
$hiddenName = $name . '[id]';
$textName = $name . '[input]';
$placement = $this->getPlacement();
$separator = $this->getSeparator();
$hidden = $view->formHidden($hiddenName, $element->getValue(), $element->getAttribs());
$text = $view->formText($textName, '', $element->getAttribs());
switch ($placement) {
case 'PREPEND':
$content = $hidden . $separator . $text . $separator . $content;
break;
case 'APPEND':
default:
$content = $content . $separator . $hidden . $separator . $text;
}
return $content;
}
}
Image.php 0000666 00000010577 15125470765 0006331 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Form_Decorator_Abstract */
require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Zend_Form_Decorator_Image
*
* Accepts the options:
* - separator: separator to use between image and content (defaults to PHP_EOL)
* - placement: whether to append or prepend label to content (defaults to append)
* - tag: if set, used to wrap the label in an additional HTML tag
*
* Any other options passed will be used as HTML attributes of the image tag.
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Image.php 10008 2008-07-09 16:52:08Z matthew $
*/
class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
{
/**
* Attributes that should not be passed to helper
* @var array
*/
protected $_attribBlacklist = array('helper', 'placement', 'separator', 'tag');
/**
* Default placement: append
* @var string
*/
protected $_placement = 'APPEND';
/**
* HTML tag with which to surround image
* @var string
*/
protected $_tag;
/**
* Set HTML tag with which to surround label
*
* @param string $tag
* @return Zend_Form_Decorator_Image
*/
public function setTag($tag)
{
$this->_tag = (string) $tag;
return $this;
}
/**
* Get HTML tag, if any, with which to surround label
*
* @return void
*/
public function getTag()
{
if (null === $this->_tag) {
$tag = $this->getOption('tag');
if (null !== $tag) {
$this->removeOption('tag');
$this->setTag($tag);
}
return $tag;
}
return $this->_tag;
}
/**
* Get attributes to pass to image helper
*
* @return array
*/
public function getAttribs()
{
$attribs = $this->getOptions();
if (null !== ($element = $this->getElement())) {
$attribs['alt'] = $element->getLabel();
$attribs = array_merge($attribs, $element->getAttribs());
}
foreach ($this->_attribBlacklist as $key) {
if (array_key_exists($key, $attribs)) {
unset($attribs[$key]);
}
}
return $attribs;
}
/**
* Render a form image
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$tag = $this->getTag();
$placement = $this->getPlacement();
$separator = $this->getSeparator();
$name = $element->getFullyQualifiedName();
$attribs = $this->getAttribs();
$attribs['id'] = $element->getId();
$image = $view->formImage($name, $element->getImageValue(), $attribs);
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';
$decorator = new Zend_Form_Decorator_HtmlTag();
$decorator->setOptions(array('tag' => $tag));
$image = $decorator->render($image);
}
switch ($placement) {
case self::PREPEND:
return $image . $separator . $content;
case self::APPEND:
default:
return $content . $separator . $image;
}
}
}
AccordionContainer.php 0000666 00000002664 15125472666 0011053 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* AccordionContainer
*
* Render a dijit AccordionContainer
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AccordionContainer.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_AccordionContainer extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'AccordionContainer';
}
SplitContainer.php 0000666 00000002640 15125472666 0010237 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* SplitContainer
*
* Render a dijit SplitContainer
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SplitContainer.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_SplitContainer extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'SplitContainer';
}
ContentPane.php 0000666 00000002621 15125472666 0007516 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* ContentPane
*
* Render a dijit ContentPane
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ContentPane.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_ContentPane extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'ContentPane';
}
StackContainer.php 0000666 00000002642 15125472666 0010213 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* StackContainer
*
* Render a dijit StackContainer
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: StackContainer.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_StackContainer extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'StackContainer';
}
BorderContainer.php 0000666 00000002645 15125472666 0010366 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* BorderContainer
*
* Render a dijit BorderContainer
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: BorderContainer.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_BorderContainer extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'BorderContainer';
}
DijitForm.php 0000666 00000003675 15125472666 0007201 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* Zend_Dojo_Form_Decorator_DijitForm
*
* Render a dojo form dijit via a view helper
*
* Accepts the following options:
* - helper: the name of the view helper to use
*
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DijitForm.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_DijitForm extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* Render a form
*
* Replaces $content entirely from currently set element.
*
* @param string $content
* @return string
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
return $content;
}
$dijitParams = $this->getDijitParams();
$attribs = array_merge($this->getAttribs(), $this->getOptions());
return $view->form($element->getName(), $attribs, $content);
}
}
AccordionPane.php 0000666 00000002633 15125472666 0010010 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Dojo_Form_Decorator_DijitContainer */
require_once 'Zend/Dojo/Form/Decorator/DijitContainer.php';
/**
* AccordionPane
*
* Render a dijit AccordionPane
*
* @uses Zend_Dojo_Form_Decorator_DijitContainer
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AccordionPane.php 10009 2008-07-09 16:52:18Z matthew $
*/
class Zend_Dojo_Form_Decorator_AccordionPane extends Zend_Dojo_Form_Decorator_DijitContainer
{
/**
* View helper
* @var string
*/
protected $_helper = 'AccordionPane';
}
DijitElement.php 0000666 00000013665 15125472666 0007667 0 ustar 00 <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Form_Decorator_ViewHelper */
require_once 'Zend/Form/Decorator/ViewHelper.php';
/**
* Zend_Dojo_Form_Decorator_DijitElement
*
* Render a dojo dijit element via a view helper
*
* Accepts the following options:
* - separator: string with which to separate passed in content and generated content
* - placement: whether to append or prepend the generated content to the passed in content
* - helper: the name of the view helper to use
*
* Assumes the view helper accepts three parameters, the name, value, and
* optional attributes; these will be provided by the element.
*
* @package Zend_Dojo
* @subpackage Form_Decorator
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DijitElement.php 12690 2008-11-18 18:45:28Z alexander $
*/
class Zend_Dojo_Form_Decorator_DijitElement extends Zend_Form_Decorator_ViewHelper
{
/**
* Element attributes
* @var array
*/
protected $_attribs;
/**
* Element types that represent buttons
* @var array
*/
protected $_buttonTypes = array(
'Zend_Dojo_Form_Element_Button',
'Zend_Form_Element_Button',
'Zend_Form_Element_Reset',
'Zend_Form_Element_Submit',
);
/**
* Dijit option parameters
* @var array
*/
protected $_dijitParams = array();
/**
* Get element attributes
*
* @return array
*/
public function getElementAttribs()
{
if (null === $this->_attribs) {
$this->_attribs = parent::getElementAttribs();
if (array_key_exists('dijitParams', $this->_attribs)) {
$this->setDijitParams($this->_attribs['dijitParams']);
unset($this->_attribs['dijitParams']);
}
}
return $this->_attribs;
}
/**
* Set a single dijit option parameter
*
* @param string $key
* @param mixed $value
* @return Zend_Dojo_Form_Decorator_DijitContainer
*/
public function setDijitParam($key, $value)
{
$this->_dijitParams[(string) $key] = $value;
return $this;
}
/**
* Set dijit option parameters
*
* @param array $params
* @return Zend_Dojo_Form_Decorator_DijitContainer
*/
public function setDijitParams(array $params)
{
$this->_dijitParams = array_merge($this->_dijitParams, $params);
return $this;
}
/**
* Retrieve a single dijit option parameter
*
* @param string $key
* @return mixed|null
*/
public function getDijitParam($key)
{
$this->getElementAttribs();
$key = (string) $key;
if (array_key_exists($key, $this->_dijitParams)) {
return $this->_dijitParams[$key];
}
return null;
}
/**
* Get dijit option parameters
*
* @return array
*/
public function getDijitParams()
{
$this->getElementAttribs();
return $this->_dijitParams;
}
/**
* Render an element using a view helper
*
* Determine view helper from 'helper' option, or, if none set, from
* the element type. Then call as
* helper($element->getName(), $element->getValue(), $element->getAttribs())
*
* @param string $content
* @return string
* @throws Zend_Form_Decorator_Exception if element or view are not registered
*/
public function render($content)
{
$element = $this->getElement();
$view = $element->getView();
if (null === $view) {
require_once 'Zend/Form/Decorator/Exception.php';
throw new Zend_Form_Decorator_Exception('DijitElement decorator cannot render without a registered view object');
}
$options = null;
$helper = $this->getHelper();
$separator = $this->getSeparator();
$value = $this->getValue($element);
$attribs = $this->getElementAttribs();
$name = $element->getFullyQualifiedName();
$dijitParams = $this->getDijitParams();
if ($element->isRequired()) {
$dijitParams['required'] = true;
}
$id = $element->getId();
if ($view->dojo()->hasDijit($id)) {
trigger_error(sprintf('Duplicate dijit ID detected for id "%s; temporarily generating uniqid"', $id), E_USER_NOTICE);
$base = $id;
do {
$id = $base . '-' . uniqid();
} while ($view->dojo()->hasDijit($id));
}
$attribs['id'] = $id;
if (array_key_exists('options', $attribs)) {
$options = $attribs['options'];
}
$elementContent = $view->$helper($name, $value, $dijitParams, $attribs, $options);
switch ($this->getPlacement()) {
case self::APPEND:
return $content . $separator . $elementContent;
case self::PREPEND:
return $elementContent . $separator . $content;
default:
return $elementContent;
}
}
}
Submitinscrit.php 0000666 00000002015 15126061316 0010117 0 ustar 00 <?php
class Decorator_Submitinscrit extends Zend_Form_Decorator_Abstract
{
protected $_format = '
<input type="hidden" name="delete" value="" id="delete" />
<div style="padding-top:10px;">
<ul>
<li style="float:left">
<input OnClick="submit_editinscrrit();" class="boutonSave" id="%s" name="%s" value="%s" type="text" />
</li>
<li style="float:left; margin-left:37px;"><input class="boutonSave" id="delinscrit" name="delinscrit" value="SUPPRIMER" type="text" />
</li>
<li style="float:left; margin-left:37px;"><input OnClick="javascript:history.go(-1);" class="boutonSave" id="cancel" name="cancel" value="ANNULER" type="text" />
</li>
</ul>
</div>';
public function render($content)
{
$element = $this->getElement();
$id = htmlentities($element->getId());
$value = htmlentities($element->getValue());
$name = htmlentities($element->getFullyQualifiedName());
$markup = sprintf($this->_format, $id,$name, $value );
return $markup;
}
}
?>
Connection.php 0000666 00000000667 15126061316 0007372 0 ustar 00 <?php
class Decorator_Connection extends Zend_Form_Decorator_Abstract
{
protected $_format = '<div id="btconnection" for="%s">%s</div>';
public function render($content)
{
$element = $this->getElement();
$id = htmlentities($element->getId());
$label = htmlentities($element->getLabel());
$markup = sprintf($this->_format, $id, $label);
return $markup;
}
}
?>
Checkbox.php 0000666 00000002615 15126061316 0007014 0 ustar 00 <?php
class Decorator_Checkbox extends Zend_Form_Decorator_Abstract
{
public function render($content)
{
$element = $this->getElement();
if (!$element instanceof Zend_Form_Element) {
return $content;
}
if (null === $element->getView()) {
return $content;
}
//$name = $element->getName()."[]";
$name = $element->getFullyQualifiedName();
// On récupère la vue
$view = $element->getView();
// On récupère les valeurs
$values = $element->getValue();
$form_xhtml = '<li><span class="labelform">Vous êtes intéressé par:</span></li>';
// formCheckbox($name, $value, $attribs, $options)
foreach ($element->getMultiOptions() as $val => $label) {
//$checked = (in_array($val,$values)) ? true : false;
$checked = "";
$form_xhtml .= '<li><span class="labelformCheckbox">' . $view->formCheckbox($name,$val,array('checked' => $checked)) . $view->formLabel($name,$label) . '<span></li>';
}
$form_xhtml = '<div id="champsCheckbox"><ul>'.$form_xhtml.'</ul></div>';
switch ($this->getPlacement()) {
case (self::PREPEND):
return $form_xhtml . $content;
case (self::APPEND):
default:
return $content . $form_xhtml;
}
}
}
?>
Submittemoignage.php 0000666 00000002030 15126061316 0010560 0 ustar 00 <?php
class Decorator_Submittemoignage extends Zend_Form_Decorator_Abstract
{
protected $_format = '
<input type="hidden" name="delete" value="" id="delete" />
<div style="padding-top:10px;">
<ul>
<li style="float:left">
<input OnClick="submit_edittemoignage();" class="boutonSave" id="%s" name="%s" value="%s" type="text" />
</li>
<li style="float:left; margin-left:37px;"><input class="boutonSave" id="deltemoignage" name="deltemoignage" value="SUPPRIMER" type="text" />
</li>
<li style="float:left; margin-left:37px;"><input OnClick="javascript:history.go(-1);" class="boutonSave" id="cancel" name="cancel" value="ANNULER" type="text" />
</li>
</ul>
</div>';
public function render($content)
{
$element = $this->getElement();
$id = htmlentities($element->getId());
$value = htmlentities($element->getValue());
$name = htmlentities($element->getFullyQualifiedName());
$markup = sprintf($this->_format, $id,$name, $value );
return $markup;
}
}
?>
Login.php 0000666 00000001572 15126061316 0006337 0 ustar 00 <?php
class Decorator_Login extends Zend_Form_Decorator_Abstract
{
protected $_format = '
<div id="LoginPass">
<ul>
<li>
<div id="loginchamps">
<ul>
<li>
<div id="label_login" >Login</div>
</li>
<li>
<div><input type="text" name="login" id="login" value="" class="inputLogin" /></div>
</li>
</ul>
</div>
</li>
<li>
<div style="position:relative; width:200px; height:5px;"></div>
</li>
<li>
<div id="loginchamps">
<ul>
<li>
<div id="label_login">Votre pass</div>
</li>
<li>
<div><input type="password" name="pass" id="pass" value="" class="inputLogin" /></div>
</li>
</ul>
</div>
</li>
</ul>
</div>
';
public function render($content)
{
$element = $this->getElement();
$id = htmlentities($element->getId());
$label = "";
$markup = sprintf($this->_format);
return $markup;
}
}
?>
Save.php 0000666 00000000613 15126061316 0006160 0 ustar 00 <?php
class Decorator_Save extends Zend_Form_Decorator_Abstract
{
protected $_format = '<div id="btsave" for="%s">%s</div>';
public function render($content)
{
$element = $this->getElement();
$id = htmlentities($element->getId());
$label = "";
$markup = sprintf($this->_format, $id, $label);
return $markup;
}
}
?>