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


PHP FabrikWorker::replaceRequest方法代码示例

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


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

示例1: parse

 protected function parse($match)
 {
     $match = $match[0];
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php';
     $w = new FabrikWorker();
     $w->replaceRequest($match);
     $match = $w->parseMessageForPlaceHolder($match);
     return $match;
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:9,代码来源:fabrik.php

示例2: parse

 function parse($match)
 {
     $match = $match[0];
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'json.php';
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php';
     $w = new FabrikWorker();
     $w->replaceRequest($match);
     // stop [] for ranged filters from being removed
     $match = str_replace('{}', '[]', $match);
     $match = $w->parseMessageForPlaceHolder($match);
     return $match;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:12,代码来源:fabrik.php

示例3: display

 function display($tmpl = 'default')
 {
     JHTML::_('behavior.calendar');
     FabrikHelperHTML::packageJS();
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/');
     FabrikHelperHTML::script('advanced-search.js', 'media/com_fabrik/js/');
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
     $model =& $this->getModel();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
     $this->row =& $model->getVisualization();
     $model->setTableIds();
     if ($this->row->state == 0) {
         JError::raiseWarning(500, JText::_('ALERTNOTAUTH'));
         return '';
     }
     $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
     if ($this->requiredFiltersFound) {
         $this->assign('chart', $this->get('Fusionchart'));
     } else {
         $this->assign('chart', '');
     }
     $w = new FabrikWorker();
     $w->replaceRequest($this->row->intro_text);
     $viewName = $this->getName();
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $plugin =& $pluginManager->getPlugIn('calendar', 'visualization');
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('showFilters', JRequest::getInt('showfilters', 1));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     $tmpl = $pluginParams->get('fusionchart_layout', $tmpl);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'fusionchart' . DS . 'views' . DS . 'fusionchart' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     $ab_css_file = $tmplpath . DS . "template.css";
     if (JFile::exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/fusionchart/views/fusionchart/tmpl/' . $tmpl . '/', true);
     }
     //check and add a general fabrik custom css file overrides template css and generic table css
     FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css");
     //check and add a specific biz  template css file overrides template css generic table css and generic custom css
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "fusionchart" . DS . "views" . DS . "fusionchart" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     //assign something to oPackage to ensure we can clear filters
     $str = "window.addEvent('domready', function(){\n\t\t\tfabrikFusionChart{$this->row->id} = {};";
     $str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikFusionChart{$this->row->id});\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($str);
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:53,代码来源:view.html.php

示例4: parse

 /**
  * Parse the {fabrik} tag
  *
  * @param   array  $match  {fabrik} preg match
  *
  * @return  string
  */
 protected function parse($match)
 {
     $match = $match[0];
     // $$$ hugh - see if we can remove formatting added by WYSIWYG editors
     $match = strip_tags($match);
     require_once COM_FABRIK_FRONTEND . '/helpers/parent.php';
     $w = new FabrikWorker();
     $match = preg_replace('/\\s+/', ' ', $match);
     /* $$$ hugh - only replace []'s in value, not key, so we handle
      * ranged filters and 'complex' filters
      */
     $match2 = array();
     foreach (explode(" ", $match) as $m) {
         if (strstr($m, '=')) {
             list($key, $val) = explode('=', $m);
             $val = str_replace('[', '{', $val);
             $val = str_replace(']', '}', $val);
             $match2[] = $key . '=' . $val;
         } else {
             $match2[] = $m;
         }
     }
     $match = implode(' ', $match2);
     $w->replaceRequest($match);
     // Stop [] for ranged filters from being removed
     // $match = str_replace('{}', '[]', $match);
     $match = $w->parseMessageForPlaceHolder($match);
     return $match;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:36,代码来源:fabrik.php

示例5: prefilterParse

 /**
  * Run the pre-filter sql and replace any placeholders in the subsequent pre-filter
  *
  * @param   mixed  $selValue  string/array pre-filter value
  *
  * @return  mixed  string/array pre-filter value
  */
 protected function prefilterParse($selValue)
 {
     $isstring = false;
     if (is_string($selValue)) {
         $isstring = true;
         $selValue = array($selValue);
     }
     $preSQL = htmlspecialchars_decode($this->getParams()->get('prefilter_query'), ENT_QUOTES);
     if (trim($preSQL) != '') {
         $db = FabrikWorker::getDbo();
         $w = new FabrikWorker();
         $w->replaceRequest($preSQL);
         $preSQL = $w->parseMessageForPlaceHolder($preSQL);
         $db->setQuery($preSQL);
         $q = $db->loadObjectList();
         if (!$q) {
             // Try the table's connection db for the query
             $thisDb = $this->getDb();
             $thisDb->setQuery($preSQL);
             $q = $thisDb->loadObjectList();
         }
         if (!empty($q)) {
             $q = $q[0];
         }
     }
     if (isset($q)) {
         foreach ($q as $key => $val) {
             if (substr($key, 0, 1) != '_') {
                 $found = false;
                 for ($i = 0; $i < count($selValue); $i++) {
                     if (strstr($selValue[$i], '{$q-&gt;' . $key)) {
                         $found = true;
                         $pattern = '{$q-&gt;' . $key . "}";
                     }
                     if (strstr($selValue[$i], '{$q->' . $key)) {
                         $found = true;
                         $pattern = '{$q->' . $key . "}";
                     }
                     if ($found) {
                         $selValue[$i] = str_replace($pattern, $val, $selValue[$i]);
                     }
                 }
             }
         }
     } else {
         /* Parse for default values only
          * $$$ hugh - this pattern is being greedy, so for example ...
          * foo {$my->id} bar {$my->id} bosh
          * ... matches everything from first to last brace, like ...
          * {$my->id} bar {$my->id}
          *$pattern = "/({[^}]+}).*}?/s";
          */
         $pattern = "/({[^}]+})/";
         for ($i = 0; $i < count($selValue); $i++) {
             $ok = preg_match($pattern, $selValue[$i], $matches);
             foreach ($matches as $match) {
                 $matchX = JString::substr($match, 1, JString::strlen($match) - 2);
                 // A default option was set so lets use that
                 if (strstr($matchX, '|')) {
                     $bits = explode('|', $matchX);
                     $selValue[$i] = str_replace($match, $bits[1], $selValue[$i]);
                 }
             }
         }
     }
     $selValue = $isstring ? $selValue[0] : $selValue;
     // Replace {authorisedViewLevels} with array of view levels the user can access
     if (is_array($selValue)) {
         foreach ($selValue as &$v) {
             if (strstr($v, '{authorisedViewLevels}')) {
                 $v = $this->user->getAuthorisedViewLevels();
             }
         }
     } else {
         if (strstr($selValue, '{authorisedViewLevels}')) {
             $selValue = $this->user->getAuthorisedViewLevels();
         }
     }
     return $selValue;
 }
开发者ID:pascal26,项目名称:fabrik,代码行数:87,代码来源:list.php

示例6: array

 /**
  * run the prefilter sql and replace any placeholders in the subsequent prefilter
  *
  * @param string/array prefilter value
  * @return string/array prefilter value
  */
 function _prefilterParse($selValue)
 {
     $isstring = false;
     if (is_string($selValue)) {
         $isstring = true;
         $selValue = array($selValue);
     }
     $preSQL = htmlspecialchars_decode($this->getParams()->get('prefilter_query'), ENT_QUOTES);
     if (trim($preSQL) != '') {
         $db = FabrikWorker::getDbo();
         $w = new FabrikWorker();
         $w->replaceRequest($preSQL);
         $preSQL = $w->parseMessageForPlaceHolder($preSQL);
         $db->setQuery($preSQL);
         $q = $db->loadObjectList();
         if (!empty($q)) {
             $q = $q[0];
         }
     }
     if (isset($q)) {
         foreach ($q as $key => $val) {
             if (substr($key, 0, 1) != '_') {
                 $found = false;
                 for ($i = 0; $i < count($selValue); $i++) {
                     if (strstr($selValue[$i], '{$q-&gt;' . $key)) {
                         $found = true;
                         $pattern = '{$q-&gt;' . $key . "}";
                     }
                     if (strstr($selValue[$i], '{$q->' . $key)) {
                         $found = true;
                         $pattern = '{$q->' . $key . "}";
                     }
                     if ($found) {
                         $selValue[$i] = str_replace($pattern, $val, $selValue[$i]);
                     }
                 }
             }
         }
     } else {
         //parse for default values only
         $pattern = "/({[^}]+}).*}?/s";
         for ($i = 0; $i < count($selValue); $i++) {
             $ok = preg_match($pattern, $selValue[$i], $matches);
             foreach ($matches as $match) {
                 $matchx = substr($match, 1, strlen($match) - 2);
                 //a default option was set so lets use that
                 if (strstr($matchx, '|')) {
                     $bits = explode('|', $matchx);
                     $selValue[$i] = str_replace($match, $bits[1], $selValue[$i]);
                 }
             }
         }
     }
     return $isstring ? $selValue[0] : $selValue;
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:61,代码来源:list.php

示例7: array

 /**
  * run the prefilter sql and replace any placeholders in the subsequent prefilter
  *
  * @param string/array prefilter value
  * @return string/array prefilter value
  */
 function _prefilterParse($selValue)
 {
     $isstring = false;
     if (is_string($selValue)) {
         $isstring = true;
         $selValue = array($selValue);
     }
     $preSQL = htmlspecialchars_decode($this->getParams()->get('prefilter_query'), ENT_QUOTES);
     if (trim($preSQL) != '') {
         $db =& JFactory::getDBO();
         $w = new FabrikWorker();
         $w->replaceRequest($preSQL);
         $preSQL = $w->parseMessageForPlaceHolder($preSQL);
         $db->setQuery($preSQL);
         $q = $db->loadObjectList();
         if (!$q) {
             // Try the table's connection db for the query
             $thisDb = $this->getDb();
             $thisDb->setQuery($preSQL);
             $q = $thisDb->loadObjectList();
         }
         if (!empty($q)) {
             $q = $q[0];
         }
     }
     if (isset($q)) {
         foreach ($q as $key => $val) {
             if (substr($key, 0, 1) != '_') {
                 $found = false;
                 for ($i = 0; $i < count($selValue); $i++) {
                     if (strstr($selValue[$i], '{$q-&gt;' . $key)) {
                         $found = true;
                         $pattern = '{$q-&gt;' . $key . "}";
                     }
                     if (strstr($selValue[$i], '{$q->' . $key)) {
                         $found = true;
                         $pattern = '{$q->' . $key . "}";
                     }
                     if ($found) {
                         $selValue[$i] = str_replace($pattern, $val, $selValue[$i]);
                     }
                 }
             }
         }
     } else {
         // $$$ hugh - this pattern is being greedy, so for example ...
         // foo {$my->id} bar {$my->id} gaprly
         // ... matches everyting from first to last brace, like ...
         // {$my->id} bar {$my->id}
         //$pattern = "/({[^}]+}).*}?/s";
         $pattern = "/({[^}]+})/";
         for ($i = 0; $i < count($selValue); $i++) {
             $ok = preg_match($pattern, $selValue[$i], $matches);
             foreach ($matches as $match) {
                 $matchx = substr($match, 1, strlen($match) - 2);
                 //a default option was set so lets use that
                 if (strstr($matchx, '|')) {
                     $bits = explode('|', $matchx);
                     $selValue[$i] = str_replace($match, $bits[1], $selValue[$i]);
                 }
             }
         }
     }
     return $isstring ? $selValue[0] : $selValue;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:71,代码来源:table.php


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