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

PHP Zikula_Form_View类代码示例

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

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



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

示例1: handleCommand

 /**
  * Handle form submission.
  *
  * @param Zikula_Form_View $view  Current Zikula_Form_View instance.
  * @param array            &$args Args.
  *
  * @return boolean
  */
 public function handleCommand(Zikula_Form_View $view, &$args)
 {
     // check for valid form
     if (!$view->isValid()) {
         return false;
     }
     // load form values
     $data = $view->getValues();
     $user = $this->_user;
     // merge attributes
     foreach ($data['attributes'] as $name => $value) {
         $user->setAttribute($name, $value);
     }
     // merge metadata
     $metadata = $user->getMetadata();
     if ($metadata == null) {
         $metadata = new ExampleDoctrine_Entity_UserMetadata($user);
         $user->setMetadata($metadata);
     }
     $metadata->merge($data['meta']);
     unset($data['attributes'], $data['meta']);
     // merge user and save everything
     $user->merge($data);
     $this->entityManager->persist($user);
     $this->entityManager->flush();
     return $view->redirect(ModUtil::url('ExampleDoctrine', 'user', 'view'));
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:35,代码来源:Edit.php


示例2: handleCommand

 function handleCommand(Zikula_Form_View $view, &$args)
 {
     if ($args['commandName'] == 'cancel') {
         $url = ModUtil::url('Scribite', 'admin', 'main');
         return $view->redirect($url);
     } else {
         if ($args['commandName'] == 'restore') {
             $classname = 'ModulePlugin_Scribite_' . $this->editor . '_Plugin';
             if (method_exists($classname, 'getDefaults')) {
                 $defaults = $classname::getDefaults();
                 if (!empty($defaults)) {
                     ModUtil::setVars("moduleplugin.scribite." . strtolower($this->editor), $defaults);
                     LogUtil::registerStatus('Defaults succesfully restored.');
                 }
             }
             return true;
         }
     }
     // check for valid form
     if (!$view->isValid()) {
         return false;
     }
     $data = $view->getValues();
     ModUtil::setVars("moduleplugin.scribite." . strtolower($this->editor), $data);
     LogUtil::registerStatus($this->__('Done! Module configuration updated.'));
     return true;
 }
开发者ID:pheski,项目名称:Scribite,代码行数:27,代码来源:ModifyEditor.php


示例3: initialize

 /**
  * Initialize form handler.
  *
  * This method takes care of all necessary initialisation of our data and form states.
  *
  * @return boolean False in case of initialization errors, otherwise true.
  */
 public function initialize(Zikula_Form_View $view)
 {
     // permission check
     if (!SecurityUtil::checkPermission('MUBoard::', '::', ACCESS_ADMIN)) {
         return $view->registerError(LogUtil::registerPermissionError());
     }
     // retrieve module vars
     $modVars = ModUtil::getVar('MUBoard');
     // initialise list entries for the 'number images' setting
     $modVars['numberImagesItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
     // initialise list entries for the 'number files' setting
     $modVars['numberFilesItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
     // initialise list entries for the 'sorting postings' setting
     $modVars['sortingPostingsItems'] = array(array('value' => 'descending', 'text' => 'Descending'), array('value' => 'ascending', 'text' => 'Ascending'));
     // initialise list entries for the 'icon set' setting
     $modVars['iconSetItems'] = array(array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'));
     // initialise list entries for the 'template' setting
     $modVars['templateItems'] = array(array('value' => 'normal', 'text' => 'Normal'), array('value' => 'jquery', 'text' => 'JQuery'));
     // assign all module vars
     $this->view->assign('config', $modVars);
     // custom initialisation aspects
     $this->initializeAdditions();
     // everything okay, no initialization errors occured
     return true;
 }
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:32,代码来源:Config.php


示例4: render

 /**
  * Render event handler.
  *
  * @param Zikula_Form_View $view Reference to Form render object.
  *
  * @return string The rendered output
  */
 function render(Zikula_Form_View $view)
 {
     $imageURL = $this->imageURL == null ? 'images/icons/extrasmall/tab_right.png' : $this->imageURL;
     $menuPlugin = $view->getPluginById($this->menuId);
     $menuId = $menuPlugin->id;
     $html = "<img src=\"{$imageURL}\" alt=\"\" class=\"contextMenu\" onclick=\"Form.contextMenu.showMenu(event, '{$menuId}', '{$this->commandArgument}')\" />";
     return $html;
 }
开发者ID:planetenkiller,项目名称:core,代码行数:15,代码来源:Reference.php


示例5: 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;
    }
}
开发者ID:Silwereth,项目名称:core,代码行数:19,代码来源:function.formcontextmenureference.php


示例6: 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;
}
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:21,代码来源:function.muboardGetLastPost.php


示例7: smarty_block_reviewsFormFrame

/**
 * The reviewsFormFrame plugin adds styling <div> elements and a validation summary.
 *
 * 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 string           $content The content of the block.
 * @param Zikula_Form_View $view    Reference to the view object.
 *
 * @return string The output of the plugin.
 */
function smarty_block_reviewsFormFrame($params, $content, $view)
{
    // As with all Forms plugins, we must remember to register our plugin.
    // In this case we also register a validation summary so we don't have to
    // do that explicitively in the templates.
    // We need to concatenate the output of boths plugins.
    $result = $view->registerPlugin('\\Zikula_Form_Plugin_ValidationSummary', $params);
    $result .= $view->registerBlock('Reviews_Form_Plugin_FormFrame', $params, $content);
    return $result;
}
开发者ID:rmaiwald,项目名称:Reviews,代码行数:22,代码来源:block.reviewsFormFrame.php


示例8: load

 function load(Zikula_Form_View $view, &$params)
 {
     if (!$view->isPostBack()) {
         $classes = ModUtil::apiFunc('Content', 'Admin', 'getStyleClasses');
         $empty = array(array('text' => '', 'value' => ''));
         $classes = array_merge($empty, $classes);
         $this->setItems($classes);
     }
     parent::load($view, $params);
 }
开发者ID:robbrandt,项目名称:Content,代码行数:10,代码来源:ClassSelector.php


示例9: 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;
}
开发者ID:rmaiwald,项目名称:Reviews,代码行数:22,代码来源:function.reviewsObjectTypeSelector.php


示例10: 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;
}
开发者ID:Silwereth,项目名称:core,代码行数:22,代码来源:function.zikularoutesmoduleObjectTypeSelector.php


示例11: 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;
}
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:22,代码来源:function.muboardSelectorTemplates.php


示例12: handleCommand

    public function handleCommand(Zikula_Form_View $view, &$args)
    {
        switch($args['commandName']) {
            case 'cancel':
                break;
            case 'save':
                if (!$view->isValid()) {
                    return false;
                }
                $formValues = $view->getValues();
                $toname = (string)$formValues['toname'];
                $toaddress = (string)$formValues['toaddress'];
                $subject = (string)$formValues['subject'];
                $msgtype = (string)$formValues['msgtype'];
                $textBody = (string)$formValues['mailer_textbody'];
                $htmlBody = (string)$formValues['mailer_body'];

                $html = in_array($msgtype, array('html', 'multipart')) ? true : false;
                if ($html) {
                    $msgBody = $htmlBody;
                    $altBody = $textBody;
                } else {
                    $msgBody = $textBody;
                    $altBody = '';
                }

                // set the email
                $result = ModUtil::apiFunc('Mailer', 'user', 'sendmessage', array(
                    'toname' => $toname,
                    'toaddress' => $toaddress,
                    'subject' => $subject,
                    'body' => $msgBody,
                    'altbody' => $altBody,
                    'html' => $html)
                );

                // check our result and return the correct error code
                if ($result === true) {
                    // Success
                    LogUtil::registerStatus($this->__('Done! Message sent.'));
                } elseif ($result === false) {
                    // Failiure
                    LogUtil::registerError($this->__f('Error! Could not send message. %s', ''));
                } else {
                    // Failiure with error
                    LogUtil::registerError($this->__f('Error! Could not send message. %s', $result));
                }

                break;
        }

        return $view->redirect(ModUtil::url('Mailer', 'admin', 'testconfig'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:53,代码来源:TestConfig.php


示例13: 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;
}
开发者ID:robbrandt,项目名称:MUVideo,代码行数:23,代码来源:function.muvideoObjectTypeSelector.php


示例14: 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;
}
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:23,代码来源:function.muboardSelectorObjectTypes.php


示例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;
}
开发者ID:robbrandt,项目名称:MUVideo,代码行数:24,代码来源:function.muvideoTemplateSelector.php


示例16: decodePostBackEvent

 /**
  * Decode event handler for actions that generate a postback event.
  *
  * @param Zikula_Form_View $view Reference to Zikula_Form_View object.
  *
  * @return boolean
  */
 public function decodePostBackEvent(Zikula_Form_View $view)
 {
     $fullNameX = $this->id . '_' . $this->commandName . '_x';
     $fullNameY = $this->id . '_' . $this->commandName . '_y';
     if (isset($_POST[$fullNameX])) {
         $args = array('commandName' => $this->commandName, 'commandArgument' => $this->commandArgument, 'posX' => (int) $_POST[$fullNameX], 'posY' => (int) $_POST[$fullNameY]);
         if (!empty($this->onCommand)) {
             if ($view->raiseEvent($this->onCommand, $args) === false) {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:21,代码来源:ImageButton.php


示例17: handleCommand

    public function handleCommand(Zikula_Form_View $view, &$args)
    {
        switch($args['commandName']) {
            case 'cancel':
                break;
            case 'save':
                if (!$view->isValid()) {
                    return false;
                }
                $this->formValues = $view->getValues();

                // set our new module variable values
                $vars = array();
                $vars['mailertype'] = (int)$this->getFormValue('mailertype', 1);

                $vars['charset'] = (string)$this->getFormValue('charset', ZLanguage::getEncoding());

                $vars['encoding'] = (string)$this->getFormValue('encoding', '8bit');

                $vars['html'] = (bool)$this->getFormValue('html', false);

                $vars['wordwrap'] = (int)$this->getFormValue('wordwrap', 50);

                $vars['msmailheaders'] = (bool)$this->getFormValue('msmailheaders', false);

                $vars['sendmailpath'] = (string)$this->getFormValue('sendmailpath', '/usr/sbin/sendmail');

                $vars['smtpauth'] = (bool)$this->getFormValue('smtpauth', false);

                $vars['smtpserver'] = (string)$this->getFormValue('smtpserver', 'localhost');

                $vars['smtpport'] = (int)$this->getFormValue('smtpport', 25);

                $vars['smtptimeout'] = (int)$this->getFormValue('smtptimeout', 10);

                $vars['smtpusername'] = (string)$this->getFormValue('smtpusername', '');

                $vars['smtppassword'] = (string)$this->getFormValue('smtppassword', '');

                $vars['smtpsecuremethod'] = (string)$this->getFormValue('smtpsecuremethod', '');

                $this->setVars($vars);

                // the module configuration has been updated successfuly
                LogUtil::registerStatus($this->__('Done! Saved module configuration.'));
                break;
        }

        return $view->redirect(ModUtil::url('Mailer', 'admin', 'modifyconfig'));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:50,代码来源:ModifyConfig.php


示例18: initialize

 /**
  * Initialize form handler.
  *
  * This method takes care of all necessary initialisation of our data and form states.
  *
  * @param Zikula_Form_View $view The form view instance.
  *
  * @return boolean False in case of initialization errors, otherwise true.
  */
 public function initialize(Zikula_Form_View $view)
 {
     // permission check
     if (!SecurityUtil::checkPermission($this->name . '::', '::', ACCESS_ADMIN)) {
         return $view->registerError(LogUtil::registerPermissionError());
     }
     // retrieve module vars
     $modVars = $this->getVars();
     // assign all module vars
     $this->view->assign('config', $modVars);
     // custom initialisation aspects
     $this->initializeAdditions();
     // everything okay, no initialization errors occured
     return true;
 }
开发者ID:rmaiwald,项目名称:Reviews,代码行数:24,代码来源:Config.php


示例19: handleCommand

 function handleCommand(Zikula_Form_View $view, &$args)
 {
     $url = ModUtil::url('Scribite', 'admin', 'main');
     if ($args['commandName'] == 'cancel') {
         return $view->redirect($url);
     }
     // check for valid form
     if (!$view->isValid()) {
         return false;
     }
     // get passed args and store to array
     $data = $view->getValues();
     $this->setVars($data);
     LogUtil::registerStatus($this->__('Done! Module configuration updated.'));
     return $view->redirect($url);
 }
开发者ID:pheski,项目名称:Scribite,代码行数:16,代码来源:ModifyConfig.php


示例20: initialize

 /**
  * Initialize form handler.
  *
  * This method takes care of all necessary initialisation of our data and form states.
  *
  * @return boolean False in case of initialization errors, otherwise true.
  */
 public function initialize(Zikula_Form_View $view)
 {
     // permission check
     if (!SecurityUtil::checkPermission('MUBoard::', '::', ACCESS_ADMIN)) {
         return $view->registerError(LogUtil::registerPermissionError());
     }
     $dom = ZLanguage::getModuleDomain('MUBoard');
     // initialise list entries for the 'number images' setting
     $vars['dizkustableItems'] = array(array('value' => '1', 'text' => __('All', $dom)), array('value' => '2', 'text' => __('Categories', $dom) . ' ' . __('and', $dom) . ' ' . __('Forums', $dom)), array('value' => '3', 'text' => __('Topics', $dom) . ' ' . __('and', $dom) . ' ' . __('Answers', $dom)), array('value' => '4', 'text' => __('Ranks', $dom) . ' ' . __('and', $dom) . ' ' . __('Users', $dom)));
     // assign all module vars
     $this->view->assign('import', $vars);
     // custom initialisation aspects
     $this->initializeAdditions();
     // everything okay, no initialization errors occured
     return true;
 }
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:23,代码来源:Import.php



注:本文中的Zikula_Form_View类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Zikula_View类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Xml_Security类代码示例发布时间: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