• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ZendX_JQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ZendX_JQuery的典型用法代码示例。如果您正苦于以下问题:PHP ZendX_JQuery类的具体用法?PHP ZendX_JQuery怎么用?PHP ZendX_JQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ZendX_JQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 protected function setUp()
 {
     $this->_picker = new Zle_Form_Element_DatePicker('foo');
     $this->_view = new Zend_View();
     $this->_view->addHelperPath(realpath(dirname(__FILE__) . '/../../../../library/Zle/View/Helper'), 'Zle_View_Helper');
     ZendX_JQuery::enableView($this->_view);
 }
开发者ID:JellyBellyDev,项目名称:zle,代码行数:7,代码来源:DatePickerTest.php


示例2: __construct

 public function __construct($options = null)
 {
     $curators = new Peoples();
     $assigned = $curators->getValuers();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('provisionalvaluations');
     $valuerID = new Zend_Form_Element_Select('valuerID');
     $valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
     $value = new Zend_Form_Element_Text('value');
     $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float')->setDecorators($decorators);
     $comments = new Pas_Form_Element_RTE('comments');
     $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
     $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addValidator('Date')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit));
     $this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:27,代码来源:ProvisionalValuationForm.php


示例3: tooltip

 /**
  * Builds an AutoComplete ready input field.
  *
  * This view helper builds an input field with the {@link Zend_View_Helper_FormText} FormText
  * Helper and adds additional javascript to the jQuery stack to initialize an AutoComplete
  * field. Make sure you have set one out of the two following options: $params['data'] or
  * $params['url']. The first one accepts an array as data input to the autoComplete, the
  * second accepts an url, where the autoComplete content is returned from. For the format
  * see jQuery documentation.
  *
  * @link   http://docs.jquery.com/UI/Autocomplete
  * @throws ZendX_JQuery_Exception
  * @param  String $id
  * @param  String $value
  * @param  array $params
  * @param  array $attribs
  * @return String
  */
 public function tooltip($id, $value = null, array $params = array(), array $attribs = array())
 {
     if (is_array($value) && count($params) == 0 && count($attribs) == 0) {
         $params = $value;
         $value = null;
     } elseif (is_string($value) and !isset($params['content'])) {
         $params['content'] = $value;
     }
     $params = array_merge(self::$_defaults, $params);
     $attribs = $this->_prepareAttributes($id, $value, $attribs);
     if ((!isset($attribs['translate']) || $attribs['translate']) && isset($params['content'])) {
         $params['content'] = $this->view->translate($params['content']);
     }
     $params = ZendX_JQuery::encodeJson($params);
     if (isset($attribs['translate'])) {
         unset($attribs['translate']);
     }
     $js = sprintf('%s("#%s").wTooltip(%s);', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $params);
     $this->jquery->addOnLoad($js);
     if (isset($attribs['justDecorate']) && $attribs['justDecorate']) {
         return '';
     }
     if (isset($attribs['justDecorate'])) {
         unset($attribs['justDecorate']);
     }
     return $this->view->formText($id, $value, $attribs);
 }
开发者ID:BackupTheBerlios,项目名称:dkplusengine,代码行数:45,代码来源:Tooltip.php


示例4: submitAjax

 /**
  * Cria um campo texto com validador de email
  *
  * @param  string $id
  * @param  string $value
  * @param  array  $params jQuery Widget Parameters
  * @param  array  $attribs HTML Element Attributes
  * @return string
  */
 public function submitAjax($id, $value = null, array $params = array(), array $attribs = array())
 {
     $attribs = $this->_prepareAttributes($id, $value, $attribs);
     $params = ZendX_JQuery::encodeJson($params);
     $js = sprintf('%s("#%s").click(function(){
                     var formFields = $(".required");
                     var requiredNull = "";
                     if(formFields.length > 1){
                         for(i=0;i<formFields.length;i++){
                             if(formFields[i].value == ""){
                                 requiredNull = $("label[for=\'"+formFields[i].id+"\']").text();
                             }
                         }
                     }else{
                         if(formFields.val() == ""){
                             requiredNull = $("label[for=\'"+formFields.attr(\'id\')+"\']").text();
                         }   
                     }
                     if(requiredNull != ""){
                         alert("O campo "+requiredNull+" é obrigatório");
                     }
                     //$("form").submit();
                  });', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $params);
     #$js = sprintf('%s("#%s").TEmail(%s);', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $params);
     $this->jquery->addOnLoad($js);
     return $this->view->formText($id, $value, $attribs);
 }
开发者ID:rtsantos,项目名称:mais,代码行数:36,代码来源:SubmitAjax.php


示例5: __construct

 public function __construct($options = null)
 {
     $staff = new Contacts();
     $flos = $staff->getAttending();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('addFlo');
     $flo = new Zend_Form_Element_Select('staffID');
     $flo->setLabel('Finds officer present: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose attending officer', 'Our staff members' => $flos));
     $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom');
     $dateFrom->setLabel('Attended from: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo');
     $dateTo->setLabel('Attended to: ')->setRequired(true)->addValidator('Date')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($flo, $dateFrom, $dateTo, $submit));
     $this->addDisplayGroup(array('staffID', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Attending Finds Officers');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:29,代码来源:AddFloRallyForm.php


示例6: numeric

 /**
  *  Cria um campo texto para numeros, com incremento, verificação, valor maximo e outro (ler arquivo TNumeric.js)
  *
  * @param  string $id
  * @param  string $value
  * @param  array  $params jQuery Widget Parameters
  * @param  array  $attribs HTML Element Attributes
  * @return string
  */
 public function numeric($id, $value = null, array $attribs = array())
 {
     $this->view->headScript()->appendFile(ZendT_Url::getBaseDiretoryPublic() . '/scripts/jquery/widget/TNumeric.js');
     $this->view->headScript()->appendFile(ZendT_Url::getBaseDiretoryPublic() . '/scripts/jquery/extra/autoNumeric.js');
     $params = ZendX_JQuery::encodeJson($attribs['jQueryParams']);
     unset($attribs['jQueryParams']);
     $this->jquery->addOnLoad('jQuery("#' . $id . '").TNumeric(' . $params . ');');
     /*$styles = explode(';', $attribs['style']);
       if ($styles) {
           foreach ($styles as $style) {
               list($styleName,$styleValue) = explode(':',$style);
               if ($styleName == 'width'){
                   $old = $style;
                   $width = (str_replace('px', '', trim($styleValue)) * 1);
                   $styleValue = $width - 25;
                   $new = 'width:'.$styleValue.'px';
               }
           }
           $attribs['style'] = str_replace($old,$new,$attribs['style']);
       }
       
       if (!$width){
           $width = 100;
           $attribs['style'].= 'width:75px;';
       }*/
     $attribs['class'] .= ' item ui-input-num icon';
     $btns = ' <span class="item numeric"> ' . '   <div class="ui-button ui-state-default up" nofocus="1" parent="' . $id . '" onClick="if(!$(this).attr(\'disabled\')){jQuery(\'#\' + $(this).attr(\'parent\')).Tdata(\'TNumeric\').incNumber();}" type="button"> ' . '      <span class="ui-icon ui-icon-triangle-1-n"/> ' . '   </div> ' . '   <div class="ui-button ui-state-default down" nofocus="1" parent="' . $id . '" onClick="if(!$(this).attr(\'disabled\')){jQuery(\'#\' + $(this).attr(\'parent\')).Tdata(\'TNumeric\').decNumber();}" type="button"> ' . '      <span class="ui-icon ui-icon-spinner-down"/> ' . '   </div> ' . ' </span> ';
     $xhtml = '<div class="ui-form-group"> ' . '     ' . $this->view->formText($id, $value, $attribs) . $btns . '</div>';
     return $xhtml;
 }
开发者ID:rtsantos,项目名称:mais,代码行数:39,代码来源:Numeric.php


示例7: __construct

 /** The constructor 
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('emailsearch');
     ZendX_JQuery::enableForm($this);
     $message = new Zend_Form_Element_Textarea('messageToUser');
     $message->setLabel('Message to user: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addFilter('BasicHtml')->addErrorMessage('You must enter a message to your recipient.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Send this to: ')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->setAttrib('size', 30);
     $email = $this->addElement('text', 'email', array('label' => 'Their email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($fullname, $submit, $message));
     $this->addDisplayGroup(array('fullname', 'email', 'messageToUser'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:33,代码来源:EmailSearchForm.php


示例8: zooColorPicker

    /**
     * Render a Color Picker in an FormText field.
     *
     * @link   http://docs.jquery.com/UI/ColorPicker
     * @param  string $id
     * @param  string $value
     * @param  array  $params
     * @param  array  $attribs
     * @return string
     */
    public function zooColorPicker($id, $value = '', array $params = array(), array $attribs = array())
    {
        $this->jquery->addJavascriptFile(Zend_Controller_Front::getInstance()->getBaseUrl() . '/js/jquery/colorpicker/js/colorpicker.js', 'text/javascript');
        $this->jquery->addStylesheet(Zend_Controller_Front::getInstance()->getBaseUrl() . "/js/jquery/colorpicker/css/colorpicker.css");
        $attribs = $this->_prepareAttributes($id, $value, $attribs);
        if (strlen($value) >= 6) {
            $params['color'] = $value;
        }
        if (count($params) > 0) {
            $params = ZendX_JQuery::encodeJson($params);
        } else {
            $params = "{}";
        }
        $js = sprintf('%s("#%s").ColorPicker({onSubmit: function(hsb, hex, rgb, el) {
											%s(el).val(hex);
											%s(el).ColorPickerHide();
										},
										onBeforeShow: function () {
											%s(this).ColorPickerSetColor(this.value);
										}
									})
									.bind("keyup", function(){
										%s(this).ColorPickerSetColor(this.value);
									});', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $params);
        $this->jquery->addOnLoad($js);
        return $this->view->formText($id, $value, $attribs);
    }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:37,代码来源:ZooColorPicker.php


示例9: __construct

 public function __construct($options = null)
 {
     $curators = new Peoples();
     $assigned = $curators->getCurators();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('actionsForTreasure');
     $curatorID = new Zend_Form_Element_Select('curatorID');
     $curatorID->setLabel('Curator assigned: ')->setRequired(true)->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
     $chaseDate = new ZendX_JQuery_Form_Element_DatePicker('chaseDate');
     $chaseDate->setLabel('Chase date assigned: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($curatorID, $chaseDate, $submit, $hash));
     $this->addDisplayGroup(array('curatorID', 'chaseDate'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:25,代码来源:TreasureAssignForm.php


示例10: setUp

 protected function setUp()
 {
     $this->_helper = new Zle_View_Helper_FormDatePicker();
     $this->_helper->setView($this->_view = new Zend_View());
     ZendX_JQuery::enableView($this->_helper->view);
     $this->_helperOptions = Zle_View_Helper_FormDatePicker::getDatePickerDefaultOptions();
 }
开发者ID:JellyBellyDev,项目名称:zle,代码行数:7,代码来源:FormDatePickerTest.php


示例11: fileBrowser

 /**
  * Render a File browser 
  *
  * @param  string $id
  * @param  string $value
  * @param  array  $params
  * @param  array  $attribs
  * @return string
  */
 public function fileBrowser($id, $value = '', array $params = array(), array $attribs = array())
 {
     $attribs = $this->_prepareAttributes($id, $value, $attribs);
     if (strlen($value) >= 6) {
         $params['color'] = $value;
     }
     if (count($params) > 0) {
         $params = ZendX_JQuery::encodeJson($params);
     } else {
         $params = "{}";
     }
     $js = sprintf('%s("#%s").click(function(){window.open("%s", "%s", "location=0,status=1,scrollbars=1,width=800,height=500");});', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'] . "_image", "/filemanager/file/browse?elementid=" . $attribs['id'], $attribs['id'] . "_window", $params);
     $this->jquery->addOnLoad($js);
     $js2 = sprintf("function callFunction(id, url, element_id) {\n        \telement_id = '#' + element_id\n        \tvar image_id = element_id + '_image';\n        \t%s(image_id).attr('src', url);\n        \t%s(element_id).attr('value', id);\n\t        }", ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), ZendX_JQuery_View_Helper_JQuery::getJQueryHandler());
     $this->view->headScript()->appendScript($js2);
     // XHTML or HTML end tag?
     $endTag = ' />';
     if ($this->view instanceof Zend_View_Abstract && !$this->view->doctype()->isXhtml()) {
         $endTag = '>';
     }
     if ($value && ($file = Zoo::getService('filemanager')->find($value)->current())) {
         $xhtml = '<img id="' . $attribs['id'] . '_image" src="' . $file->getUrl(150, 150) . '" ' . $endTag;
     } else {
         $xhtml = '<img id="' . $attribs['id'] . '_image" src="/images/crystal_project/128x128/mimetypes/ascii.png" ' . $endTag;
     }
     $xhtml .= $this->view->formHidden($id, $value, $attribs);
     return $xhtml;
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:37,代码来源:FileBrowser.php


示例12: _initViewHelpers

 protected function _initViewHelpers()
 {
     $this->bootstrap('layout');
     $layout = $this->getResource('layout');
     $view = $layout->getView();
     $view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
     $view->addHelperPath('Base/View/Helper/', 'Base_View_Helper');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     ZendX_JQuery::enableView($view);
     /*------ default blocks in the region right ---*/
     /*$blockM=new Base_View_Block();
        		$path="/layouts/scripts/page/blocks/journal";
        		$blocks=array("name"=>"search-destination", "order"=>"10", "path"=>$path);
        		$blockM->addBlock($blocks, 'journal');
        		$blocks=array("name"=>"right-banner", "order"=>"9", "path"=>$path);
        		$blockM->addBlock($blocks, 'journal');
        		$blocks=array("name"=>"recent-blog", "order"=>"8", "path"=>$path);
        		$blockM->addBlock($blocks, 'journal');
     
        		$blocks=array("name"=>"journal-categories", "order"=>"7", "path"=>$path);
        		$blockM->addBlock($blocks, 'journal');
        		$blocks=array("name"=>"tag-cloud", "order"=>"6", "path"=>$path);
        		$blockM->addBlock($blocks, 'journal');*/
     /*------ default blocks in the region right ---*/
 }
开发者ID:riteshsahu1981,项目名称:we,代码行数:27,代码来源:Bootstrap.php


示例13: dependentSelect

 /**
  * Builds an AutoComplete ready input field.
  *
  * This view helper builds an input field with the {@link Zend_View_Helper_FormText} FormText
  * Helper and adds additional javascript to the jQuery stack to initialize an AutoComplete
  * field. Make sure you have set one out of the two following options: $params['data'] or
  * $params['url']. The first one accepts an array as data input to the autoComplete, the
  * second accepts an url, where the autoComplete content is returned from. For the format
  * see jQuery documentation.
  *
  * @link   http://docs.jquery.com/UI/Autocomplete
  * @throws ZendX_JQuery_Exception
  * @param  String $id
  * @param  String $value
  * @param  array $params
  * @param  array $attribs
  * @return String
  */
 public function dependentSelect($id, $value = null, array $params = array(), array $attribs = array())
 {
     if (is_array($value) && count($params) == 0 && count($attribs) == 0) {
         $params = $value;
         $value = null;
     }
     $attribs = $this->_prepareAttributes($id, $value, $attribs);
     if (!isset($params['url']) || !isset($params['dependentElement'])) {
         ////require_once "ZendX/JQuery/Exception.php";
         throw new ZendX_JQuery_Exception("Cannot construct DependentSelect field without specifying Parameters Url and DependentElement");
     }
     $params['dependentElement'] = '#' . $params['dependentElement'];
     if ((!isset($attribs['translate']) || $attribs['translate']) && isset($params['defaultOption'])) {
         $params['defaultOption'] = $this->view->translate($params['defaultOption']);
     }
     $params = ZendX_JQuery::encodeJson($params);
     if (isset($attribs['translate'])) {
         unset($attribs['translate']);
     }
     $js = sprintf('%s("#%s").dependentSelect(%s);', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $params);
     $this->jquery->addOnLoad($js);
     if (isset($attribs['justDecorate']) && $attribs['justDecorate']) {
         return '';
     }
     if (isset($attribs['justDecorate'])) {
         unset($attribs['justDecorate']);
     }
     return $this->view->formText($id, $value, $attribs);
 }
开发者ID:BackupTheBerlios,项目名称:dkplusengine,代码行数:47,代码来源:DependentSelect.php


示例14: __construct

 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit));
     $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:32,代码来源:ResearchForm.php


示例15: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $levels = new ProjectTypes();
     $levelsListed = $levels->getDegrees();
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('education');
     ZendX_JQuery::enableForm($this);
     $school = new Zend_Form_Element_Text('school');
     $school->setLabel('Institution name: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 30)->addErrorMessage('Please enter a valid institutional name!')->setDecorators($decorators);
     $schoolUrl = new Zend_Form_Element_Text('schoolUrl');
     $schoolUrl->setLabel('Institution web address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('Uri')->setAttrib('size', 30)->addErrorMessage('Please enter a valid url!')->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Subject studied: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 30)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Adademic level of study: ')->addMultiOptions(array(NULL => 'Choose an academic level', 'Valid levels' => $levelsListed))->setDecorators($decorators);
     $dateFrom = new ZendX_JQuery_Form_Element_DatePicker('dateFrom');
     $dateFrom->setLabel('Commenced programme: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->addValidator('NotEmpty')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->setJQueryParams(array('yearRange' => '-20:+10'));
     $dateTo = new ZendX_JQuery_Form_Element_DatePicker('dateTo');
     $dateTo->setLabel('Finished programme: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty', 'Date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper')->setJQueryParams(array('yearRange' => '-20:+10'));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($school, $schoolUrl, $subject, $level, $dateFrom, $dateTo, $submit));
     $this->addDisplayGroup(array('school', 'schoolUrl', 'subject', 'level', 'dateFrom', 'dateTo'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Educational background');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:35,代码来源:EducationForm.php


示例16: init

 public function init()
 {
     //        $this->_auth = new My_Auth("user");
     $this->db = Zend_Registry::get('db');
     //        $this->_helper->layout()->setLayout('master');
     ZendX_JQuery::enableView($this->view);
 }
开发者ID:ankuradhey,项目名称:laundry,代码行数:7,代码来源:IndexController_29_10_2015.php


示例17: datePicker

 /**
  * Create a jQuery UI Widget Date Picker
  *
  * @link   http://docs.jquery.com/UI/Datepicker
  * @param  string $id
  * @param  string $value
  * @param  array  $params jQuery Widget Parameters
  * @param  array  $attribs HTML Element Attributes
  * @return string
  */
 public function datePicker($id, $value = null, array $params = array(), array $attribs = array())
 {
     $attribs = $this->_prepareAttributes($id, $value, $attribs);
     if (Zend_Registry::isRegistered('Zend_Locale')) {
         if (!isset($params['dateFormat'])) {
             $params['dateFormat'] = self::resolveZendLocaleToDatePickerFormat();
         }
         $days = Zend_Locale::getTranslationList('Days');
         if (!isset($params['dayNames'])) {
             $params['dayNames'] = array_values($days['format']['wide']);
         }
         if (!isset($params['dayNamesShort'])) {
             $params['dayNamesShort'] = array_values($days['format']['abbreviated']);
         }
         if (!isset($params['dayNamesMin'])) {
             $params['dayNamesMin'] = array_values($days['stand-alone']['narrow']);
         }
         $months = Zend_Locale::getTranslationList('Months');
         if (!isset($params['monthNames'])) {
             $params['monthNames'] = array_values($months['stand-alone']['wide']);
         }
         if (!isset($params['monthNamesShort'])) {
             $params['monthNamesShort'] = array_values($months['stand-alone']['narrow']);
         }
     }
     // TODO: Allow translation of DatePicker Text Values to get this action from client to server
     $params = ZendX_JQuery::encodeJson($params);
     $js = sprintf('%s("#%s").datepicker(%s);', ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), $attribs['id'], $params);
     $this->jquery->addOnLoad($js);
     return $this->view->formText($id, $value, $attribs);
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:41,代码来源:DatePicker.php


示例18: __construct

 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.');
     $specification = new Pas_Form_Element_CKEditor('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region');
     $live = new ZendX_JQuery_Form_Element_DatePicker('live');
     $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
     $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash));
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:38,代码来源:VacancyForm.php


示例19: __construct

 public function __construct($options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)))->setDecorators($decorators);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.')->setDecorators($decorators)->addValidato 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ZendX_JQuery_Form_Element_DatePicker类代码示例发布时间:2022-05-23
下一篇:
PHP ZendT_Lib类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap