当前位置: 首页>>代码示例>>PHP>>正文


PHP Zikula_Form_View::trigger_error方法代码示例

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


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

示例1: smarty_function_formsetinitialfocus

/**
 * Smarty function to set the initial focus for a form.
 *
 * Usage:
 * <code>
 * {formsetinitialfocus inputId='PluginId'}
 * </code>
 * The "PluginId" refers to the plugin that should have focus initially.
 *
 * @param array            $params All attributes passed to this function from the template.
 * @param Zikula_Form_View $view   Reference to Form render object.
 *
 * @return string HTML to set the initial focus for a form.
 */
function smarty_function_formsetinitialfocus($params, $view)
{
    if (!isset($params['inputId'])) {
        $view->trigger_error('initialFocus: inputId parameter required');
        return false;
    }
    $doSelect = isset($params['doSelect']) ? $params['doSelect'] : false;
    $id = $params['inputId'];
    if ($doSelect) {
        $selectHtml = 'inp.select();';
    } else {
        $selectHtml = '';
    }
    // FIXME: part of PN???
    $html = "\n<script type=\"text/javascript\">\nvar bodyElement = document.getElementsByTagName('body')[0];\nvar f = function() {\n  var inp = document.getElementById('{$id}');\n  if (inp != null)\n  {\n    inp.focus();\n    {$selectHtml}\n  }\n};\nvar oldF = window.onload;\nwindow.onload = function() { f(); if (oldF) oldF(); };\n</script>";
    return $html;
}
开发者ID:planetenkiller,项目名称:core,代码行数:31,代码来源:function.formsetinitialfocus.php

示例2: create

 /**
  * Create event handler.
  *
  * @param Zikula_Form_View $view Reference to Zikula_Form_View object.
  * @param array            &$params Parameters passed from the Smarty plugin function.
  *
  * @see    Zikula_Form_AbstractPlugin
  * @return void
  */
 public function create(Zikula_Form_View $view, &$params)
 {
     $hasModule = isset($params['module']) && !empty($params['module']);
     $hasObjecttype = isset($params['objecttype']) && !empty($params['objecttype']);
     $hasIdField = isset($params['idField']) && !empty($params['idField']);
     $hasDisplayField = isset($params['displayField']) && !empty($params['displayField']);
     $hasRecordClass = isset($params['recordClass']) && !empty($params['recordClass']);
     if ($hasRecordClass) {
         $this->recordClass = $params['recordClass'];
         $idColumns = Doctrine::getTable($this->recordClass)->getIdentifierColumnNames();
         if (count($idColumns) > 1) {
             $view->trigger_error(__f('Error! in %1$s: an invalid %2$s parameter was received.', array('formdropdownrelationlist', 'recordClass')));
         }
         $this->idField = $idColumns[0];
     } else {
         if (!$hasModule) {
             $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('formdropdownrelationlist', 'module')));
         }
         $this->module = $params['module'];
         unset($params['module']);
         if (!ModUtil::available($this->module)) {
             $view->trigger_error(__f('Error! in %1$s: an invalid %2$s parameter was received.', array('formdropdownrelationlist', 'module')));
         }
         if (!$hasObjecttype) {
             $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('formdropdownrelationlist', 'objecttype')));
         }
         $this->objecttype = $params['objecttype'];
         unset($params['objecttype']);
         if (!$hasIdField) {
             $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('formdropdownrelationlist', 'idField')));
         }
         $this->idField = $params['idField'];
         unset($params['idField']);
         if (isset($params['prefix'])) {
             $this->prefix = $params['prefix'];
             unset($params['prefix']);
         }
     }
     if (!isset($params['displayField']) || empty($params['displayField'])) {
         $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('formdropdownrelationlist', 'displayField')));
     }
     $this->displayField = $params['displayField'];
     unset($params['displayField']);
     $this->displayFieldTwo = '';
     if (isset($params['displayField2'])) {
         $this->displayFieldTwo = $params['displayField2'];
         unset($params['displayField2']);
     }
     if (isset($params['where'])) {
         $this->where = $params['where'];
         unset($params['where']);
     }
     if (isset($params['orderby'])) {
         $this->orderby = $params['orderby'];
         unset($params['orderby']);
     }
     if (isset($params['pos'])) {
         $this->pos = $params['pos'];
         unset($params['pos']);
     }
     if (isset($params['num'])) {
         $this->num = $params['num'];
         unset($params['num']);
     }
     if (isset($params['showEmptyValue'])) {
         $this->showEmptyValue = $params['showEmptyValue'];
         unset($params['showEmptyValue']);
     }
     parent::create($view, $params);
     $this->cssClass .= ' z-form-relationlist';
 }
开发者ID:rmaiwald,项目名称:core,代码行数:80,代码来源:DropdownRelationList.php

示例3: create

 /**
  * Create event handler.
  *
  * @param Zikula_Form_View $view    Reference to Zikula_Form_View object.
  * @param array            &$params Parameters passed from the Smarty plugin function.
  *
  * @see    Zikula_Form_AbstractPlugin
  * @return void
  */
 public function create(Zikula_Form_View $view, &$params)
 {
     if (!isset($params['objectType']) || empty($params['objectType'])) {
         $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('muvideoRelationSelectorList', 'objectType')));
     }
     $this->objectType = $params['objectType'];
     unset($params['objectType']);
     if (!isset($params['aliasReverse']) || empty($params['aliasReverse'])) {
         $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', array('relationtesterRelationSelectorList', 'aliasReverse')));
     }
     $this->aliasReverse = $params['aliasReverse'];
     unset($params['aliasReverse']);
     if (isset($params['where'])) {
         $this->where = $params['where'];
         unset($params['where']);
     }
     if (isset($params['orderBy'])) {
         $this->orderBy = $params['orderBy'];
         unset($params['orderBy']);
     } elseif (isset($params['orderby'])) {
         $this->orderBy = $params['orderby'];
         unset($params['orderby']);
     }
     if (isset($params['num'])) {
         $this->resultsPerPage = intval($params['num']);
         unset($params['num']);
     }
     if (isset($params['pos'])) {
         $this->currentPage = intval($params['pos']);
         unset($params['pos']);
     }
     if (isset($params['showEmptyValue'])) {
         $this->showEmptyValue = (bool) $params['showEmptyValue'];
         unset($params['showEmptyValue']);
     }
     parent::create($view, $params);
     $this->idFields = ModUtil::apiFunc($this->name, 'selection', 'getIdFields', array('ot' => $this->objectType));
     $this->cssClass .= ' ' . $this->getStyleClass() . ' ' . strtolower($this->objectType);
 }
开发者ID:robbrandt,项目名称:MUVideo,代码行数:48,代码来源:AbstractObjectSelector.php


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