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


PHP FabrikString::usesElementPlaceholders方法代码示例

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


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

示例1: _getFilePath

 /**
  * Get the full server file path for the upload, including the file name
  *
  * @param   int  $repeatCounter  Repeat group counter
  *
  * @return	string	Path
  */
 protected function _getFilePath($repeatCounter = 0)
 {
     $params = $this->getParams();
     if (!isset($this->_filePaths)) {
         $this->_filePaths = array();
     }
     if (array_key_exists($repeatCounter, $this->_filePaths)) {
         /*
          * $$$ hugh - if it uses element placeholders, there's a likelihood the element
          * data may have changed since we cached the path during validation, so we need
          * to rebuild it.  For instance, if the element data is changed by a onBeforeProcess
          * submission plugin, or by a 'replace' validation.
          */
         if (!FabrikString::usesElementPlaceholders($params->get('ul_directory'))) {
             return $this->_filePaths[$repeatCounter];
         }
     }
     $filter = JFilterInput::getInstance();
     $aData = $filter->clean($_POST, 'array');
     $elName = $this->getFullName(true, false);
     $elNameRaw = $elName . '_raw';
     /**
      * $$$ hugh - if we use the @ way of doing this, and one of the array keys doesn't exist,
      * PHP still sets an error, even though it doesn't toss it.  So if we then have some eval'd
      * code, like a PHP validation, and do the logError() thing, that will pick up and report this error,
      * and fail the validation.  Which is VERY hard to track.  So we'll have to do it long hand.
      */
     // $myFileName = array_key_exists($elName, $_FILES) ? @$_FILES[$elName]['name'] : @$_FILES['file']['name'];
     $myFileName = '';
     if (array_key_exists($elName, $_FILES) && is_array($_FILES[$elName])) {
         $myFileName = FArrayHelper::getValue($_FILES[$elName], 'name', '');
     } else {
         if (array_key_exists('file', $_FILES) && is_array($_FILES['file'])) {
             $myFileName = FArrayHelper::getValue($_FILES['file'], 'name', '');
         }
     }
     if (is_array($myFileName)) {
         $myFileName = FArrayHelper::getValue($myFileName, $repeatCounter, '');
     }
     $myFileDir = array_key_exists($elNameRaw, $aData) && is_array($aData[$elNameRaw]) ? @$aData[$elNameRaw]['ul_end_dir'] : '';
     if (is_array($myFileDir)) {
         $myFileDir = FArrayHelper::getValue($myFileDir, $repeatCounter, '');
     }
     $storage = $this->getStorage();
     // $$$ hugh - check if we need to blow away the cached filepath, set in validation
     $myFileName = $storage->cleanName($myFileName, $repeatCounter);
     $folder = $params->get('ul_directory');
     $folder = $folder . '/' . $myFileDir;
     if ($storage->appendServerPath()) {
         $folder = JPATH_SITE . '/' . $folder;
     }
     $folder = JPath::clean($folder);
     $w = new FabrikWorker();
     $formModel = $this->getFormModel();
     $folder = $w->parseMessageForRepeats($folder, $formModel->formData, $this, $repeatCounter);
     $folder = $w->parseMessageForPlaceHolder($folder);
     if ($storage->appendServerPath()) {
         JPath::check($folder);
     }
     $storage->makeRecursiveFolders($folder);
     $p = $folder . '/' . $myFileName;
     $this->_filePaths[$repeatCounter] = JPath::clean($p);
     return $this->_filePaths[$repeatCounter];
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:71,代码来源:fileupload.php

示例2: getJSIcons

 /**
  * Get the map icons
  *
  * @return  array
  */
 public function getJSIcons()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $icons = array();
     $w = new FabrikWorker();
     $uri = JURI::getInstance();
     $params = $this->getParams();
     $templates = (array) $params->get('fb_gm_detailtemplate');
     $templates_nl2br = (array) $params->get('fb_gm_detailtemplate_nl2br');
     $listids = (array) $params->get('googlemap_table');
     // Images for file system
     $aIconImgs = (array) $params->get('fb_gm_iconimage');
     // Image from marker data
     $markerImages = (array) $params->get('fb_gm_iconimage2');
     // Specified letter
     $letters = (array) $params->get('fb_gm_icon_letter');
     $aFirstIcons = (array) $params->get('fb_gm_first_iconimage');
     $aLastIcons = (array) $params->get('fb_gm_last_iconimage');
     $titleElements = (array) $params->get('fb_gm_title_element');
     $radiusElements = (array) $params->get('fb_gm_radius_element');
     $radiusDefaults = (array) $params->get('fb_gm_radius_default');
     $radiusUnits = (array) $params->get('fb_gm_radius_unit');
     $groupClass = (array) $params->get('fb_gm_group_class');
     $c = 0;
     $this->recordCount = 0;
     $maxMarkers = $params->get('fb_gm_markermax', 0);
     $recLimit = count($listids) == 1 ? $maxMarkers : 0;
     $limitMessageShown = false;
     $limitMessage = $params->get('fb_gm_markermax_message');
     $groupedIcons = array();
     $lc = 0;
     foreach ($listids as $listid) {
         $listModel = $this->getlistModel($listid);
         $template = JArrayHelper::getValue($templates, $c, '');
         /**
          * One day we should get smarter about how we decide which elements to render
          * but for now all we can do is set formatAll(), in case they use an element
          * which isn't set for list display, which then wouldn't get rendered unless we do this.
          */
         if (FabrikString::usesElementPlaceholders($template)) {
             $listModel->formatAll(true);
         }
         $template_nl2br = JArrayHelper::getValue($templates_nl2br, $c, '1') == '1';
         $table = $listModel->getTable();
         $mapsElements = FabrikHelperList::getElements($listModel, array('plugin' => 'googlemap', 'published' => 1));
         $coordColumn = $mapsElements[0]->getFullName(true, false) . "_raw";
         // Are we using random start location for icons?
         $listModel->_randomRecords = $params->get('fb_gm_random_marker') == 1 && $recLimit != 0 ? true : false;
         // Used in list model setLimits
         $input->set('limit' . $listid, $recLimit);
         $listModel->setLimits();
         $nav = $listModel->getPagination(0, 0, $recLimit);
         $data = $listModel->getData();
         $this->txt = array();
         $k = 0;
         foreach ($data as $groupKey => $group) {
             foreach ($group as $row) {
                 $customimagefound = false;
                 $iconImg = JArrayHelper::getValue($aIconImgs, $c, '');
                 if ($k == 0) {
                     $firstIcon = JArrayHelper::getValue($aFirstIcons, $c, $iconImg);
                     if ($firstIcon !== '') {
                         $iconImg = $firstIcon;
                     }
                 }
                 $v = $this->getCordsFromData($row->{$coordColumn});
                 if ($v == array(0, 0)) {
                     // Don't show icons with no data
                     continue;
                 }
                 $rowdata = JArrayHelper::fromObject($row);
                 $rowdata['rowid'] = $rowdata['__pk_val'];
                 $html = $w->parseMessageForPlaceHolder($template, $rowdata);
                 $titleElement = JArrayHelper::getValue($titleElements, $c, '');
                 $title = $titleElement == '' ? '' : strip_tags($row->{$titleElement});
                 /* $$$ hugh - if they provided a template, lets assume they will handle the link themselves.
                  * http://fabrikar.com/forums/showthread.php?p=41550#post41550
                  * $$$ hugh - at some point the fabrik_view / fabrik_edit links became optional
                  */
                 if (empty($html) && (array_key_exists('fabrik_view', $rowdata) || array_key_exists('fabrik_edit', $rowdata))) {
                     // Don't insert line break in empty bubble without links $html .= "<br />";
                     // Use edit link by preference
                     if (array_key_exists('fabrik_edit', $rowdata)) {
                         if ($rowdata['fabrik_edit'] != '') {
                             $html .= "<br />";
                         }
                         $html .= $rowdata['fabrik_edit'];
                     } else {
                         if ($rowdata['fabrik_view'] != '') {
                             $html .= "<br />";
                         }
                         $html .= $rowdata['fabrik_view'];
                     }
                 }
//.........这里部分代码省略.........
开发者ID:ppantilla,项目名称:bbninja,代码行数:101,代码来源:googlemap.php


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