示例#1
0
 /**
  * Get the table's forms hidden fields
  *
  * @return  string  hidden fields
  */
 protected function loadTemplateBottom()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $Itemid = FabrikWorker::itemId();
     $model = $this->getModel();
     $item = $model->getTable();
     $reffer = str_replace('&', '&', $input->server->get('REQUEST_URI', '', 'string'));
     $reffer = FabrikString::removeQSVar($reffer, 'fabrik_incsessionfilters');
     $this->hiddenFields = array();
     // $$$ rob 15/12/2011 - if in com_content then doing this means you cant delete rows
     $this->hiddenFields[] = '<input type="hidden" name="option" value="' . $input->get('option', 'com_fabrik') . '" />';
     // $$$ rob 28/12/2011 but when using com_content as a value you cant filter!
     // $this->hiddenFields[] = '<input type="hidden" name="option" value="com_fabrik" />';
     $this->hiddenFields[] = '<input type="hidden" name="orderdir" value="' . $input->get('orderdir') . '" />';
     $this->hiddenFields[] = '<input type="hidden" name="orderby" value="' . $input->get('orderby') . '" />';
     // $$$ rob if the content plugin has temporarily set the view to list then get view from origview var, if that doesn't exist
     // revert to view var. Used when showing table in article/blog layouts
     $view = $input->get('origview', $input->get('view', 'list'));
     $this->hiddenFields[] = '<input type="hidden" name="view" value="' . $view . '" />';
     $this->hiddenFields[] = '<input type="hidden" name="listid" value="' . $item->id . '"/>';
     $this->hiddenFields[] = '<input type="hidden" name="listref" value="' . $this->renderContext . '"/>';
     $this->hiddenFields[] = '<input type="hidden" name="Itemid" value="' . $Itemid . '"/>';
     // Removed in favour of using list_{id}_limit dropdown box
     $this->hiddenFields[] = '<input type="hidden" name="fabrik_referrer" value="' . $reffer . '" />';
     $this->hiddenFields[] = JHTML::_('form.token');
     $this->hiddenFields[] = '<input type="hidden" name="format" value="html" />';
     // $packageId = $input->getInt('packageId', 0);
     // $$$ rob testing for ajax table in module
     $packageId = $model->packageId;
     $this->hiddenFields[] = '<input type="hidden" name="packageId" value="' . $packageId . '" />';
     if ($app->isAdmin()) {
         $this->hiddenFields[] = '<input type="hidden" name="task" value="list.view" />';
     } else {
         $this->hiddenFields[] = '<input type="hidden" name="task" value="" />';
     }
     $this->hiddenFields[] = '<input type="hidden" name="fabrik_listplugin_name" value="" />';
     $this->hiddenFields[] = '<input type="hidden" name="fabrik_listplugin_renderOrder" value="" />';
     // $$$ hugh - added this so plugins have somewhere to stuff any random data they need during submit
     $this->hiddenFields[] = '<input type="hidden" name="fabrik_listplugin_options" value="" />';
     $this->hiddenFields[] = '<input type="hidden" name="incfilters" value="1" />';
     // $$$ hugh - testing social profile hash stuff
     if ($input->get('fabrik_social_profile_hash', '') != '') {
         $this->hiddenFields[] = '<input type="hidden" name="fabrik_social_profile_hash" value="' . $input->get('fabrik_social_profile_hash', '', 'string') . '" />';
     }
     $this->hiddenFields = implode("\n", $this->hiddenFields);
 }
示例#2
0
文件: list.php 项目: pascal26/fabrik
 /**
  * Get lists group by headings
  *
  * @return   array  heading names
  */
 public function getGroupByHeadings()
 {
     $formModel = $this->getFormModel();
     $input = $this->app->input;
     $base = JURI::getInstance();
     $base = $base->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path'));
     $qs = $input->server->get('QUERY_STRING', '', 'string');
     if (JString::stristr($qs, 'group_by')) {
         $qs = FabrikString::removeQSVar($qs, 'group_by');
         $qs = FabrikString::ltrimword($qs, '?');
         $qs = str_replace('&', '&amp;', $qs);
     }
     $url = $base;
     if (!empty($qs)) {
         $url .= JString::strpos($url, '?') !== false ? '&amp;' : '?';
         $url .= $qs;
     }
     $url .= JString::strpos($url, '?') !== false ? '&amp;' : '?';
     $a = array();
     list($h, $x, $b, $c) = $this->getHeadings();
     $o = new stdClass();
     $o->label = FText::_('COM_FABRIK_NONE');
     $o->group_by = '';
     $a[$url . 'group_by=0'] = $o;
     foreach ($h as $key => $v) {
         if (!in_array($key, array('fabrik_select', 'fabrik_edit', 'fabrik_view', 'fabrik_delete', 'fabrik_actions'))) {
             /**
              * $$$ hugh - other junk is showing up in $h, like 85___14-14-86_list_heading, or element
              * names ending in _form_heading.  May not be the most efficient method, but we need to
              * test if $key exists as an element, as well as the simple in_array() test above.
              */
             if ($formModel->hasElement($key, false, false)) {
                 $thisUrl = $url . 'group_by=' . $key;
                 $o = new stdClass();
                 $o->label = strip_tags($v);
                 $o->group_by = $key;
                 $a[$thisUrl] = $o;
             }
         }
     }
     return $a;
 }
示例#3
0
 /**
  * Get lists group by headings
  *
  * @return   array  heading names
  */
 public function getGroupByHeadings()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $base = JURI::getInstance();
     $base = $base->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path'));
     $qs = $input->server->get('QUERY_STRING', '', 'string');
     if (JString::stristr($qs, 'group_by')) {
         $qs = FabrikString::removeQSVar($qs, 'group_by');
         $qs = FabrikString::ltrimword($qs, '?');
         $qs = str_replace('&', '&amp;', $qs);
     }
     $url = $base;
     if (!empty($qs)) {
         $url .= JString::strpos($url, '?') !== false ? '&amp;' : '?';
         $url .= $qs;
     }
     $url .= JString::strpos($url, '?') !== false ? '&amp;' : '?';
     $a = array();
     list($h, $x, $b, $c) = $this->getHeadings();
     $o = new stdClass();
     $o->label = JText::_('COM_FABRIK_NONE');
     $o->group_by = '';
     $a[$url . 'group_by=0'] = $o;
     foreach ($h as $key => $v) {
         if (!in_array($key, array('fabrik_select', 'fabrik_edit', 'fabrik_view', 'fabrik_delete', 'fabrik_actions'))) {
             $thisurl = $url . 'group_by=' . $key;
             $o = new stdClass();
             $o->label = strip_tags($v);
             $o->group_by = $key;
             $a[$thisurl] = $o;
         }
     }
     return $a;
 }
示例#4
0
 public function getGroupByHeadings()
 {
     $base = JURI::getInstance();
     $base = $base->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path'));
     $base .= strpos($base, '?') ? '&' : '?';
     $qs = $_SERVER['QUERY_STRING'];
     $qs = urlencode(FabrikString::removeQSVar($qs, 'group_by'));
     $url = $base . $qs;
     $url .= strpos($url, '?') ? '&amp;' : '?';
     $a = array();
     list($h, $x, $b, $c) = $this->getHeadings();
     $a[$url] = 'none';
     foreach ($h as $key => $v) {
         if (!in_array($key, array('fabrik_select', 'fabrik_edit', 'fabrik_view', 'fabrik_delete', 'fabrik_actions'))) {
             $thisurl = $url . 'group_by=' . $key;
             $a[$thisurl] = strip_tags($v);
         }
     }
     return $a;
 }
示例#5
0
文件: list.php 项目: rw1/fabrik
 public function getGroupByHeadings()
 {
     $base = JURI::getInstance();
     $base = $base->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path'));
     //$base .= strpos($base, '?') ? '&' : '?';
     $qs = JRequest::getVar('QUERY_STRING', '', 'server');
     if (stristr($qs, 'group_by')) {
         $qs = FabrikString::removeQSVar($qs, 'group_by');
     }
     $url = $base;
     if (!empty($qs)) {
         $url .= strpos($url, '?') ? '&amp;' : '?';
         $url .= $qs;
     }
     $url .= strpos($url, '?') ? '&amp;' : '?';
     $a = array();
     list($h, $x, $b, $c) = $this->getHeadings();
     $a[$url . 'group_by=0'] = JText::_('COM_FABRIK_NONE');
     foreach ($h as $key => $v) {
         if (!in_array($key, array('fabrik_select', 'fabrik_edit', 'fabrik_view', 'fabrik_delete', 'fabrik_actions'))) {
             $thisurl = $url . 'group_by=' . $key;
             $a[$thisurl] = strip_tags($v);
         }
     }
     return $a;
 }