本文整理汇总了PHP中Zend_Form_Element_Hidden::setDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Hidden::setDecorators方法的具体用法?PHP Zend_Form_Element_Hidden::setDecorators怎么用?PHP Zend_Form_Element_Hidden::setDecorators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Hidden
的用法示例。
在下文中一共展示了Zend_Form_Element_Hidden::setDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addProviderElements
protected function addProviderElements()
{
$this->setDescription('');
$this->loadDefaultDecorators();
$this->addDecorator('Description', array('placement' => 'prepend'));
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('MetroPcs Specific Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElements(array($element));
$this->addElement('text', 'ftp_host', array('label' => 'FTP Host:', 'filters' => array('StringTrim'), 'default' => 'ftp-int.vzw.real.com'));
$this->addElement('text', 'ftp_login', array('label' => 'FTP Login:', 'filters' => array('StringTrim')));
$this->addElement('text', 'ftp_pass', array('label' => 'FTP Password:', 'filters' => array('StringTrim')));
$this->addElement('text', 'ftp_path', array('label' => 'FTP Path:', 'filters' => array('StringTrim')));
/*
$this->addElement('text', 'provider_name', array(
'label' => 'Provider:',
'filters' => array('StringTrim')
));
*/
$this->addElement('text', 'provider_id', array('label' => 'Provider id:', 'filters' => array('StringTrim')));
$this->addDisplayGroup(array('ftp_host', 'ftp_login', 'ftp_pass', 'ftp_path', 'provider_name', 'provider_id'), 'general', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset')));
$this->addElement('select', 'entitlements', array('label' => 'Entitlement:', 'filters' => array('StringTrim'), 'multiOptions' => array('METROPCS_VIDEO_BASIC' => 'METROPCS_VIDEO_BASIC', 'PREMIUM' => 'PREMIUM', 'SUBSCRIPTION' => 'SUBSCRIPTION')));
$this->addElement('text', 'copyright', array('label' => 'Copyright:', 'filters' => array('StringTrim')));
$this->addElement('text', 'rating', array('label' => 'Rating:', 'filters' => array('StringTrim')));
$this->addElement('text', 'item_type', array('label' => 'Type:', 'filters' => array('StringTrim')));
$this->addDisplayGroup(array('entitlements', 'copyright', 'rating', 'item_type'), 'default_config_group', array('legend' => 'Default Metadata', 'decorators' => array('FormElements', 'Fieldset')));
}
示例2: init
public function init()
{
// if (!$this->hasTranslator()) {
// $this->setTranslator(Zend_Registry::get('Zend_Translate'));
// }
$requestid = new Zend_Form_Element_Hidden('RequestID');
$requestid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
$maTS = new Zend_Form_Element_Text('MaTS');
$maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
//
// $UserID = new Zend_Form_Element_Text('UserID');
// $UserID->setOptions(array(
// 'label' => 'UserID',
// 'required' => TRUE,
// 'filters' => array('StringTrim')
// ))
// ->setDecorators(array(
// array('ViewHelper', array('helper' => 'formText')),
// array('Label', array('class' => 'label'))
// ));
$utype = new Zend_Form_Element_Select('Type');
$utype->setOptions(array('label' => 'Loại yêu cầu', 'required' => TRUE, 'MultiOptions' => array(0 => 'Yêu cầu mượn TS', 1 => 'Yêu cầu nâng cấp')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
$detail = new Zend_Form_Element_Textarea('Detail');
$detail->setOptions(array('label' => 'Chi tiết yêu cầu', 'style' => "width: 200px; height: 100px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
$this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($requestid, $maTS, $utype, $detail))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
}
示例3: _id_encontro
protected function _id_encontro()
{
$e = new Zend_Form_Element_Hidden('id_encontro');
$e->addFilter('Int');
$e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
return $e;
}
示例4: init
public function init()
{
// if (!$this->hasTranslator()) {
// $this->setTranslator(Zend_Registry::get('Zend_Translate'));
// }
$itemid = new Zend_Form_Element_Hidden('ItemID');
$itemid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
$maTS = new Zend_Form_Element_Text('MaTS');
$maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$tenTS = new Zend_Form_Element_Text('TenTS');
$tenTS->setOptions(array('label' => 'Tên tài sản', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$descr = new Zend_Form_Element_Textarea('Description');
$descr->setOptions(array('label' => 'Mô tả', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
$type = new Zend_Form_Element_Select('Type');
$type->setOptions(array('label' => 'Loại bảo mật', 'required' => TRUE, 'MultiOptions' => array(1 => 'Bảo mật thấp', 0 => 'Bảo mật cao')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
$startDate = new Zend_Form_Element_Text('StartDate');
$startDate->setOptions(array('label' => 'Bắt đầu SD', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$price = new Zend_Form_Element_Text('Price');
$price->setOptions(array('label' => 'Giá', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$warrantyTime = new Zend_Form_Element_Text('WarrantyTime');
$warrantyTime->setOptions(array('label' => 'Bảo hành', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$status = new Zend_Form_Element_Select('Status');
$status->setOptions(array('label' => 'Tình trạng', 'required' => TRUE, 'MultiOptions' => array(0 => 'Có thể mượn', 1 => 'Đang cho mượn', 2 => 'Hỏng')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
$place = new Zend_Form_Element_Textarea('Place');
$place->setOptions(array('label' => 'Địa điểm hiện tại', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
$this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($itemid, $maTS, $tenTS, $descr, $type, $startDate, $price, $warrantyTime, $status, $place))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
}
示例5: addProviderElements
protected function addProviderElements()
{
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('YouTube Specific Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElements(array($element));
// General
$this->addElement('text', 'username', array('label' => 'YouTube Account:', 'filters' => array('StringTrim')));
// General
$this->addElement('text', 'password', array('label' => 'YouTube Password:', 'filters' => array('StringTrim')));
// $this->addMetadataProfile();
$this->addDisplayGroup(array('username', 'password'), 'general', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset')));
$this->addMetadataProfile(true);
// taken from http://gdata.youtube.com/schemas/2007/categories.cat
$youTubeCategories = array('Film' => 'Film & Animation', 'Autos' => 'Autos & Vehicles', 'Music' => 'Music', 'Animals' => 'Pets & Animals', 'Sports' => 'Sports', 'Travel' => 'Travel & Events', 'Shortmov' => 'Short Movies', 'Videoblog' => 'Videoblogging', 'Games' => 'Gaming', 'Comedy' => 'Comedy', 'People' => 'People & Blogs', 'News' => 'News & Politics', 'Entertainment' => 'Entertainment', 'Education' => 'Education', 'Howto' => 'Howto & Style', 'Nonprofit' => 'Nonprofits & Activism', 'Tech' => 'Science & Technology', 'Movies_Anime_animation' => 'Movies - Anime/Animation', 'Movies' => 'Movies', 'Movies_Comedy' => 'Movies - Comedy', 'Movies_Documentary' => 'Movies - Documentary', 'Movies_Action_adventure' => 'Movies - Action/Adventure', 'Movies_Classics' => 'Movies - Classics', 'Movies_Foreign' => 'Movies - Foreign', 'Movies_Horror' => 'Movies - Horror', 'Movies_Drama' => 'Movies - Drama', 'Movies_Family' => 'Movies - Family', 'Movies_Shorts' => 'Movies - Shorts', 'Shows' => 'Shows', 'Movies_Sci_fi_fantasy' => 'Movies - Sci-Fi/Fantasy', 'Movies_Thriller' => 'Movies - Thriller', 'Trailers' => 'Trailers');
// Metadata
$this->addElement('select', 'default_category', array('label' => 'Default Category:', 'multioptions' => $youTubeCategories));
$this->addDisplayGroup(array('default_category', 'metadata_profile_id'), 'metadata', array('legend' => 'Metadata', 'decorators' => array('FormElements', 'Fieldset')));
// Community
$this->addElement('select', 'allow_comments', array('label' => 'Allow Comments:', 'multioptions' => array('allowed' => 'allowed', 'denied' => 'denied', 'moderated' => 'moderated')));
$this->addElement('select', 'allow_embedding', array('label' => 'Allow Embedding:', 'multioptions' => array('allowed' => 'allowed', 'denied' => 'denied')));
$this->addElement('select', 'allow_ratings', array('label' => 'Allow Ratings:', 'multioptions' => array('allowed' => 'allowed', 'denied' => 'denied')));
$this->addElement('select', 'allow_responses', array('label' => 'Allow Responses:', 'multioptions' => array('allowed' => 'allowed', 'denied' => 'denied', 'moderated' => 'moderated')));
$this->addDisplayGroup(array('allow_comments', 'allow_embedding', 'allow_ratings', 'allow_responses'), 'community', array('legend' => 'Community', 'decorators' => array('FormElements', 'Fieldset')));
}
示例6: addProviderElements
protected function addProviderElements()
{
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('Hulu Specific Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElements(array($element));
$this->addElement('select', 'protocol', array('label' => 'Protocol:', 'filters' => array('StringTrim'), 'multiOptions' => array(Kaltura_Client_ContentDistribution_Enum_DistributionProtocol::SFTP => 'SFTP', Kaltura_Client_ContentDistribution_Enum_DistributionProtocol::ASPERA => 'ASPERA'), 'required' => true));
$this->addElement('text', 'sftp_host', array('label' => 'SFTP Host:', 'filters' => array('StringTrim'), 'default' => 'sftp.hulu.com'));
$this->addElement('text', 'aspera_host', array('label' => 'Aspera Host:', 'filters' => array('StringTrim')));
$this->addElement('text', 'port', array('label' => 'Port:', 'filters' => array('StringTrim'), 'value' => '22', 'required' => true));
$this->addElement('text', 'sftp_login', array('label' => 'SFTP Login:', 'filters' => array('StringTrim')));
$this->addElement('text', 'sftp_pass', array('label' => 'SFTP Password:', 'filters' => array('StringTrim')));
$this->addElement('text', 'aspera_login', array('label' => 'Aspera Login:', 'filters' => array('StringTrim')));
$this->addElement('text', 'aspera_pass', array('label' => 'Aspera Password:', 'filters' => array('StringTrim')));
$this->addElement('text', 'passphrase', array('label' => 'Key Passphrase:', 'filters' => array('StringTrim')));
$this->addElement('file', 'aspera_public_key', array('label' => 'Public Key:'));
$this->addElement('textarea', 'aspera_public_key_readonly', array('label' => 'Public Key:', 'readonly' => true));
$this->addElement('file', 'aspera_private_key', array('label' => 'Private Key:'));
$this->addElement('textarea', 'aspera_private_key_readonly', array('label' => 'Private Key:', 'readonly' => true));
$this->addDisplayGroup(array('protocol', 'sftp_host', 'port', 'sftp_login', 'sftp_pass', 'aspera_host', 'aspera_login', 'aspera_pass', 'passphrase', 'aspera_public_key', 'aspera_public_key_readonly', 'aspera_private_key', 'aspera_private_key_readonly'), 'general', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset')));
$this->addElement('text', 'series_channel', array('label' => 'Series Channel:', 'filters' => array('StringTrim')));
$this->addElement('select', 'series_primary_category', array('label' => 'Series Primary Category:', 'filters' => array('StringTrim'), 'multiOptions' => array_merge(array('' => ''), $this->getPrimaryCategoryList())));
$this->addElement('multiCheckbox', 'series_additional_categories', array('label' => 'Series Additional Categories:', 'filters' => array('StringTrim'), 'multiOptions' => $this->getPrimaryCategoryList()));
$this->addElement('text', 'season_number', array('label' => 'Season Number:', 'filters' => array('StringTrim')));
$this->addElement('text', 'season_synopsis', array('label' => 'Season Synopsis:', 'filters' => array('StringTrim')));
$this->addElement('text', 'season_tune_in_information', array('label' => 'Season Tune In Information:', 'filters' => array('StringTrim')));
$this->addElement('select', 'video_media_type', array('label' => 'Video Media Type:', 'filters' => array('StringTrim'), 'multiOptions' => array_merge(array('' => ''), $this->getVideoMediaTypeList())));
$this->addDisplayGroup(array('series_channel', 'series_primary_category', 'series_additional_categories', 'season_number', 'season_synopsis', 'season_tune_in_information', 'video_media_type'), 'default_config_group', array('legend' => 'Default Metadata', 'decorators' => array('FormElements', 'Fieldset')));
$this->addElement('checkbox', 'disable_episode_number_custom_validation', array('label' => 'Disable Episode Number Custom Validation:'));
$this->addDisplayGroup(array('disable_episode_number_custom_validation'), 'custom_config_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
}
示例7: addProviderElements
protected function addProviderElements()
{
$this->setDescription('Unicorn Distribution Profile');
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('Unicorn Specific Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElements(array($element));
$this->addElement('text', 'api_host_url', array('label' => 'API host URL:', 'filters' => array('StringTrim')));
$this->addElement('text', 'username', array('label' => 'Username:', 'filters' => array('StringTrim')));
$this->addElement('text', 'password', array('label' => 'Password:', 'filters' => array('StringTrim')));
$this->addElement('text', 'domain_name', array('label' => 'Domain name:', 'filters' => array('StringTrim')));
$this->addElement('text', 'domain_guid', array('label' => 'Domain GUID:', 'filters' => array('StringTrim')));
$this->addElement('text', 'channel_guid', array('label' => 'Channel GUID:', 'filters' => array('StringTrim')));
$this->addElement('text', 'ad_free_application_guid', array('label' => 'Ad free application GUID:', 'filters' => array('StringTrim')));
$this->addElement('select', 'remote_asset_params_id', array('label' => 'Remote asset params ID:', 'registerInArrayValidator' => false));
$storageProfiles = array();
try {
$client = Infra_ClientHelper::getClient();
Infra_ClientHelper::impersonate($this->partnerId);
$storageProfileList = $client->storageProfile->listAction();
Infra_ClientHelper::unimpersonate();
foreach ($storageProfileList->objects as $storageProfile) {
/* @var $storageProfile Kaltura_Client_Type_StorageProfile */
$storageProfiles[$storageProfile->id] = $storageProfile->name;
}
} catch (Kaltura_Client_Exception $e) {
}
$this->addElement('select', 'storage_profile_id', array('label' => 'Storage profile ID:', 'multiOptions' => $storageProfiles));
}
示例8: init
public function init()
{
$this->setAttrib('id', 'frmDrmProfileConfigure');
$this->setMethod('post');
$titleElement = new Zend_Form_Element_Hidden('generalTitle');
$titleElement->setLabel('General');
$titleElement->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElement($titleElement);
$this->addElement('text', 'id', array('label' => 'ID:', 'filters' => array('StringTrim'), 'readonly' => true, 'disabled' => 'disabled'));
$this->addElement('text', 'partnerId', array('label' => 'Related Publisher ID:', 'required' => true, 'filters' => array('StringTrim'), 'placement' => 'prepend', 'readonly' => true));
$this->addElement('text', 'name', array('label' => 'Drm Profile Name:', 'required' => true, 'filters' => array('StringTrim'), 'placement' => 'prepend'));
$this->addElement('text', 'description', array('label' => 'Description:', 'required' => false, 'filters' => array('StringTrim')));
$providerForView = new Kaltura_Form_Element_EnumSelect('typeForView', array('enum' => 'Kaltura_Client_Drm_Enum_DrmProviderType'));
$providerForView->setLabel('Provider:');
$providerForView->setAttrib('readonly', true);
$providerForView->setAttrib('disabled', 'disabled');
$providerForView->setValue($this->drmProfileProvider);
$this->addElement($providerForView);
$this->addElement('hidden', 'provider', array('filters' => array('StringTrim'), 'decorators' => array('ViewHelper'), 'value' => $this->drmProfileProvider));
$this->addElement('hidden', 'crossLine1', array('decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'hr', 'class' => 'crossLine')))));
$titleElement = new Zend_Form_Element_Hidden('detailsTitle');
$titleElement->setLabel('Details');
$titleElement->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElement($titleElement);
$this->addElement('text', 'licenseServerUrl', array('label' => 'License Server Url', 'required' => false, 'filters' => array('StringTrim')));
// --------------------------------
$extendTypeSubForm = KalturaPluginManager::loadObject('Form_DrmProfileConfigureExtend_SubForm', $this->drmProfileProvider);
if ($extendTypeSubForm) {
$extendTypeSubForm->setDecorators(array('FormElements'));
$this->addSubForm($extendTypeSubForm, self::EXTENSION_SUBFORM_NAME);
}
//------------------------------------
}
示例9: _mensagem
protected function _mensagem()
{
$e = new Zend_Form_Element_Hidden('mensagem');
$e->setLabel(_('Message') . ":")->setRequired(true)->addFilter('StringTrim');
$e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
return $e;
}
示例10: setupHash
protected function setupHash()
{
$this->hidden = new Zend_Form_Element_Hidden(self::HIDDEN_HASH);
$this->hidden->setValue($this->formName);
$this->addElements(array($this->hidden));
$this->hidden->setDecorators($this->getHiddenDecorators());
}
示例11: addProviderElements
protected function addProviderElements()
{
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('DoubleClick Specific Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElements(array($element));
$element = new Zend_Form_Element_Text('cue_points_provider');
$element->setLabel('Cue Points Provider:');
$this->addElement($element);
$element = new Zend_Form_Element_Text('items_per_page');
$element->setLabel('Items Per Page:');
$this->addElement($element);
$this->setDefault('items_per_page', 100);
$this->addDisplayGroup(array('cue_points_provider', 'items_per_page'), 'general_group', array('legend' => 'General', 'decorators' => array('FormElements', 'Fieldset')));
$element = new Zend_Form_Element_Text('channel_title');
$element->setLabel('Channel title:');
$this->addElement($element);
$element = new Zend_Form_Element_Text('channel_description');
$element->setLabel('Channel description:');
$this->addElement($element);
$element = new Zend_Form_Element_Text('channel_link');
$element->setLabel('Channel link:');
$this->addElement($element);
$element = new Zend_Form_Element_Checkbox('ignore_scheduling_in_feed');
$element->setLabel('Ignore Scheduling In Feed, As Default Feed Behavior');
$this->addElement($element);
$this->addDisplayGroup(array('channel_title', 'channel_description', 'channel_link', 'ignore_scheduling_in_feed'), 'channel', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
$element = new Zend_Form_Element_Hidden('feed_url');
$element->clearDecorators();
$element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
$this->addElement($element);
$this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
}
示例12: init
/** Initialize this form. */
public function init()
{
$this->setName('sizequota_folder');
$this->setAction($this->getView()->baseUrl('/sizequota/folder/submit'));
$this->setMethod('POST');
$csrf = new Midas_Form_Element_Hash('csrf');
$csrf->setSalt('FDXuUnSDkUE7Anh2kqgca8zv');
$csrf->setDecorators(array('ViewHelper'));
$folderId = new Zend_Form_Element_Hidden('folder_id');
$folderId->setDecorators(array('ViewHelper'));
$useDefaultFolderQuota = new Zend_Form_Element_Checkbox('use_default_folder_quota');
$useDefaultFolderQuota->setLabel('Use Default Folder Quota');
$folderQuotaValue = new Zend_Form_Element_Text('folder_quota_value');
$folderQuotaValue->setLabel('Quota');
$folderQuotaValue->addValidator('Float', true);
$folderQuotaValue->addValidator('Between', true, array('min' => 0, 'max' => PHP_INT_MAX));
$folderQuotaUnit = new Zend_Form_Element_Select('folder_quota_unit');
$folderQuotaUnit->setLabel('Unit');
$folderQuotaUnit->setRequired(true);
$folderQuotaUnit->addValidator('NotEmpty', true);
$folderQuotaUnit->addMultiOptions(array(MIDAS_SIZE_B => 'B', MIDAS_SIZE_KB => 'KB', MIDAS_SIZE_MB => 'MB', MIDAS_SIZE_GB => 'GB', MIDAS_SIZE_TB => 'TB'));
$this->addDisplayGroup(array($useDefaultFolderQuota, $folderQuotaValue, $folderQuotaUnit), 'global');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Save');
$this->addElements(array($csrf, $folderId, $useDefaultFolderQuota, $folderQuotaValue, $folderQuotaUnit, $submit));
}
示例13: init
public function init()
{
// if (!$this->hasTranslator()) {
// $this->setTranslator(Zend_Registry::get('Zend_Translate'));
// }
$userid = new Zend_Form_Element_Hidden('UserID');
$userid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
$username = new Zend_Form_Element_Text('Username');
$username->setOptions(array('label' => 'Username', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$birthday = new Zend_Form_Element_Text('Birthday');
$birthday->setOptions(array('label' => 'Birthday', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$role = new Zend_Form_Element_Select('Role');
$role->setOptions(array('label' => 'User Type', 'MultiOptions' => array(3 => 'User', 2 => 'IT', 1 => 'Admin', 0 => 'SuperAdmin')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
$fullname = new Zend_Form_Element_Text('FullName');
$fullname->setOptions(array('label' => 'FullName'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$email = new Zend_Form_Element_Text('Email');
$email->setOptions(array('label' => 'Email', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$group = new Zend_Form_Element_Text('Group');
$group->setOptions(array('label' => 'Group'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$phone = new Zend_Form_Element_Text('Phone');
$phone->setOptions(array('label' => 'Phone'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
$address = new Zend_Form_Element_Textarea('Address');
$address->setOptions(array('label' => 'Address', 'style' => "width: 200px; height: 150px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
$this->setName('user-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($userid, $username, $role, $fullname, $email, $birthday, $group, $phone, $address))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
}
示例14: addProviderElements
protected function addProviderElements()
{
$element = new Zend_Form_Element_Hidden('providerElements');
$element->setLabel('TV.com Provider Configuration');
$element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
$this->addElement($element);
$element = new Zend_Form_Element_Text('feed_title');
$element->setLabel('Feed title:');
$element->addValidator(new Zend_Validate_StringLength(0, 128));
$this->addElement($element);
$element = new Zend_Form_Element_Text('feed_link');
$element->setLabel('Feed link:');
$element->addValidator(new Zend_Validate_StringLength(0, 255));
$this->addElement($element);
$element = new Zend_Form_Element_Text('feed_description');
$element->setLabel('Feed description:');
$element->addValidator(new Zend_Validate_StringLength(0, 255));
$this->addElement($element);
$this->addElement('Text', 'feed_language', array('label' => 'Feed language:', 'value' => 'en-us'));
$this->addElement('Text', 'feed_copyright', array('label' => 'Feed copyright:'));
$this->addElement('Text', 'feed_image_title', array('label' => 'Feed image title:'));
$this->addElement('Text', 'feed_image_url', array('label' => 'Feed image url:'));
$this->addElement('Text', 'feed_image_link', array('label' => 'Feed image link:'));
$this->addElement('Text', 'feed_image_width', array('label' => 'Feed image width:'));
$this->addElement('Text', 'feed_image_height', array('label' => 'Feed image height:'));
$element = new Zend_Form_Element_Hidden('feed_url');
$element->clearDecorators();
$element->addDecorator('Callback', array('callback' => array($this, 'renderFeedUrl')));
$this->addElement($element);
$this->addDisplayGroup(array('feed_title', 'feed_link', 'feed_description', 'feed_language', 'feed_copyright'), 'feed', array('legend' => 'Feed Configuration', 'decorators' => array('FormElements', 'Fieldset')));
$this->addDisplayGroup(array('feed_image_title', 'feed_image_url', 'feed_image_link', 'feed_image_width', 'feed_image_height'), 'feed_image', array('legend' => 'Feed Image Configuration', 'decorators' => array('FormElements', 'Fieldset')));
$this->addDisplayGroup(array('feed_url'), 'feed_url_group', array('legend' => '', 'decorators' => array('FormElements', 'Fieldset')));
}
示例15: __construct
/**
* @author code generate
* @return mixed
*/
public function __construct($option = array())
{
$classId = new Zend_Form_Element_Hidden('UserId');
$classId->setDecorators(array('ViewHelper'));
$this->addElement($classId);
$email = new Zend_Form_Element_Text('Email');
$email->setLabel('Email *');
$email->addFilter('StringTrim');
$email->setRequired(true);
$email->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
$email->addValidator(new Zend_Validate_Db_NoRecordExists("Users", "Email"));
$email->addValidator('EmailAddress', true);
$email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Email không phù hợp")));
$this->addElement($email);
$save = new Zend_Form_Element_Submit('Save');
$save->setLabel('Đăng ký');
$save->setAttrib('class', 'btn btn-primary');
$save->setDecorators(array('ViewHelper'));
$this->addElement($save);
$reset = new Zend_Form_Element_Reset('Reset');
$reset->setLabel('Làm lại');
$reset->setAttrib('class', 'btn btn-primary');
$reset->setDecorators(array('ViewHelper'));
$this->addElement($reset);
}