本文整理汇总了PHP中Zikula_Form_View::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP Zikula_Form_View::assign方法的具体用法?PHP Zikula_Form_View::assign怎么用?PHP Zikula_Form_View::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zikula_Form_View
的用法示例。
在下文中一共展示了Zikula_Form_View::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
public function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Mailer::', '::', ACCESS_ADMIN)) {
throw new Zikula_Exception_Forbidden(LogUtil::getErrorMsgPermission());
}
// assign the module mail agent types
$view->assign('mailertypeItems', array(
array('value' => 1, 'text' => DataUtil::formatForDisplay($this->__("Internal PHP `mail()` function"))),
array('value' => 2, 'text' => DataUtil::formatForDisplay($this->__('Sendmail message transfer agent'))),
array('value' => 3, 'text' => DataUtil::formatForDisplay($this->__('QMail message transfer agent'))),
array('value' => 4, 'text' => DataUtil::formatForDisplay($this->__('SMTP mail transfer protocol'))),
array('value' => 5, 'text' => DataUtil::formatForDisplay($this->__('Development/debug mode (Redirect e-mails to LogUtil)')))
));
$view->assign('encodingItems', array(
array('value' => '8bit', 'text' => '8bit'),
array('value' => '7bit', 'text' => '7bit'),
array('value' => 'binary', 'text' => 'binary'),
array('value' => 'base64', 'text' => 'base64'),
array('value' => 'quoted-printable', 'text' => 'quoted-printable')
));
$view->assign('smtpsecuremethodItems', array(
array('value' => '', 'text' => 'None'),
array('value' => 'ssl', 'text' => 'SSL'),
array('value' => 'tls', 'text' => 'TLS')
));
// assign all module vars
$this->view->assign($this->getVars());
return true;
}
示例2: initialize
/**
* Setup form.
*
* @param Zikula_Form_View $view Current Zikula_Form_View instance.
*
* @return boolean
*/
public function initialize(Zikula_Form_View $view)
{
// load and assign registred categories
$categories = CategoryRegistryUtil::getRegisteredModuleCategories('ExampleDoctrine', 'User', 'id');
$view->assign('registries', $categories);
$id = FormUtil::getPassedValue('id', null, "GET", FILTER_SANITIZE_NUMBER_INT);
if ($id) {
// load user with id
$user = $this->entityManager->find('ExampleDoctrine_Entity_User', $id);
if ($user) {
// switch to edit mode
$this->_id = $id;
} else {
return LogUtil::registerError($this->__f('User with id %s not found', $id));
}
} else {
$user = new ExampleDoctrine_Entity_User();
}
$userData = $user->toArray();
// overwrite attributes array entry with a form compitable format
$field1 = $user->getAttributes()->get('field1') ? $user->getAttributes()->get('field1')->getValue() : '';
$field2 = $user->getAttributes()->get('field2') ? $user->getAttributes()->get('field2')->getValue() : '';
$userData['attributes'] = array('field1' => $field1, 'field2' => $field2);
// assign current values to form fields
$view->assign('user', $user)->assign('meta', $user->getMetadata() != null ? $user->getMetadata()->toArray() : array())->assign($userData);
$this->_user = $user;
return true;
}
示例3: initialize
function initialize(Zikula_Form_View $view)
{
$this->id = (int) FormUtil::getPassedValue('id', -1, 'GETPOST');
$objectid = FormUtil::getPassedValue('objectid', '', 'GETPOST');
$redirect = base64_decode(FormUtil::getPassedValue('redirect', '', 'GETPOST'));
$view->caching = false;
$comment = ModUtil::apiFunc('EZComments', 'user', 'get', array('id' => $this->id));
if ($comment == false || !is_array($comment)) {
return LogUtil::registerError($this->__('No such comment found.'), ModUtil::url('EZComments', 'user', 'main'));
}
// check if user is allowed to modify this content
$modifyowntime = (int) ModUtil::getVar('EZComments', 'modifyowntime');
$ts = strtotime($comment['date']);
if (!SecurityUtil::checkPermission('EZComments::', '::', ACCESS_ADMIN)) {
// user has no admin permissions. Only commenting user should be able to modify
if ($comment['uid'] != UserUtil::getVar('uid')) {
// foreign content and no admin permissions
$view->assign('nomodify', 1);
$this->nomodify = 1;
} else {
if ($modifyowntime > 0 && $ts + $modifyowntime * 60 * 60 < time()) {
$view->assign('nomodify', 1);
$this->nomodify = 1;
}
}
} else {
$view->assign('nomodify', 0);
$this->nomodify = 0;
}
$view->assign('redirect', isset($redirect) && !empty($redirect) ? true : false);
// finally asign the comment information
$view->assign($comment);
return true;
}
示例4: initialize
function initialize(Zikula_Form_View $view)
{
$view->caching = false;
$view->add_core_data();
$view->assign('avatarpath', ModUtil::getVar('Users', 'avatarpath'));
$view->assign('avatarpath_writable', is_writable(ModUtil::getVar('Users', 'avatarpath')));
$view->assign('pnphpbb_installed', ModUtil::available('pnphpbb'));
$view->assign('forumdir_writable', is_writable(ModUtil::getVar('Avatar', 'forumdir')));
return true;
}
示例5: initialize
function initialize(Zikula_Form_View $view)
{
$view->addPluginDir('system/Admin/Resources/views/plugins');
// for Core 1.3.6+
$view->addPluginDir('system/Admin/templates/plugins');
// for Core 1.3.5
$this->editor = $view->getPluginName();
$classname = 'ModulePlugin_Scribite_' . $this->editor . '_Plugin';
if (method_exists($classname, 'getOptions')) {
$options = $classname::getOptions();
if (!empty($options)) {
$view->assign($options);
}
}
$view->assign(ModUtil::getVar("moduleplugin.scribite." . strtolower($this->editor)));
return true;
}
示例6: smarty_function_formcontextmenureference
/**
* Context menu reference
*
* This plugin creates a context menu reference.
*
* @param array $params Parameters passed in the block tag.
* @param Zikula_Form_View $view Reference to Form render object.
*
* @return string The rendered output.
*/
function smarty_function_formcontextmenureference($params, $view)
{
$output = $view->registerPlugin('Zikula_Form_Plugin_ContextMenu_Reference', $params);
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $output);
} else {
return $output;
}
}
示例7: initialize
function initialize(Zikula_Form_View $view)
{
$view->caching = false;
$templates = array();
$rawtemplates = ModUtil::apiFunc('EZComments', 'user', 'gettemplates');
if (is_array($rawtemplates) && count($rawtemplates) != 0) {
foreach ($rawtemplates as $rawtemplate) {
$templates[] = array('text' => $rawtemplate, 'value' => $rawtemplate);
}
}
$view->assign('templates', $templates);
// is the akismet module available
$view->assign('akismetavailable', ModUtil::available('Akismet'));
$statuslevels = array(array('text' => $this->__('Approved'), 'value' => 0), array('text' => $this->__('Pending'), 'value' => 1), array('text' => $this->__('Rejected'), 'value' => 2));
$view->assign('statuslevels', $statuslevels);
$feeds = array(array('text' => $this->__('Atom 0.3'), 'value' => 'atom'), array('text' => $this->__('RSS 2.0'), 'value' => 'rss'));
$view->assign('feeds', $feeds);
return true;
}
示例8: smarty_function_muboardGetLastPost
/**
* The muboardSelectorTemplates plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_muboardGetLastPost($params, $view)
{
$where = 'tbl.';
ModUtil::apiFunc('MUBoard', 'selection', 'getEntities');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例9: smarty_function_muboardSelectorTemplates
/**
* The muboardSelectorTemplates plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_muboardSelectorTemplates($params, $view)
{
$result = array();
$result[] = array('text' => $view->__('Only item titles'), 'value' => 'itemlist_display.tpl');
$result[] = array('text' => $view->__('With description'), 'value' => 'itemlist_display_description.tpl');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例10: smarty_function_reviewsObjectTypeSelector
/**
* The reviewsObjectTypeSelector plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_reviewsObjectTypeSelector($params, $view)
{
$dom = ZLanguage::getModuleDomain('Reviews');
$result = array();
$result[] = array('text' => __('Reviews', $dom), 'value' => 'review');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例11: initialize
function initialize(Zikula_Form_View $view)
{
if (!SecurityUtil::checkPermission('Scribite::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// get all editors
$editorList = ModUtil::apiFunc('Scribite', 'admin', 'getEditors', array('format' => 'formdropdownlist'));
$view->assign('editor_list', $editorList);
$vars = $this->getVars();
$view->assign($vars);
$paramsString = '';
if (isset($vars['defaultparameters'])) {
foreach ($vars['defaultparameters'] as $param => $value) {
$paramsString .= "{$param}:{$value},";
}
}
// overwrites previous assignment...
$view->assign('defaultparameters', rtrim($paramsString, ","));
return true;
}
示例12: smarty_function_zikularoutesmoduleObjectTypeSelector
/**
* The zikularoutesmoduleObjectTypeSelector plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_zikularoutesmoduleObjectTypeSelector($params, $view)
{
$dom = \ZLanguage::getModuleDomain('ZikulaRoutesModule');
$result = array();
$result[] = array('text' => __('Routes', $dom), 'value' => 'route');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例13: smarty_function_muboardSelectorObjectTypes
/**
* The muboardSelectorObjectTypes plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_muboardSelectorObjectTypes($params, $view)
{
$result = array();
$result[] = array('text' => $view->__('Categories'), 'value' => 'category');
$result[] = array('text' => $view->__('Forums'), 'value' => 'forum');
$result[] = array('text' => $view->__('Postings'), 'value' => 'posting');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例14: smarty_function_muvideoObjectTypeSelector
/**
* The muvideoObjectTypeSelector plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_muvideoObjectTypeSelector($params, $view)
{
$dom = ZLanguage::getModuleDomain('MUVideo');
$result = array();
$result[] = array('text' => __('Collections', $dom), 'value' => 'collection');
$result[] = array('text' => __('Movies', $dom), 'value' => 'movie');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}
示例15: smarty_function_muvideoTemplateSelector
/**
* The muvideoTemplateSelector plugin provides items for a dropdown selector.
*
* Available parameters:
* - assign: If set, the results are assigned to the corresponding variable instead of printed out.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_Form_View $view Reference to the view object.
*
* @return string The output of the plugin.
*/
function smarty_function_muvideoTemplateSelector($params, $view)
{
$dom = ZLanguage::getModuleDomain('MUVideo');
$result = array();
$result[] = array('text' => __('Only item titles', $dom), 'value' => 'itemlist_display.tpl');
$result[] = array('text' => __('With description', $dom), 'value' => 'itemlist_display_description.tpl');
$result[] = array('text' => __('Custom template', $dom), 'value' => 'custom');
if (array_key_exists('assign', $params)) {
$view->assign($params['assign'], $result);
return;
}
return $result;
}