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


PHP FabrikWorker::goBackAction方法代码示例

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


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

示例1: _loadTmplBottom


//.........这里部分代码省略.........
         }
     }
     $fields[] = JHTML::_('form.token');
     $resetLabel = FText::_($params->get('reset_button_label'));
     $resetIcon = $params->get('reset_icon', '');
     $copyLabel = FText::_($params->get('copy_button_label'));
     $copyIcon = $params->get('copy_icon', '');
     $applyLabel = FText::_($params->get('apply_button_label'));
     $applyIcon = $params->get('apply_icon', '');
     $deleteLabel = FText::_($params->get('delete_button_label', 'Delete'));
     $deleteIcon = $params->get('delete_icon', '');
     $goBackLabel = FText::_($params->get('goback_button_label'));
     $goBackIcon = $params->get('goback_icon', '');
     $btnLayout = FabrikHelperHTML::getLayout('fabrik-button');
     if ($resetIcon !== '') {
         $resetIcon = FabrikHelperHTML::icon($resetIcon);
         $before = $params->get('reset_icon_location', 'before') == 'before';
         $resetLabel = $before ? $resetIcon . ' ' . $resetLabel : $resetLabel . ' ' . $resetIcon;
     }
     $layoutData = (object) array('type' => 'reset', 'class' => 'btn-warning button', 'name' => 'Reset', 'label' => $resetLabel);
     $form->resetButton = $params->get('reset_button', 0) && $this->editable == '1' ? $btnLayout->render($layoutData) : '';
     if ($copyIcon !== '') {
         $copyIcon = FabrikHelperHTML::icon($copyIcon);
         $copyLabel = $params->get('copy_icon_location', 'before') == 'before' ? $copyIcon . ' ' . $copyLabel : $copyLabel . ' ' . $copyIcon;
     }
     $layoutData = (object) array('type' => 'submit', 'class' => 'button', 'name' => 'Copy', 'label' => $copyLabel);
     $form->copyButton = $params->get('copy_button', 0) && $this->editable && $model->getRowId() != '' ? $btnLayout->render($layoutData) : '';
     if ($applyIcon !== '') {
         $applyIcon = FabrikHelperHTML::icon($applyIcon);
         $before = $params->get('apply_icon_location', 'before') == 'before';
         $applyLabel = $before ? $applyIcon . ' ' . $applyLabel : $applyLabel . ' ' . $applyIcon;
     }
     $layoutData = (object) array('type' => $model->isAjax() ? 'button' : 'submit', 'class' => 'button', 'name' => 'apply', 'label' => $applyLabel);
     $form->applyButton = $params->get('apply_button', 0) && $this->editable ? $btnLayout->render($layoutData) : '';
     if ($deleteIcon !== '') {
         $deleteIcon = FabrikHelperHTML::icon($deleteIcon);
         $before = $params->get('delete_icon_location', 'before') == 'before';
         $deleteLabel = $before ? $deleteIcon . ' ' . $deleteLabel : $deleteLabel . ' ' . $deleteIcon;
     }
     $layoutData = (object) array('type' => 'submit', 'class' => 'btn-danger button', 'name' => 'delete', 'label' => $deleteLabel);
     $form->deleteButton = $params->get('delete_button', 0) && $canDelete && $this->editable && $thisRowId != '' ? $btnLayout->render($layoutData) : '';
     if ($goBackIcon !== '') {
         $goBackIcon = FabrikHelperHTML::icon($goBackIcon);
         $before = $params->get('goback_icon_location', 'before') == 'before';
         $goBackLabel = $before ? $goBackIcon . ' ' . $goBackLabel : $goBackLabel . ' ' . $goBackIcon;
     }
     $layoutData = (object) array('type' => 'button', 'class' => 'button', 'name' => 'Goback', 'label' => $goBackLabel, 'attributes' => $model->isAjax() ? '' : FabrikWorker::goBackAction());
     $form->gobackButton = $params->get('goback_button', 0) ? $btnLayout->render($layoutData) : '';
     if ($model->isEditable() && $params->get('submit_button', 1)) {
         $submitClass = FabrikString::clean($form->submit_button_label);
         $submitIcon = $params->get('save_icon', '');
         $submitLabel = FText::_($form->submit_button_label);
         if ($submitIcon !== '') {
             $submitIcon = FabrikHelperHTML::icon($submitIcon);
             $before = $params->get('save_icon_location', 'before') == 'before';
             $submitLabel = $before ? $submitIcon . ' ' . $submitLabel : $submitLabel . ' ' . $submitIcon;
         }
         $layoutData = (object) array('type' => $model->isAjax() ? 'button' : 'submit', 'class' => 'btn-primary button ' . $submitClass, 'name' => 'Submit', 'label' => $submitLabel);
         $form->submitButton = $btnLayout->render($layoutData);
     } else {
         $form->submitButton = '';
     }
     if ($this->isMultiPage) {
         $layoutData = (object) array('type' => 'button', 'class' => 'fabrikPagePrevious button', 'name' => 'fabrikPagePrevious', 'label' => FabrikHelperHTML::icon('icon-previous', FText::_('COM_FABRIK_PREV')));
         $form->prevButton = $btnLayout->render($layoutData);
         $layoutData = (object) array('type' => 'button', 'class' => 'fabrikPageNext button', 'name' => 'fabrikPageNext', 'label' => FText::_('COM_FABRIK_NEXT') . ' ' . FabrikHelperHTML::icon('icon-next'));
         $form->nextButton = $btnLayout->render($layoutData);
     } else {
         $form->nextButton = '';
         $form->prevButton = '';
     }
     // $$$ hugh - hide actions section is we're printing, or if not actions selected
     $noButtons = empty($form->nextButton) && empty($form->prevButton) && empty($form->submitButton) && empty($form->gobackButton) && empty($form->deleteButton) && empty($form->applyButton) && empty($form->copyButton) && empty($form->resetButton);
     $this->hasActions = $input->get('print', '0') == '1' || $noButtons ? false : true;
     $format = $model->isAjax() ? 'raw' : 'html';
     $fields[] = '<input type="hidden" name="format" value="' . $format . '" />';
     $groups = $model->getGroupsHiarachy();
     foreach ($groups as $groupModel) {
         if ($groupModel->isJoin()) {
             $groupPk = $groupModel->getJoinModel()->getForeignId();
             // Use raw otherwise we inject the actual <input> into the hidden field's value
             $groupPk .= '_raw';
             $groupRowIds = (array) FArrayHelper::getValue($this->data, $groupPk, array());
             $groupRowIds = htmlentities(json_encode($groupRowIds));
             // Used to check against in group process(), when deleting removed repeat groups
             $fields[] = '<input type="hidden" name="fabrik_group_rowids[' . $groupModel->getId() . ']" value="' . $groupRowIds . '" />';
         }
         $group = $groupModel->getGroup();
         $c = $groupModel->repeatTotal;
         // Used for validations
         $fields[] = '<input type="hidden" name="fabrik_repeat_group[' . $group->id . ']" value="' . $c . '" id="fabrik_repeat_group_' . $group->id . '_counter" />';
     }
     // $$$ hugh - testing social_profile_hash stuff
     if ($input->get('fabrik_social_profile_hash', '') != '') {
         $fields[] = '<input type="hidden" name="fabrik_social_profile_hash" value="' . $input->get('fabrik_social_profile_hash', '') . '" id="fabrik_social_profile_hash" />';
     }
     $this->_cryptQueryString($fields);
     $this->_cryptViewOnlyElements($fields);
     $this->hiddenFields = implode("\n", $fields);
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:101,代码来源:view.base.php

示例2: _loadTmplBottom

 /**
  * Create the fom bottom hidden fields
  *
  * @param   object  &$form  object containg form view properties
  *
  * @return  void
  */
 protected function _loadTmplBottom(&$form)
 {
     $app = JFactory::getApplication();
     $menuItem = $app->getMenu('site')->getActive();
     $Itemid = $menuItem ? $menuItem->id : 0;
     $model = $this->getModel();
     $listModel = $model->getListModel();
     $canDelete = $listModel->canDelete($model->_data);
     $params = $model->getParams();
     $task = 'form.process';
     $reffer = JRequest::getVar('HTTP_REFERER', '', 'server');
     // $$$rob - if returning from a failed validation then we should use the fabrik_referrer post var
     $reffer = str_replace('&', '&amp;', JRequest::getVar('fabrik_referrer', $reffer));
     $this_rowid = is_array($model->_rowId) ? implode('|', $model->_rowId) : $model->_rowId;
     $fields = array('<input type="hidden" name="listid" value="' . $listModel->getId() . '" />', '<input type="hidden" name="listref" value="' . $listModel->getId() . '" />', '<input type="hidden" name="rowid" value="' . $this_rowid . '" />', '<input type="hidden" name="Itemid" value="' . $Itemid . '" />', '<input type="hidden" name="option" value="com_fabrik" />', '<input type="hidden" name="task" value="' . $task . '" />', '<input type="hidden" name="isMambot" value="' . $this->isMambot . '" />', '<input type="hidden" name="formid" value="' . $model->get('id') . '" />', '<input type="hidden" name="returntoform" value="0" />', '<input type="hidden" name="fabrik_referrer" value="' . $reffer . '" />', '<input type="hidden" name="fabrik_ajax" value="' . (int) $model->isAjax() . '" />');
     $fields[] = '<input type="hidden" name="_packageId" value="' . $model->packageId . '" />';
     if ($usekey = FabrikWorker::getMenuOrRequestVar('usekey', '')) {
         // $$$rob v's been set from -1 to the actual row id - so ignore usekyey not sure if we should comment this out
         // see http://fabrikar.com/forums/showthread.php?t=10297&page=5
         $fields[] = '<input type="hidden" name="usekey" value="' . $usekey . '" />';
         $pk_val = JArrayHelper::getValue($model->_data, FabrikString::safeColNameToArrayKey($listModel->getTable()->db_primary_key));
         if (empty($pk_val)) {
             $fields[] = '<input type="hidden" name="usekey_newrecord" value="1" />';
         }
     }
     /* $$$ hugh - testing a fix for pagination issue when submitting a 'search form'.
      * If this is a search form, we need to clear 'limitstart', otherwise ... say we
      * were last on page 4 of the (unfiltered) target table, and the search yields less than 4 pages,
      * we end up with a blank table 'cos the wrong LIMIT's are applied to the query
      */
     $save_insessions = $params->get('save_insession', '');
     if (is_array($save_insessions)) {
         foreach ($save_insessions as $save_insession) {
             if ($save_insession == '1') {
                 $fields[] = '<input type="hidden" name="limitstart" value="0" />';
                 break;
             }
         }
     }
     $fields[] = JHTML::_('form.token');
     $form->resetButton = $params->get('reset_button', 0) && $this->editable == "1" ? '<input type="reset" class="button btn" name="Reset" value="' . $params->get('reset_button_label') . '" />' : '';
     $form->copyButton = $params->get('copy_button', 0) && $this->editable && $model->_rowId != '' ? '<input type="submit" class="button btn" name="Copy" value="' . $params->get('copy_button_label') . '" />' : '';
     $applyButtonType = $model->isAjax() ? 'button' : 'submit';
     $form->applyButton = $params->get('apply_button', 0) && $this->editable ? '<input type="' . $applyButtonType . '" class="button btn" name="apply" value="' . $params->get('apply_button_label') . '" />' : '';
     $form->deleteButton = $params->get('delete_button', 0) && $canDelete && $this->editable && $this_rowid != 0 ? '<input type="submit" value="' . $params->get('delete_button_label', 'Delete') . '" class="button btn" name="delete" />' : '';
     $form->gobackButton = $params->get('goback_button', 0) == "1" ? '<input type="button" class="button btn" name="Goback" ' . FabrikWorker::goBackAction() . ' value="' . $params->get('goback_button_label') . '" />' : '';
     if ($model->isEditable() && $params->get('submit_button', 1)) {
         $button = $model->isAjax() ? "button" : "submit";
         $submitClass = FabrikString::clean($form->submit_button_label);
         $form->submitButton = '<input type="' . $button . '" class="button ' . $submitClass . ' btn" name="submit" value="' . $form->submit_button_label . '" />';
     } else {
         $form->submitButton = '';
     }
     if ($this->isMultiPage) {
         $form->prevButton = '<input type="button" class="fabrikPagePrevious button" name="fabrikPagePrevious" value="' . JText::_('COM_FABRIK_PREVIOUS') . '" />';
         $form->nextButton = '<input type="button" class="fabrikPageNext button" name="fabrikPageNext" value="' . JText::_('COM_FABRIK_NEXT') . '" />';
     } else {
         $form->nextButton = '';
         $form->prevButton = '';
     }
     // $$$ hugh - hide actions section is we're printing, or if not actions selected
     $noButtons = empty($form->nextButton) && empty($form->prevButton) && empty($form->submitButton) && empty($form->gobackButton) && empty($form->deleteButton) && empty($form->applyButton) && empty($form->copyButton) && empty($form->resetButton);
     if (JRequest::getVar('print', '0') == '1' || $noButtons) {
         $this->hasActions = false;
     } else {
         $this->hasActions = true;
     }
     $format = $model->isAjax() ? 'raw' : 'html';
     $fields[] = '<input type="hidden" name="format" value="' . $format . '" />';
     $groups = $model->getGroupsHiarachy();
     foreach ($groups as $groupModel) {
         $group = $groupModel->getGroup();
         $c = $groupModel->repeatTotal;
         // Used for validations
         $fields[] = '<input type="hidden" name="fabrik_repeat_group[' . $group->id . ']" value="' . $c . '" id="fabrik_repeat_group_' . $group->id . '_counter" />';
     }
     // $$$ hugh - testing social_profile_hash stuff
     if (JRequest::getVar('fabrik_social_profile_hash', '') != '') {
         $fields[] = '<input type="hidden" name="fabrik_social_profile_hash" value="' . JRequest::getCmd('fabrik_social_profile_hash', '') . '" id="fabrik_social_profile_hash" />';
     }
     $this->_cryptQueryString($fields);
     $this->_cryptViewOnlyElements($fields);
     $this->hiddenFields = implode("\n", $fields);
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:91,代码来源:view.base.php


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