Ejemplo n.º 1
0
 function display($tmpl = 'default')
 {
     FabrikHelperHTML::packageJS();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model = $this->getModel();
     $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
     $model->setId($id);
     $row =& $model->getVisualization();
     $model->setTableIds();
     if ($this->get('RequiredFiltersFound')) {
         $model->render();
     }
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('row', $row);
     $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'coverflow' . DS . 'views' . DS . 'coverflow' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     //ensure we don't have an incorrect version of mootools loaded
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', 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 . "coverflow" . DS . "views" . DS . "coverflow" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     FabrikHelperHTML::cleanMootools();
     //assign something to oPackage to ensure we can clear filters
     $str = "window.addEvent('domready', function(){\n\t\t\tfabrikChart{$this->row->id} = {};";
     $str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($str);
     echo parent::display();
 }
Ejemplo n.º 2
0
 function display($tmpl = 'default')
 {
     $model =& $this->getModel();
     $document =& JFactory::getDocument();
     $renderOrder = JRequest::getInt('renderOrder');
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'table' . DS . 'emailtable' . DS . 'views' . DS . 'popupwin' . DS . 'tmpl';
     $this->_setPath('template', $tmplpath);
     $this->assign('fieldList', $this->get('ToField'));
     $records = $this->get('records');
     if (count($records) == 0) {
         JError::raiseNotice(500, 'None of the selected records can be emailed');
         return;
     }
     $this->assign('recordcount', count($records));
     $this->assign('renderOrder', $renderOrder);
     $this->assign('recordids', implode(',', $records));
     $this->assign('tableid', $this->get('id', 'table'));
     $this->assign('showSubject', $this->get('showSubject'));
     $this->assign('subject', $this->get('subject'));
     $this->assign('message', $this->get('message'));
     $this->assign('allowAttachment', $this->get('allowAttachment'));
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     if ($this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
Ejemplo n.º 3
0
 function display($tmpl = 'default')
 {
     FabrikHelperHTML::packageJS();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model = $this->getModel();
     $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
     $model->setId($id);
     $row =& $model->getVisualization();
     $model->setTableIds();
     $model->render();
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('row', $row);
     $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'timeline' . DS . 'views' . DS . 'timeline' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     //ensure we don't have an incorrect version of mootools loaded
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', 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 . "timeline" . DS . "views" . DS . "timeline" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }
Ejemplo n.º 4
0
 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';
     FabrikHelperHTML::mocha();
     FabrikHelperHTML::loadCalendar();
     $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 '';
     }
     $calendar =& $model->_row;
     $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
     if ($this->requiredFiltersFound) {
         $this->assign('chart', $this->get('Chart'));
     } else {
         $this->assign('chart', '');
     }
     $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) === 1 ? 1 : 0);
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     $tmpl = $pluginParams->get('chart_layout', $tmpl);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'chart' . DS . 'views' . DS . 'chart' . 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/chart/views/chart/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 . "chart" . DS . "views" . DS . "chart" . 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\tfabrikChart{$this->row->id} = {};";
     $str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikChart{$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();
 }
Ejemplo n.º 5
0
 function display($tmpl = 'default')
 {
     $this->assignRef('rows', $this->get('UserNotifications'));
     $viewName = $this->getName();
     $tmplpath = JPATH_ROOT . DS . 'fabrik_cron' . DS . 'notification' . DS . 'views' . DS . 'cronnotification' . 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', '/plugins/fabrik_cron/notification/views/cronnotification/tmpl/' . $tmpl . '/', true);
     }
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }
Ejemplo n.º 6
0
    function display($tmpl = 'default')
    {
        $app =& JFactory::getApplication();
        FabrikHelperHTML::packageJS();
        $params =& $app->getParams('com_fabrik');
        $document =& JFactory::getDocument();
        $usersConfig =& JComponentHelper::getParams('com_fabrik');
        $model =& $this->getModel();
        $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
        $this->row =& $model->getVisualization();
        $this->params =& $model->getParams();
        $pluginParams =& $model->getPluginParams();
        $this->assignRef('params', $pluginParams);
        $tmpl = $pluginParams->get('fb_gm_layout', $tmpl);
        $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'kaltura' . DS . 'views' . DS . 'kaltura' . DS . 'tmpl' . DS . $tmpl;
        $js = <<<EOT
\t\t<script type="text/javascript" >
function entryClicked ( entry_id )
{
\twindow.location = "./player.php?entry_id=" + entry_id;
}
</script>
EOT;
        JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
        $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
        if ($this->requiredFiltersFound) {
            $this->assignRef('data', $this->get('Data'));
        } else {
            $this->assignRef('data', '');
        }
        FabrikHelperHTML::addScriptDeclaration($js);
        $ab_css_file = $tmplpath . DS . "template.css";
        if (JFile::exists($ab_css_file)) {
            JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/googlemap/views/googlemap/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 . "kaltura" . DS . "views" . DS . "kaltura" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
        $template = null;
        $this->assign('containerId', $this->get('ContainerId'));
        $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
        $this->assignRef('filters', $this->get('Filters'));
        $this->assign('filterFormURL', $this->get('FilterFormURL'));
        $this->_setPath('template', $tmplpath);
        //ensure we don't have an incorrect version of mootools loaded
        FabrikHelperHTML::cleanMootools();
        echo parent::display($template);
    }
Ejemplo n.º 7
0
 function display($tmpl = 'default')
 {
     $model =& $this->getModel();
     $this->assignRef('data', $this->get('Pivot'));
     $this->assign('heading', $this->get('Heading'));
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'table' . DS . 'pivot' . DS . 'views' . DS . 'pivotpopupwin' . DS . 'tmpl';
     $this->_setPath('template', $tmplpath);
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     if ($this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
Ejemplo n.º 8
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     static $fabrikelements;
     if (!isset($fabrikelements)) {
         $fabrikelements = array();
     }
     FabrikHelperHTML::script('element.js', 'administrator/components/com_fabrik/elements/', true);
     $document =& JFactory::getDocument();
     $c = ElementHelper::getRepeatCounter($this);
     $conn = $c === false || $node->attributes('connection_in_repeat') == 'false' ? $node->attributes('connection') : $node->attributes('connection') . '-' . $c;
     $table = $node->attributes('table');
     $include_calculations = (int) $node->attributes('include_calculations', 0);
     $published = (int) $node->attributes('published', 0);
     $showintable = (int) $node->attributes('showintable', 0);
     if ($include_calculations != 1) {
         $include_calculations = 0;
     }
     $cnns = array(JHTML::_('select.option', '-1', JText::_('COM_FABRIK_PLEASE_SELECT')));
     $id = ElementHelper::getId($this, $control_name, $name);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     $repeat = ElementHelper::getRepeat($this);
     if (!array_key_exists($id, $fabrikelements)) {
         $script = "window.addEvent('domready', function() {\n";
         $opts = new stdClass();
         $opts->table = $c === false ? 'params' . $table : 'params' . $table . "-" . $c;
         $opts->published = $published;
         $opts->showintable = $showintable;
         $opts->excludejoined = (int) $node->attributes('excludejoined', 0);
         $opts->livesite = COM_FABRIK_LIVESITE;
         $opts->conn = 'params' . $conn;
         $opts->value = $value;
         $opts->include_calculations = $include_calculations;
         $opts = FastJSON::encode($opts);
         $script .= "var p = new elementElement('{$id}', {$opts});\n";
         $script .= "Fabrik.adminElements.set('{$id}', p);\n";
         $script .= "});\n";
         $document->addScriptDeclaration($script);
         $fabrikelements[$id] = true;
     }
     FabrikHelperHTML::cleanMootools();
     $return = JHTML::_('select.genericlist', $cnns, $fullName, 'class="inputbox element"', 'value', 'text', $value, $id);
     $return .= '<img style="margin-left:10px;display:none" id="' . $id . '_loader" src="components/com_fabrik/images/ajax-loader.gif" alt="' . JText::_('LOADING') . '" />';
     return $return;
 }
Ejemplo n.º 9
0
 function display($tmpl = 'default')
 {
     $this->assignRef('rows', $this->get('UserNotifications'));
     $viewName = $this->getName();
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'cron' . DS . 'cronnotification' . DS . 'views' . DS . 'cronnotification' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     $ab_css_file = $tmplpath . DS . "template.css";
     if (file_exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/cron/cronnotification/views/cronnotification/tmpl/' . $tmpl . '/', true);
     }
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     // $$$ hugh @TODO - _isMambot ain't defined?
     if ($this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
Ejemplo n.º 10
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     static $fabriktables;
     if (!isset($fabriktables)) {
         $fabriktables = array();
     }
     FabrikHelperHTML::script('fabriktables.js', 'administrator/components/com_fabrik/elements/', true);
     $connectionDd = $node->attributes('observe', '');
     $db =& JFactory::getDBO();
     $document =& JFactory::getDocument();
     $c = ElementHelper::getRepeatCounter($this);
     $repeat = ElementHelper::getRepeat($this);
     $id = ElementHelper::getId($this, $control_name, $name);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     if ($connectionDd == '') {
         //we are not monitoring a connection drop down so load in all tables
         $query = "SELECT id AS value, label AS `{$name}` FROM #__fabrik_tables order by label ASC";
         $db->setQuery($query);
         $rows = $db->loadObjectList();
     } else {
         $rows = array(JHTML::_('select.option', '', JText::_('SELECT A CONNECTION FIRST'), 'value', $name));
     }
     if ($connectionDd != '' && !array_key_exists($id, $fabriktables)) {
         $connectionDd = $c === false || $node->attributes('connection_in_repeat') == 'false' ? $connectionDd : $connectionDd . '-' . $c;
         $opts = new stdClass();
         $opts->livesite = COM_FABRIK_LIVESITE;
         $opts->conn = 'params' . $connectionDd;
         $opts->value = $value;
         $opts->connInRepeat = $node->attributes('connection_in_repeat');
         $opts = FastJSON::encode($opts);
         $script = "window.addEvent('domready', function() {\n";
         $script .= "var p = new fabriktablesElement('{$id}', {$opts});\n";
         $script .= "tableElements.set('{$id}', p);\n";
         $script .= "Fabrik.adminElements.set('{$id}', p);\n";
         $script .= "});\n";
         $document->addScriptDeclaration($script);
         $fabriktables[$id] = true;
     }
     FabrikHelperHTML::cleanMootools();
     $str = JHTML::_('select.genericlist', $rows, $fullName, 'class="inputbox fabriktables"', 'value', $name, $value, $id);
     $str .= "<img style=\"margin-left:10px;display:none\" id=\"" . $id . "_loader\" src=\"components/com_fabrik/images/ajax-loader.gif\" alt=\"" . JText::_('LOADING') . "\" />";
     return $str;
 }
Ejemplo n.º 11
0
 function display($tmpl = 'default')
 {
     FabrikHelperHTML::debug($this, 'view');
     $records = JRequest::getVar('ids', array());
     $renderOrder = JRequest::getVar('renderOrder');
     $tableid = JRequest::getVar('id', 0);
     $this->assign('recordcount', count($records));
     $this->assign('renderOrder', $renderOrder);
     $this->assign('recordids', implode(',', $records));
     $this->assign('tableid', $tableid);
     $this->assign('fieldList', $this->get('ElementList', 'form'));
     JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/table/emailtableplus/views/emailtableplus/tmpl/', true);
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     if ($this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
Ejemplo n.º 12
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     FabrikHelperHTML::script('tables.js', 'administrator/components/com_fabrik/elements/', true);
     $connectionDd = $node->attributes('observe', '');
     $db =& JFactory::getDBO();
     $document =& JFactory::getDocument();
     $repeat = ElementHelper::getRepeat($this);
     $id = ElementHelper::getId($this, $control_name, $name);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     $c = ElementHelper::getRepeatCounter($this);
     if ($connectionDd == '') {
         //we are not monitoring a connection drop down so load in all tables
         $query = "SHOW TABLES";
         $db->setQuery($query);
         $list = $db->loadResultArray();
         foreach ($list as $l) {
             $rows[] = JHTML::_('select.option', $l, $l);
         }
     } else {
         $rows = array(JHTML::_('select.option', '', JText::_('SELECT A CONNECTION FIRST')));
     }
     if ($connectionDd != '') {
         $connectionDd = $c === false ? $connectionDd : $connectionDd . '-' . $c;
         $opts = new stdClass();
         $opts->livesite = COM_FABRIK_LIVESITE;
         $opts->conn = 'params' . $connectionDd;
         $opts->value = $value;
         $opts = FastJSON::encode($opts);
         $script = "window.addEvent('domready', function() {\n";
         $script .= "if(typeof(tableElements) === 'undefined') {\n\t\t\ttableElements = \$H();\n}\n";
         $script .= "tableElements.set('{$id}', new tablesElement('{$id}', {$opts}));\n";
         $script .= "});\n";
         if ($script != '') {
             $document->addScriptDeclaration($script);
         }
     }
     FabrikHelperHTML::cleanMootools();
     $str = JHTML::_('select.genericlist', $rows, $fullName, 'class="repeattable inputbox"', 'value', 'text', $value, $id);
     $str .= "<img style='margin-left:10px;display:none' id='" . $id . "_loader' src='components/com_fabrik/images/ajax-loader.gif' alt='" . JText::_('LOADING') . "' />";
     return $str;
 }
Ejemplo n.º 13
0
 function display($tmpl = 'default')
 {
     FabrikHelperHTML::debug($this, 'view');
     $records = JRequest::getVar('ids', array());
     $renderOrder = JRequest::getVar('renderOrder');
     $tableid = JRequest::getVar('id', 0);
     $this->assign('recordcount', count($records));
     $this->assign('renderOrder', $renderOrder);
     $this->assign('recordids', implode(',', $records));
     $this->assign('tableid', $tableid);
     $this->assign('fieldList', $this->get('ElementList', 'form'));
     $this->assign('chown_to_select', JHTML::_('select.genericlist', $this->chown_to_options, 'chown_to_val', 'class="fabrikinput inputbox" size="1"', 'value', 'text', '', 'chown_to_val'));
     JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/table/chown/views/chown/tmpl/', true);
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     if ($this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
Ejemplo n.º 14
0
    /**
     * Display the form to add or edit a table
     * @param object table
     * @param array the drop down lists used on the form
     * @param array connection tables
     * @param object menus
     * @param string compoent action
     * @param int form id that the table links to?
     * @param object parameters
     * @param object plugin mangager
     * @param object table model
     */
    function edit($row, $lists, $connectionTables, $menus, $fabrikid, $params, $pluginManager, $model, $form)
    {
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        FabrikViewTable::setTableToolbar();
        JRequest::setVar('hidemainmenu', 1);
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('pluginmanager.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('admintable.js', 'administrator/components/com_fabrik/views/', true);
        JFilterOutput::objectHTMLSafe($row);
        jimport('joomla.html.editor');
        //just until joomla uses mootools 1.2
        FabrikHelperHTML::mootools();
        require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'editor.php';
        jimport('joomla.html.pane');
        FabrikHelperHTML::tips();
        $editor =& FabrikHelperHTML::getEditor();
        $pane =& JPane::getInstance();
        $fbConfig =& JComponentHelper::getParams('com_fabrik');
        $opts = new stdClass();
        $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
        $opts = FastJSON::encode($opts);
        $lang = new stdClass();
        $lang->action = JText::_('ACTION');
        $lang->do = JText::_('DO');
        $lang->del = JText::_('DELETE');
        $lang->in = JText::_('IN');
        $lang->on = JText::_('ON');
        $lang->options = JText::_('OPTIONS');
        $lang->please_select = JText::_('COM_FABRIK_PLEASE_SELECT');
        $lang = FastJSON::encode($lang);
        $js = "window.addEvent('domready', function() {\n  \t\tvar aPlugins = [];\n";
        $js .= $pluginManager->getAdminPluginJs('table', $row, $lists);
        $js .= "controller = new TablePluginManager(aPlugins, {$lang}, {$opts});\n";
        $usedPlugins = $params->get('plugin', '', '_default', 'array');
        $js .= $pluginManager->getAdminSelectedPluginJS('table', $row, $lists, $params);
        $js .= "});\n";
        $js .= "var connectiontables = new Array;\n";
        $i = 0;
        if (is_array($connectionTables)) {
            foreach ($connectionTables as $k => $items) {
                foreach ($items as $v) {
                    $js .= "connectiontables[" . $i++ . "] = new Array('{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "');\n\t\t";
                }
            }
        }
        $js .= "\n\t\t\tfunction submitbutton(pressbutton) {\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar err = '';";
        $js .= $editor->save('introduction');
        $js .= "if(\$('label').value == '') {\n\t\t\t\t\terr = err +'" . JText::_('PLEASE ENTER A TABLE LABEL', true) . '\\n' . "';\n\t\t\t\t}\n\n\t\t\t\tif(\$('database_name')) {\n\t\t\t\t\tif(\$('database_name').value == '') {\n\t\t\t\t\t\tif(\$('connection_id')) {\n\t\t\t\t\t\t\tif(\$('connection_id').value == '-1') {\n\t\t\t\t\t\t\t\terr = err +'" . JText::_('PLEASE SELECT A CONNECTION', true) . '\\n' . "';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(\$('tablename')) {\n\t\t\t\t\t\t\tif(\$('tablename').value == '' || \$('tablename').value == '-1') {\n\t\t\t\t\t\t\t\terr = err + '" . JText::_('PLEASE SELECT A DATABASE TABLE', true) . '\\n' . "';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (err == '') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}else{\n\t\t\t\t\talert (err);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar joinCounter = 0;";
        $document->addScriptDeclaration($js);
        FabrikHelperHTML::cleanMootools();
        ?>
<form action="index.php" method="post" name="adminForm">
<table style="width: 100%">
	<tr>
		<td style="width: 50%" valign="top">
		<fieldset class="adminform"><legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
		<table class="admintable">
			<tr>
				<td class="key"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
				<td><input class="inputbox" type="text" id="label" name="label"
					size="50" value="<?php 
        echo $row->label;
        ?>
" /></td>
			</tr>
			<tr>
				<td class="key"><?php 
        echo JText::_('INTRODUCTION');
        ?>
</td>
				<td><?php 
        echo $editor->display('introduction', $row->introduction, '100%', '200', '45', '25', false);
        ?>
				</td>
			</tr>
		</table>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('FILTERS');
        ?>
</legend>
			<table class="admintable">
				<tr>
					<td class="key"><?php 
        echo JText::_('FILTER TRIGGER');
        ?>
</td>
					<td><?php 
        echo $lists['filter_action'];
        ?>
</td>
				</tr>
			</table>
			<?php 
        echo $form->render('params', 'filters');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('NAVIGATION');
        ?>
</legend>
			<table class="admintable">
			<tr>
				<td class="key"><label for="rows_per_page"><?php 
        echo JText::_('ROWS PER PAGE');
        ?>
</label>
				</td>
				<td><input type="text" name="rows_per_page" id="rows_per_page"
					class="inputbox"
					value="<?php 
        echo $row->rows_per_page != '' ? $row->rows_per_page : 10;
        ?>
"
					size="3" /></td>
			</tr>
			</table>
			<?php 
        echo $form->render('params', 'navigation');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('LAYOUT');
        ?>
</legend>
			<table class="admintable">
			<tr>
				<td class="key"><?php 
        echo JText::_('TEMPLATE');
        ?>
</td>
				<td><?php 
        print_r($lists['tableTemplates']);
        ?>
</td>
			</tr>
			</table>
			<?php 
        echo $form->render('params', 'layout');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('COM_FABRIK_DETAIL_LINKS');
        ?>
</legend>
			<?php 
        echo $form->render('params', 'detaillinks');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('COM_FABRIK_EDIT_LINKS');
        ?>
</legend>
			<?php 
        echo $form->render('params', 'editlinks');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('COM_FABRIK_ADD_LINK');
        ?>
</legend>
			<?php 
        echo $form->render('params', 'addlink');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('Notes');
        ?>
</legend> <?php 
        echo $form->render('params', 'notes');
        ?>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('Advanced');
        ?>
</legend> <?php 
        echo $form->render('params', 'advanced');
        ?>
		</fieldset>
    <?php 
        if ($fbConfig->get('use_wip')) {
            ?>
		<fieldset><legend><?php 
            echo JText::_('WORK IN PROGRESS');
            ?>
</legend> <?php 
            echo $form->render('params', 'wip');
            ?>
		<?php 
        }
        ?>


		</td>
		<td valign="top"><?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel(JText::_('PUBLISHING'), "publish-page");
        echo $form->render('details');
        ?>
		<fieldset><legend><?php 
        echo JText::_('RSS OPTIONS');
        ?>
</legend> <?php 
        echo $form->render('params', 'rss');
        ?>
</fieldset>
		<fieldset><legend><?php 
        echo JText::_('CSV OPTIONS');
        ?>
</legend> <?php 
        echo $form->render('params', 'csv');
        ?>
		</fieldset>
		<fieldset><legend><?php 
        echo JText::_('SEARCH');
        ?>
</legend> <?php 
        echo $form->render('params', 'search');
        ?>
		</fieldset>
		<?php 
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('ACCESS'), "access-page");
        ?>
		<fieldset><legend><?php 
        echo JText::_('ACCESS');
        ?>
</legend> <?php 
        echo $form->render('params', 'access');
        ?>
		</fieldset>
		<?php 
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('DATA'), "tabledata-page");
        ?>
		<fieldset><legend><?php 
        echo JText::_('DATA');
        ?>
</legend>
		<table class="admintable">
			<tr>
				<td class="key"><?php 
        echo JText::_('CONNECTION');
        ?>
</td>
				<td><?php 
        echo $lists['connections'];
        ?>
</td>
			</tr>
			<?php 
        if ($row->id == 0) {
            ?>
			<tr>
				<td class="key"><?php 
            echo JText::_('CREATE NEW TABLE');
            ?>
</td>
				<td><input id="database_name" name="_database_name" size="40" /></td>
			</tr>
			<tr>
				<td colspan="2"><?php 
            echo JText::_('OR');
            ?>
</td>
			</tr>
			<?php 
        }
        ?>

			<tr>
				<td class="key"><?php 
        echo JText::_('LINK TO TABLE');
        ?>
</td>
				<td><?php 
        echo $lists['tablename'];
        ?>
</td>
			</tr>
			<?php 
        if ($row->id != '') {
            ?>
			<tr>
				<td class="key"><label for="db_primary_key"> <?php 
            echo JHTML::_('tooltip', JText::_("PRIMARY KEY DESC"), JText::_('PRIMARY KEY'), 'tooltip.png', JText::_('PRIMARY KEY'));
            ?>
				</label></td>
				<td><?php 
            echo $lists['db_primary_key'];
            ?>
</td>
			</tr>
			<tr>
				<td class="key"><?php 
            echo JText::_('AUTO INCREMENT');
            ?>
</td>
				<td>
				<label>
					<input type="radio" name="auto_inc" value="0" <?php 
            echo $row->auto_inc ? '' : 'checked="checked"';
            ?>
 />
					<?php 
            echo JText::_('No');
            ?>
				</label>
				<label>
					<input type="radio" name="auto_inc" value="1" <?php 
            echo $row->auto_inc ? 'checked="checked"' : '';
            ?>
 />
					<?php 
            echo JText::_('YES');
            ?>
				</label>
				</td>
			</tr>
			<?php 
        }
        ?>
			<tr>
				<td class="key"><label for="order_by"><?php 
        echo JText::_('ORDER BY');
        ?>
</label></td>
				<td id="orderByTd"><?php 
        for ($o = 0; $o < count($lists['order_by']); $o++) {
            ?>
				<div class="orderby_container" style="margin-bottom:3px">
				<?php 
            echo $lists['order_by'][$o];
            ?>
				<?php 
            if ($row->id !== 0) {
                echo JArrayHelper::getValue($lists['order_dir'], $o, $lists['order_dir'][0]);
                ?>
					<a class="addOrder" href="#"><img src="components/com_fabrik/images/add.png" label="<?php 
                echo JText::_('ADD');
                ?>
" alt="<?php 
                echo JText::_('ADD');
                ?>
" /></a>
					<a class="deleteOrder" href="#"><img src="components/com_fabrik/images/remove.png" label="<?php 
                echo JText::_('REMOVE');
                ?>
" alt="<?php 
                echo JText::_('REMOVE');
                ?>
" /></a>
					<?php 
            }
            ?>
				</div>
				<?php 
        }
        ?>
				</td>
			</tr>
		</table>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('GROUP BY');
        ?>
</legend>
		<table class="admintable">
			<tr>
				<td class="key"><label for="group_by"><?php 
        echo JText::_('GROUP BY');
        ?>
</label>
				</td>
				<td id="groupByTd"><?php 
        echo $lists['group_by'];
        ?>
</td>
			</tr>
		</table>
		<?php 
        echo $form->render('params', 'grouping');
        ?>
</fieldset>

		<fieldset><legend><?php 
        echo JHTML::_('tooltip', JText::_('PREFILTER DESC'), JText::_('PREFILTER'), 'tooltip.png', JText::_('PREFILTER'));
        ?>
</legend>
		<a class="addButton" href="#"
			onclick="oAdminFilters.addFilterOption(); return false;"><?php 
        echo JText::_('ADD');
        ?>
</a>
			<?php 
        echo $form->render('params', 'prefilter');
        ?>
		<table class="adminform" width="100%">
			<tbody id="filterContainer">
			</tbody>
		</table>
		</fieldset>

		<fieldset><legend> <?php 
        echo JHTML::_('tooltip', JText::_('JOIN DESC'), JText::_('JOINS'), 'tooltip.png', JText::_('JOINS'));
        ?>
		</legend> <?php 
        if ($row->id != 0) {
            ?>
 <a href="#" id="addAJoin"
			class="addButton"><?php 
            echo JText::_('ADD');
            ?>
</a>
		<div id="joindtd"></div>
		<?php 
            echo $form->render('params', 'joins');
            ?>
		<?php 
        } else {
            echo JText::_('Available once saved');
        }
        ?>
</fieldset>
		<fieldset><legend> <?php 
        echo JHTML::_('tooltip', JText::_('RELATED DATA DESC'), JText::_('RELATED DATA'), 'tooltip.png', JText::_('RELATED DATA'));
        ?>
		</legend> <?php 
        if (empty($lists['linkedtables'])) {
            echo "<i>" . JText::_('No other tables link here') . "</i>";
        } else {
            ?>
				<table class="adminlist linkedTables">
					<thead>
					<tr>
					<th></th>
						<th><?php 
            echo JText::_('TABLE');
            ?>
</th>
						<th><?php 
            echo JText::_('LINK TO TABLE');
            ?>
</th>
						<th><?php 
            echo JText::_('HEADING');
            ?>
</th>
						<th><?php 
            echo JText::_('BUTTON_TEXT');
            ?>
</th>
						<th><?php 
            echo JText::_('POPUP');
            ?>
</th>
					</tr>
				</thead>
				<tbody>
				<?php 
            $i = 0;
            foreach ($lists['linkedtables'] as $linkedTable) {
                ?>
			<tr class="row<?php 
                echo $i % 2;
                ?>
">
				<td class="handle"></td>
				<td><?php 
                echo JHTML::_('tooltip', $linkedTable[1], $linkedTable[0], 'tooltip.png', $linkedTable[0]);
                ?>
				<td><?php 
                echo $linkedTable[2];
                ?>
</td>
				<td><?php 
                echo $linkedTable[3];
                ?>
</td>
				<td><?php 
                echo $linkedTable[5];
                ?>
</td>
				<td><?php 
                echo $linkedTable[4];
                ?>
</td>
			</tr>
			<?php 
                $i++;
            }
            ?>
				</tbody>
			</table>
		<table class="adminlist linkedForms" style="margin-toip:20px">
			<thead>
				<tr>
					<th></th>
					<th><?php 
            echo JText::_('TABLE');
            ?>
</th>
					<th><?php 
            echo JText::_('LINK TO FORM');
            ?>
</th>
					<th><?php 
            echo JText::_('HEADING');
            ?>
</th>
					<th><?php 
            echo JText::_('BUTTON_TEXT');
            ?>
</th>
					<th><?php 
            echo JText::_('POPUP');
            ?>
</th>
				</tr>
			</thead>
			<tbody>
			<?php 
            $i = 0;
            foreach ($lists['linkedforms'] as $linkedForm) {
                ?>
			<tr class="row<?php 
                echo $i % 2;
                ?>
">
				<td class="handle"></td>
				<td><?php 
                echo JHTML::_('tooltip', $linkedForm['formhover'], $linkedForm[0], 'tooltip.png', $linkedForm[0]);
                ?>
				<td><?php 
                echo $linkedForm[1];
                ?>
</td>
				<td><?php 
                echo $linkedForm[2];
                ?>
</td>
				<td><?php 
                echo $linkedForm[4];
                ?>
</td>
				<td><?php 
                echo $linkedForm[3];
                ?>
</td>
			</tr>
			<?php 
                $i++;
            }
            ?>
			</tbody>
		</table>
		<?php 
        }
        ?>
</fieldset>

		<?php 
        echo $pane->startPanel(JText::_('PLUGINS'), "plugins-page");
        ?>
		<div id="plugins"></div>
		<a href="#" id="addPlugin" class="addButton"><?php 
        echo JText::_('ADD');
        ?>
</a>

		<?php 
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
</td>
	</tr>
</table>
	<input type="hidden" name="params[isview]" value="<?php 
        echo $params->get('isview', -1);
        ?>
" />
	<input type="hidden" name="option" value="com_fabrik" />
	<input type="hidden" name="task" value="saveTable" />
	<input type="hidden" name="c" value="table" />
	<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
	<input type="hidden" name="fabrikid" value="<?php 
        echo $fabrikid;
        ?>
" />
	<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
	</form>

<?php 
        //$joinTypeOpts = "[['inner', '" . JText::_('INNER JOIN') ."'], ['left', '" . JText::_('LEFT JOIN') ."'], ['right', '" . JText::_('RIGHT JOIN') ."']]";
        $joinTypeOpts = array();
        $joinTypeOpts[] = array('inner', JText::_('INNER JOIN'));
        $joinTypeOpts[] = array('left', JText::_('LEFT JOIN'));
        $joinTypeOpts[] = array('right', JText::_('RIGHT JOIN'));
        $activetableOpts[] = "";
        $activetableOpts[] = $row->db_table_name;
        if (array_key_exists('joins', $lists)) {
            for ($i = 0; $i < count($lists['joins']); $i++) {
                $j = $lists['joins'][$i];
                $activetableOpts[] = $j->table_join;
                $activetableOpts[] = $j->join_from_table;
            }
        }
        $activetableOpts = array_unique($activetableOpts);
        $activetableOpts = array_values($activetableOpts);
        $joinLang = new stdClass();
        $joinLang->joinType = JText::_('JOIN TYPE');
        $joinLang->joinFromTable = JText::_('FROM');
        $joinLang->joinToTable = JText::_('TO');
        $joinLang->thisTablesIdCol = JText::_('FROM COLUMN');
        $joinLang->joinTablesIdCol = JText::_('TO COLUMN');
        $joinLang->del = JText::_('DELETE');
        $joinLang = FastJSON::encode($joinLang);
        $opts = new stdClass();
        $opts->joinOpts = $joinTypeOpts;
        $opts->tableOpts = $lists['defaultJoinTables'];
        $opts->activetableOpts = $activetableOpts;
        $opts = FastJSON::encode($opts);
        $filterOpts = new stdClass();
        $filterOpts->filterJoinDd = $model->getFilterJoinDd(false, 'params[filter-join][]');
        $filterOpts->filterCondDd = $model->getFilterConditionDd(false, 'params[filter-conditions][]', 2);
        //$filterOpts->filterAccess = addslashes(str_replace(array("\n", "\r"), '', $lists['filter-access']));
        $filterOpts->filterAccess = str_replace(array("\n", "\r"), '', $lists['filter-access']);
        $filterOpts = FastJSON::encode($filterOpts);
        $applyFilterText = defined('_JACL') ? 'APPLY FILTER TO' : 'APPLY FILTER BENEATH';
        $filterLang = new stdClass();
        $filterLang->join = JText::_('JOIN');
        $filterLang->field = JText::_('FIELD');
        $filterLang->condition = JText::_('CONDITION');
        $filterLang->value = JText::_('VALUE');
        $filterLang->eval = JText::_('EVAL');
        $filterLang->applyFilterTo = JText::_($applyFilterText);
        $filterLang->del = JText::_('DELETE');
        $filterLang->yes = JText::_('YES');
        $filterLang->no = JText::_('NO');
        $filterLang->query = JText::_('QUERY');
        $filterLang->noquotes = JTEXT::_('NOQUOTES');
        $filterLang->text = JText::_('TEXT');
        $filterLang->type = JText::_('TYPE');
        $filterLang->please_select = JText::_('COM_FABRIK_PLEASE_SELECT');
        $filterLang->grouped = JText::_('GROUPED');
        $filterLang = FastJSON::encode($filterLang);
        $script = "window.addEvent('domready', function() {\n\toAdminTable = new tableForm({$opts}, {$joinLang});\n\toAdminTable.watchJoins();\n";
        if (array_key_exists('joins', $lists)) {
            for ($i = 0; $i < count($lists['joins']); $i++) {
                $j = $lists['joins'][$i];
                $joinFormFields = FastJSON::encode($j->joinFormFields);
                $joinToFields = FastJSON::encode($j->joinToFields);
                $script .= "\toAdminTable.addJoin('{$j->group_id}','{$j->id}','{$j->join_type}','{$j->table_join}',";
                $script .= "'{$j->table_key}','{$j->table_join_key}','{$j->join_from_table}', {$joinFormFields}, {$joinToFields});\n";
            }
        }
        $filterfields = addslashes(str_replace(array("\n", "\r"), '', $lists['filter-fields']));
        $script .= "\toAdminFilters = new adminFilters('filterContainer', '{$filterfields}', {$filterOpts}, {$filterLang});\n";
        $afilterJoins = $params->get('filter-join', '', '_default', 'array');
        $afilterFields = $params->get('filter-fields', '', '_default', 'array');
        $afilterConditions = $params->get('filter-conditions', '', '_default', 'array');
        $afilterEval = $params->get('filter-eval', '', '_default', 'array');
        $afilterValues = $params->get('filter-value', '', '_default', 'array');
        $afilterAccess = $params->get('filter-access', '', '_default', 'array');
        $aGrouped = $params->get('filter-grouped', '', '_default', 'array');
        for ($i = 0; $i < count($afilterFields); $i++) {
            $selJoin = JArrayHelper::getValue($afilterJoins, $i, 'and');
            $selFilter = $afilterFields[$i];
            $grouped = $aGrouped[$i];
            $selCondition = $afilterConditions[$i];
            $filerEval = JArrayHelper::getValue($afilterEval, $i, '1');
            if ($selCondition == '&gt;') {
                $selCondition = '>';
            }
            if ($selCondition == '&lt;') {
                $selCondition = '<';
            }
            $selValue = JArrayHelper::getValue($afilterValues, $i, '');
            $selAccess = $afilterAccess[$i];
            //alow for multiline js variables ?
            $selValue = htmlspecialchars_decode($selValue, ENT_QUOTES);
            $selValue = FastJSON::encode($selValue);
            if ($selFilter != '') {
                $script .= "\toAdminFilters.addFilterOption('{$selJoin}', '{$selFilter}', '{$selCondition}', {$selValue}, '{$selAccess}', '{$filerEval}', '{$grouped}');\n";
            }
        }
        $script .= "\n});";
        $document->addScriptDeclaration($script);
        $session =& JFactory::getSession();
        $session->clear('com_fabrik.admin.table.edit.model');
    }
Ejemplo n.º 15
0
 function display($tpl = null)
 {
     $config =& JFactory::getConfig();
     $user =& JFactory::getUser();
     $model =& $this->getModel();
     $formModel =& $this->_formView->getModel();
     //Get the active menu item
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model->setId($usersConfig->get('packageid', JRequest::getInt('packageid', 0)));
     $package =& $model->getPackage();
     $model->_lastTask = JRequest::getVar('task', '');
     $model->_senderBlock = JRequest::getVar('fabrik_senderBlock', '');
     //@TODO: not sure if this is used?
     $model->_lastTaskStatus = JRequest::getVar('taskstatus', '');
     /** @var string any data created by the lasttask - e.g. data to create a new table row with */
     $model->_lastTaskData = JRequest::getVar('taskData', '');
     // TODO: query table/forms to find out which blocks are releated to the block that has updated itself
     $model->_updateBlocks = JRequest::getVar('fbUpdateBlocks', array());
     $model->loadTables();
     $package =& $model->getPackage();
     $usedForms = array();
     if ($package->tables != '') {
         $tableids = explode(",", $package->tables);
         foreach ($tableids as $i) {
             if ($i === '') {
                 continue;
             }
             //in PHP5 objects are assigned by reference as default -
             //cloning object doesnt deep clone other oject references either??
             //this copy method might be intensive
             $tableView = clone $this->_tableView;
             $tableView->setId($i);
             $tableView->_isMambot = true;
             $tableModel =& $tableView->getModel();
             $tableModel->setId($i);
             $tableModel->_packageId = $this->_id;
             $tableModel->_postMethod = 'ajax';
             $table =& $tableModel->getTable();
             $this->blocks[$table->label] = $tableView->display();
             $table = $tableModel->getTable();
             $formModel =& $tableModel->getForm();
             $formModel->_editable = 1;
             $formView = clone $this->_formView;
             //used to buffer output
             $formView->_isMambot = true;
             $formView->setId($table->form_id);
             $formModel->_postMethod = 'ajax';
             $formModel->_packageId = $this->_id;
             $usedForms[] = $formModel->_id;
             $formView->setModel($formModel, true);
             $this->blocks['form_' . $formModel->_id] = $formView->display();
             //creating a read only view
             $formModel->_editable = 0;
             $formView->setModel($formModel, true);
             $orgiView = JRequest::getVar('view', 'form');
             $view = JRequest::setVar('view', 'details');
             $this->blocks[$table->label . ' details'] = $formView->display();
             JRequest::setVar('view', $orgiView);
         }
     }
     // see if we have any forms that dont record to the database that need to be added to blocks[]
     // can occur when redering a form in a module with use ajax turned on
     if ($package->forms != '') {
         $formids = explode(",", $package->forms);
         foreach ($formids as $fid) {
             if (!array_key_exists('form_' . $fid, $this->blocks)) {
                 $formModel->_editable = 1;
                 $formView = clone $this->_formView;
                 //used to buffer output
                 $formView->_isMambot = true;
                 $formView->setId($fid);
                 $formModel->_postMethod = 'ajax';
                 $formModel->_packageId = $this->_id;
                 $usedForms[] = $formModel->_id;
                 $formView->setModel($formModel, true);
                 $this->blocks['form_' . $formModel->_id] = $formView->display();
             }
         }
     }
     $model->render();
     $this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
     $tmpl = JRequest::getVar('layout', 'default');
     //$this->blocks = $model->_blocks;
     $this->_setPath('template', $this->_basePath . DS . 'package' . DS . 'tmpl' . DS . $tmpl);
     if (!isset($package->template)) {
         $package->template = 'default';
         $tmpl = JRequest::getVar('layout', $package->template);
     } else {
         //set by table module in ajax mode
         $tmpl = $package->template;
     }
     $this->_includeCSS($tmpl);
     $this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
     $this->_setPath('template', $this->_basePath . DS . 'package' . DS . 'tmpl' . DS . $tmpl);
     $liveTmplPath = JURI::root() . '/components/com_fabrik/views/package/tmpl/' . $tmpl . '/';
     FabrikHelperHTML::mootools();
     FabrikHelperHTML::mocha();
     // check for a custom js file and include it if it exists
     $aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "package" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
     if (file_exists($aJsPath)) {
         FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/package/tmpl/' . $tmpl . '/', true);
     }
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     if ($this->_isMambot) {
         $res = $this->loadTemplate();
         if (JError::isError($res)) {
             print_r(JError::getErrors());
         } else {
             return $res;
         }
     } else {
         parent::display();
     }
 }
Ejemplo n.º 16
0
    /**
     * Display the form to add or edit an form
     * @param object form table
     * @param object plugin manager
     * @param array lists
     * @param object parameters from attributes
     * @param object form - used to render xml form cdoe
     */
    function edit($row, $pluginManager, $lists, $params, &$form)
    {
        FabrikHelperHTML::mootools();
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        jimport('joomla.html.pane');
        JRequest::setVar('hidemainmenu', 1);
        $pane =& JPane::getInstance();
        FabrikHelperHTML::tips();
        FabrikViewForm::setFormToolbar();
        $editor =& JFactory::getEditor();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('pluginmanager.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('adminform.js', 'administrator/components/com_fabrik/views/', true);
        JFilterOutput::objectHTMLSafe($row);
        $lang = new stdClass();
        $lang->action = JText::_('ACTION');
        $lang->do = JText::_('DO');
        $lang->del = JText::_('DELETE');
        $lang->in = JText::_('IN');
        $lang->on = JText::_('ON');
        $lang->options = JText::_('OPTIONS');
        $lang->please_select = JText::_('COM_FABRIK_PLEASE_SELECT');
        $lang->front_end = JText::_('FRONT END');
        $lang->back_end = JText::_('BACK END');
        $lang->both = JText::_('BOTH');
        $lang->new = JText::_('NEW');
        $lang->edit = JText::_('EDIT');
        $lang = FastJSON::encode($lang);
        $js = "\n  window.addEvent('load', function() {\n  \tvar lang = {$lang};\n";
        $js .= $pluginManager->getAdminPluginJs('form', $row, $lists);
        $js .= "controller = new fabrikAdminForm(aPlugins, lang);\n";
        $js .= $pluginManager->getAdminSelectedPluginJS('form', $row, $lists, $params);
        jimport('joomla.html.editor');
        $js .= "\n});\n\nfunction submitbutton(pressbutton) {\n\n\tvar form = document.adminForm;" . $editor->save('intro') . "\n\tif (pressbutton == 'cancel') {\n\t\tsubmitform( pressbutton);\n\t\treturn;\n\t}\n\n\t/* do field validation */\n\tvar err = '';\n\n\tif (form.label.value == '') {\n\t\terr = err + '" . JText::_('PLEASE ENTER A FORM LABEL', true) . '\\n' . "';\n\t}\n\n\tif(form.record_in_database.checked == true && form._database_name.value == '') {\n\t\terr = err + '" . JText::_('PLEASE ENTER A DATABASE TABLE NAME', true) . "';\n\t}\n\tif (err == '') {\n\t\t/* assemble the form groups back into one field */\n\t\tmergeFormGroups()\n\t\tsubmitform( pressbutton);\n\t}else{\n\t\talert (err);\n\t}\n}\n\nfunction mergeFormGroups() {\n\t/* assemble the form groups back into one field */\n\tvar tmp = [];\n\tif(\$('current_groups')) {\n\t\tvar opts = \$('current_groups').options;\n\t\tfor (var i=0, n=opts.length; i < n; i++) {\n\t\t\ttmp.push(opts[i].value);\n\t\t}\n\t\t\$('current_groups_str').value = tmp.join(',');\n\t}\n}\n";
        $document->addScriptDeclaration($js);
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm" id="adminForm">
		 	<table style="width:100%;">
		 		<tr>
	 			<td style="width:50%;" valign="top">
	 			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
					<table class="admintable">
						<tr>
							<td class="key" width="30%">
							<?php 
        echo JHTML::_('tooltip', JText::_('FROM LABEL DESC'), JText::_('LABEL'), 'tooltip.png', JText::_('LABEL'));
        ?>
							</td>
							<td width="70%">
								<input class="inputbox" type="text" name="label" id="label" size="50" value="<?php 
        echo $row->label;
        ?>
" />
							</td>
						</tr>
						<tr>
							<td class="key"><?php 
        echo JText::_('INTRODUCTION');
        ?>
</td>
							<td><?php 
        echo $editor->display('intro', $row->intro, '100%', '200', '50', '5', false);
        ?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="error">
								<?php 
        echo JHTML::_('tooltip', JText::_('FROM ERROR MESSAGE DESC'), JText::_('ERROR MESSAGE'), 'tooltip.png', JText::_('ERROR MESSAGE', true));
        ?>
								</label>
							</td>
							<td>
								<input class="inputbox" type="text" name="error" id="error" size="50" value="<?php 
        echo $row->error;
        ?>
" />
							</td>
						</tr>
					</table>
				</fieldset>
				<fieldset class="adminform">
				<legend><?php 
        echo JText::_('BUTTONS');
        ?>
</legend>
						<?php 
        echo $form->render('params', 'buttons');
        ?>
						<table class="admintable">
						<tr>
							<td class="key">
								<label for="submit_button_label">
								<?php 
        echo JText::_('SUBMIT LABEL');
        ?>
								</label>
							</td>
							<td>
								<input type="text" class="inputbox" id="submit_button_label" name="submit_button_label" value="<?php 
        echo $row->submit_button_label;
        ?>
" />
							</td>
						</tr>
					</table>
				</fieldset>
				<fieldset class="adminform">
				<legend><?php 
        echo JText::_('FORM PROCESSING');
        ?>
</legend>
					<table class="admintable">
						<tr>
							<td class="key">
							<label for="record_in_database">
							<?php 
        echo JText::_('RECORD IN DATABASE');
        ?>
							</label>
							</td>
							<td>
							<input type="checkbox" id="record_in_database" name="record_in_database" value="1" <?php 
        if ($row->record_in_database == '1') {
            echo " checked=\"checked\"";
        }
        ?>
 />
							</td>
						</tr>
						<tr>
							<td class="key">
							<label for="database_name">
							<?php 
        echo JText::_('TABLE NAME');
        ?>
							</label>
							</td>
							<td>
							<?php 
        if ($row->record_in_database != '1') {
            ?>
								<input id="database_name" name="_database_name" value="" size="40" />
							<?php 
        } else {
            ?>
									<?php 
            echo $row->_database_name;
            ?>
									<input type="hidden" id="database_name" name="_database_name" value="<?php 
            echo $row->_database_name;
            ?>
"  />
									<input type="hidden" id="_connection_id" name="_connection_id" value="<?php 
            echo $row->_connection_id;
            ?>
"  />
							<?php 
        }
        ?>
							</td>
						</tr>
				</table>
				<?php 
        echo $form->render('params', 'processing');
        ?>
			</fieldset>
			<fieldset>
				<legend><?php 
        echo JText::_('Notes');
        ?>
</legend>
					<?php 
        echo $form->render('params', 'notes');
        ?>
			</fieldset>
					</td>
					<td valign="top">
					<?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel('Publishing', "publish-page");
        echo $form->render('details');
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('GROUPS'), "formgroups-page");
        ?>
		<table class="adminform">
			<tr>
				<th colspan="2"><?php 
        echo JText::_('GROUPS');
        ?>
</th>
			</tr>
			<tr>
				<td colspan="2"><label>
				<?php 
        $checked = empty($lists['current_groups']) ? 'checked="checked"' : '';
        ?>
				<input type="checkbox" <?php 
        echo $checked;
        ?>
 name="_createGroup" id="_createGroup" value="1" />
				<?php 
        echo JText::_('CREATE A GROUP WITH THE SAME NAME AS THIS FORM');
        ?>
				</label></td>
			</tr>
			<?php 
        if (empty($lists['groups']) && empty($lists['current_groups'])) {
            ?>
			<tr>
				<td>
				<?php 
            echo JText::_('NO GROUPS AVAILABLE');
            ?>
				<input type="hidden" name="_createGroup" id="_createGroup" value="1" />
				</td>
			</tr>
			<?php 
        } else {
            ?>

			<tr>
				<td colspan="2"><p><?php 
            echo JText::_('AVAILABLE GROUPS');
            ?>
: </p>
				<?php 
            echo $lists['grouplist'];
            ?>
</td>
			</tr>
			<tr>
				<td colspan="2">
					<input class="button" type="button" value="<?php 
            echo JText::_('ADD');
            ?>
"
					onclick="$('_createGroup').checked = false;addSelectedToList('adminForm','groups','current_groups');delSelectedFromList('adminForm','groups');" />
				</td>
			</tr>
			<tr>
				<td colspan="2"><p><?php 
            echo JText::_('CURRENT GROUPS');
            ?>
: </p>
				<?php 
            echo $lists['current_grouplist'];
            ?>
</td>
			</tr>
			<tr>
				<td colspan="2"><input class="button" type="button"
					value="<?php 
            echo JText::_('UP');
            ?>
"
					onclick="moveInList('adminForm','current_groups',adminForm.current_groups.selectedIndex,-1)" />
				<input class="button" type="button" value="<?php 
            echo JText::_('DOWN');
            ?>
"
					onclick="moveInList('adminForm','current_groups',adminForm.current_groups.selectedIndex,+1)" />
				<input class="button" type="button" value="<?php 
            echo JText::_('REMOVE');
            ?>
"
					onclick="addSelectedToList('adminForm', 'current_groups', 'groups');delSelectedFromList('adminForm','current_groups');" />
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>
		<?php 
        echo $form->render('params', 'groups');
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('TEMPLATES'), "template-page");
        ?>
		<table class="paramlist admintable">
			<tr>
				<td class="paramlist_key"><?php 
        echo JText::_('DETAILED VIEW TEMPLATE');
        ?>
</td>
				<td class="paramlist_value"><?php 
        echo $lists['viewOnlyTemplates'];
        ?>
</td>
			</tr>
			<tr>
				<td class="paramlist_key"><?php 
        echo JText::_('FORM TEMPLATE');
        ?>
</td>
				<td class="paramlist_value"><?php 
        echo $lists['formTemplates'];
        ?>
</td>
			</tr>
		</table>
		<?php 
        echo $form->render('params', 'templates');
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('OPTIONS'), "menu-page");
        echo $form->render('params', 'options');
        ?>
		<fieldset>
		<legend><?php 
        echo JText::_('CCK');
        ?>
</legend>
		<?php 
        echo $form->render('params', 'cck');
        ?>
		</fieldset>
		<?php 
        echo $pane->endPanel();
        echo $pane->startPanel('Submission plug-ins', "actions-page");
        ?>
			<div id="plugins"></div>
			<a href="#" class="addButton" id="addPlugin"><?php 
        echo JText::_('ADD');
        ?>
</a>
		<?php 
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
			</td>
		</tr>
	</table>
	<input type="hidden" name="task" id="task" value="" />
	<input type="hidden" name="option" value="com_fabrik" />
	<input type="hidden" name="c" value="form" />
	<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
	<input type="hidden" name="boxchecked" value="" />
	<input type="hidden" name="current_groups_str" id="current_groups_str" value="" />
	<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
</form>
	<?php 
    }
Ejemplo n.º 17
0
    /**
     * Display home page
     */
    function show($feed, $logs)
    {
        JHTML::stylesheet('admin.css', 'media/com_fabrik/css/');
        jimport('joomla.html.pane');
        $pane =& JPane::getInstance('Sliders');
        JToolBarHelper::title(JText::_('WELCOME'), 'fabrik.png');
        FabrikHelperHTML::cleanMootools();
        ?>

<table class="adminForm" style="width: 100%">
	<tbody>
		<tr>
			<td valign="top" style="width: 50%">
			<a href="http://fabrikar.com">
				<?php 
        echo JHTML::image('media/com_fabrik/images/logo.png', 'Fabrik logo');
        ?>
				</a>
			<div style="float:left;width:250px;margin-top:30px;">
			<a href="http://fabrikar.com/subscribe">
				<?php 
        echo JHTML::image('media/com_fabrik/images/box.png', 'Fabrik');
        ?>
			</a>
			</div>
			<div style="margin-left:200px;margin-top:30px;">
			<h1>Subscribe and get</h1>
			<ul>
				<li>Dedicated support</li>
				<li>Concise and clear documentation</li>
				<li>Video tutorials</li>
			</ul>
			<a href="http://fabrikar.com/subscribe">
			<?php 
        echo JHTML::image('media/com_fabrik/images/subscribe-now.png', 'Fabrik');
        ?>
			</a><br />
			</div>

			</td>
			<td valign="top"  style="width: 50%"><?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel('About', "publish-page");
        echo "<table class='adminlist'>\n\t\t\t<tr><td><p>Fabrik is an open source Joomla application builder\ncomponent.</p>\n<p>Fabrik gives people the power to create forms, tables and visualizations that run inside\nJoomla without requiring knowledge of mySQL and PHP, all from within the\nfamiliar Joomla administration interface.</p>\n<p>With Fabrik you can create\napplications that range in complexity from simple contact forms to\ncomplex applications such as a job application site or bug tracking\nsystems.</p></td></tr></table>";
        echo $pane->endPanel();
        echo $pane->startPanel('News', "publish-page");
        echo $feed;
        echo $pane->endPanel();
        echo $pane->startPanel('Stats', "publish-page");
        ?>
			<table class='adminlist'>
			<thead>
				<tr>
					<th style="width:20%"><?php 
        echo JText::_('DATE');
        ?>
</th>
					<th><?php 
        echo JText::_('ACTION');
        ?>
</th>
				</tr>
			</thead>
			<tbody>
					<?php 
        foreach ($logs as $log) {
            ?>
					<tr>
						<td>
						<?php 
            echo $log->timedate_created;
            ?>
						</td>
						<td>
						<span class="editlinktip hasTip" title="<?php 
            echo $log->message_type . "::" . $log->message;
            ?>
">
							<?php 
            echo $log->message_type;
            ?>
						</span>
						</td>
					</tr>
					<?php 
        }
        ?>
				</tbody>
			</table>
			<?php 
        echo $pane->endPanel();
        echo $pane->startPanel('Useful links', "publish-page");
        ?>
			<table class='adminlist'>
				<tbody>
					<tr>
						<td>
						<ul>
							<li><a href="http://fabrikar.com/">Fabrik web site</a></li>
							<li><a href="http://fabrikar.com/forums">Forum</a>
							<li><a
								href="http://fabrikar.com/wiki">Documentation
							WIKI</a></li>
						</ul>
						</td>
					</tr>
				</tbody>
			</table>
			<?php 
        echo $pane->endPanel();
        echo $pane->startPanel('Tools', "publish-page");
        ?>
			<table class='adminlist'>
				<tbody>
					<tr>
						<td>
						<ul>
							<li><a href="index.php?option=com_fabrik&task=installSampleData">Install
							Sample data</a></li>
							<li><a onclick="return confirm('Are you really sure this will wipe ALL your Fabrik data?');" href="index.php?option=com_fabrik&c=home&task=reset"><?php 
        echo JText::_('Reset Fabrik');
        ?>
</a></li>
						</ul>
						</td>
					</tr>
				</tbody>
			</table>
			<?php 
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
</td>
		</tr>
	</tbody>
</table>
			<?php 
    }
Ejemplo n.º 18
0
    /**
     * Display the form to add or edit a Visualization
     * @param object Visualization
     * @param object parameters from attributes
     * @param array lists
     * @param object menus
     * @param object pluginmanager
     * @param object form - used to render xml form cdoe
     */
    function edit(&$row, &$params, &$lists, &$menus, &$pluginManager, &$form)
    {
        //echo "<pre>";print_r($form);print_r($params->get('show-title'));exit;
        JRequest::setVar('hidemainmenu', 1);
        FabrikViewVisualization::setVisualizationToolbar();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('adminvisualization.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::tips();
        JFilterOutput::objectHTMLSafe($row);
        $db =& JFactory::getDBO();
        jimport('joomla.html.pane');
        $pane =& JPane::getInstance();
        $editor =& JFactory::getEditor();
        $js = "window.addEvent('load', function() {\n\t\tnew adminVisualization({'sel':'" . $row->plugin . "'});\n\t});";
        $js .= "\n\t\tfunction submitbutton(pressbutton) {\n\t\t\tvar form = document.adminForm;\n\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\tsubmitform( pressbutton);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// do field validation\n\t\t\tif (\$('plugin').get('value') == '') {\n\t\t\t\talert( '" . JText::_('YOU MUST SELECT A PLUGIN.', true) . "');\n\t\t\t} else if (\$('label').get('value')  == '') {\n\t\t\t\talert( '" . JText::_('PLEASE ENTER A LABEL', true) . "');\n\t\t\t} else {\n\t\t\t\tsubmitform( pressbutton);\n\t\t\t}\n\t\t}";
        $document->addScriptDeclaration($js);
        $generalParams = $form->render('params', 'layout');
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm">
			<table style="width:100%;">
		 		<tr>
	 			<td  valign="top" style="width:50%;">
	 			<fieldset class="adminform">
					<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
	 				<table class="admintable">
	 					<tr>
							<td class="key" width="30%"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
							<td width="70%">
								<input class="inputbox" type="text" name="label" id="label"" size="50" value="<?php 
        echo $row->label;
        ?>
" />
							</td>
						</tr>
					<tr>
						<td class="key">
							<label for="intro_text">
								<?php 
        echo JText::_('INTRO TEXT');
        ?>
							</label>
						</td>
						<td>
							<?php 
        echo $editor->display('intro_text', $row->intro_text, '100%', '200', '50', '5', false);
        ?>
						</td>
					</tr>
						<tr>
							<td class="key">
								<label for=""><?php 
        echo JText::_('PLUGIN');
        ?>
</label>
							</td>
							<td>
								<?php 
        echo $lists['plugins'];
        ?>
							</td>
						</tr>
							<?php 
        foreach ($pluginManager->_plugIns['visualization'] as $oPlugin) {
            $oPlugin->setId($row->id);
            ?>
								<tr>
								<td colspan="2">
									<?php 
            $oPlugin->renderAdminSettings();
            ?>
									</td>
								</tr>
								<?php 
        }
        ?>
							</td>
						</tr>
	 				</table>
	 				</fieldset>
	 			</td>
	 			<td valign="top">
	 				<?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel(JText::_('PUBLISHING'), "publish-page");
        echo $form->render('details');
        echo $generalParams;
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
		 			</td>
		 		</tr>
	 		</table>
	 		<input type="hidden" name="task" value="">
			<input type="hidden" name="option" value="com_fabrik" />
			<input type="hidden" name="c" value="visualization" />
			<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
		</form>
	<?php 
    }
Ejemplo n.º 19
0
 function display($tmpl = 'default')
 {
     FabrikHelperHTML::slimbox();
     $document =& JFactory::getDocument();
     FabrikHelperHTML::packageJS();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model =& $this->getModel();
     $model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
     $this->row =& $model->getVisualization();
     $model->setTableIds();
     $js = $model->getJs();
     $model->getCustomJsAction();
     $this->txt = $model->getText();
     $this->params =& $model->getParams();
     $params =& $model->getPluginParams();
     $this->assignRef('params', $params);
     $tmpl = $params->get('fb_gm_layout', $tmpl);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'googlemap' . DS . 'views' . DS . 'googlemap' . DS . 'tmpl' . DS . $tmpl;
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     FabrikHelperHTML::script('Event.Delegation.js', 'media/com_fabrik/js/', true);
     if ($params->get('fb_gm_center') == 'userslocation') {
         $document->addScript('http://code.google.com/apis/gears/gears_init.js');
         FabrikHelperHTML::script('geo.js', 'components/com_fabrik/libs/geo-location/');
     }
     $this->get('PluginJsClasses');
     $tableplugins = "window.addEvent('domready', function(){\n" . $this->get('PluginJsObjects') . "\n});";
     FabrikHelperHTML::addScriptDeclaration($tableplugins);
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     global $ispda;
     if ($ispda == 1) {
         //pdabot
         $template = 'static';
         $this->assign('staticmap', $this->get('StaticMap'));
     } else {
         //$src = "http://maps.google.com/maps/api/js?sensor=".$params->get('fb_gm_sensor', 'false');
         $uri = JURI::getInstance();
         $src = $uri->getScheme() . "://maps.google.com/maps/api/js?sensor=" . $params->get('fb_gm_sensor', 'false');
         $document->addScript($src);
         FabrikHelperHTML::script('googlemap.js', 'components/com_fabrik/plugins/visualization/googlemap/', true);
         if ($this->params->get('fb_gm_clustering') == 1) {
             $document->addScript('http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/src/markermanager.js');
         } else {
             if ($this->params->get('fb_gm_clustering') == 2) {
                 //$document->addScript('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js');
                 FabrikHelperHTML::script('markerclusterer_packed.js', 'components/com_fabrik/libs/googlemaps/markerclustererplus/src/', true);
             } else {
                 //doesnt work in v3
                 //FabrikHelperHTML::script('markermanager.js', 'components/com_fabrik/libs/googlemaps/', true);
             }
         }
         FabrikHelperHTML::addScriptDeclaration($js);
         $ab_css_file = $tmplpath . DS . 'template.css';
         if (JFile::exists($ab_css_file)) {
             JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/googlemap/views/googlemap/tmpl/' . $tmpl . '/', true);
         }
         $template = null;
     }
     //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 viz template css file overrides template css generic table css and generic custom css
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "googlemap" . DS . "views" . DS . "googlemap" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $this->assign('sidebarPosition', $params->get('fb_gm_use_overlays_sidebar'));
     //if ((int)$params->get('fb_gm_use_overlays', 0) === 1 &&  (int)$params->get('fb_gm_use_overlays_sidebar', 0) > 0) {
     if ($this->get('ShowSideBar')) {
         $this->assign('showSidebar', 1);
         $this->assign('overlayUrls', $params->get('fb_gm_overlay_urls', array(), '_default', 'array'));
         $this->assign('overlayLabels', $params->get('fb_gm_overlay_labels', array(), '_default', 'array'));
     } else {
         $this->assign('showSidebar', 0);
     }
     $this->_setPath('template', $tmplpath);
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('grouptemplates', $this->get('GroupTemplates'));
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }
Ejemplo n.º 20
0
 /**
  * display the template
  *
  * @param sting $tpl
  */
 function display($tpl = null)
 {
     if ($this->getLayout() == '_advancedsearch') {
         $this->advancedSearch($tpl);
         return;
     }
     global $_PROFILER;
     $app =& JFactory::getApplication();
     require_once COM_FABRIK_FRONTEND . DS . 'views' . DS . 'modifiers.php';
     $user =& JFactory::getUser();
     $model =& $this->getModel();
     $document =& JFactory::getDocument();
     //this gets the component settings
     $this->getId();
     $table =& $model->getTable();
     //$model->getPostMethod(); $$$ rob dont think we need it here?
     $model->render();
     $w = new FabrikWorker();
     $data =& $model->getData();
     //add in some styling short cuts
     $c = 0;
     $form =& $model->getForm();
     $nav =& $model->getPagination();
     foreach ($data as $groupk => $group) {
         $last_pk = '';
         $last_i = 0;
         $num_rows = 1;
         foreach (array_keys($group) as $i) {
             $o = new stdClass();
             // $$$ rob moved merge wip code to FabrikModelTable::formatForJoins() - should contain fix for pagination
             $o->data = $data[$groupk][$i];
             $o->cursor = $num_rows + $nav->limitstart;
             $o->total = $nav->total;
             $o->id = "table_" . $table->id . "_row_" . @$o->data->__pk_val;
             $o->class = "fabrik_row oddRow" . $c;
             $data[$groupk][$i] = $o;
             $c = 1 - $c;
             $num_rows++;
         }
     }
     $groups =& $form->getGroupsHiarachy();
     foreach ($groups as $groupModel) {
         $elementModels =& $groupModel->getPublishedElements();
         foreach ($elementModels as $elementModel) {
             $elementModel->setContext($groupModel, $form, $model);
             $col = $elementModel->getFullName(false, true, false);
             $col .= "_raw";
             $rowclass = $elementModel->getParams()->get('use_as_row_class');
             if ($rowclass == 1) {
                 foreach ($data as $groupk => $group) {
                     for ($i = 0; $i < count($group); $i++) {
                         $c = preg_replace('/[^A-Z|a-z|0-9]/', '-', $data[$groupk][$i]->data->{$col});
                         // $$$ rob 24/02/2011 can't have numeric class names so prefix with element name
                         if (is_numeric($c)) {
                             $c = $elementModel->getElement()->name . $c;
                         }
                         $data[$groupk][$i]->class .= " " . $c;
                     }
                 }
             }
         }
     }
     $this->rows =& $data;
     reset($this->rows);
     $firstRow = current($this->rows);
     //cant use numeric key '0' as group by uses groupd name as key
     $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
     $this->nodata = empty($this->rows) || count($this->rows) == 1 && empty($firstRow) || !$this->requiredFiltersFound ? true : false;
     $this->tableStyle = $this->nodata ? 'display:none' : '';
     $this->emptyStyle = $this->nodata ? '' : 'display:none';
     $params =& $model->getParams();
     if (!$model->canPublish()) {
         echo JText::_('SORRY THIS TABLE IS NOT PUBLISHED');
         return false;
     }
     if (!$model->canView()) {
         echo JText::_('ALERTNOTAUTH');
         return false;
     }
     if (!class_exists('JSite')) {
         require_once JPATH_ROOT . DS . 'includes' . DS . 'application.php';
     }
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     //if there is a menu item available AND the form is not rendered in a content plugin or module
     if (is_object($menu) && !$this->_isMambot) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title') || $menu_params->get('show_page_title') == 0) {
             $params->set('page_title', '');
             $params->set('show_page_title', 0);
         } else {
             $params->set('page_title', $menu_params->get('page_title'));
             $params->set('show_page_title', $menu_params->get('show_page_title', 0));
         }
     } else {
         $params->set('show_page_title', JRequest::getInt('show_page_title', 0));
         $params->set('page_title', JRequest::getVar('title', ''));
         $params->set('show-title', JRequest::getInt('show-title', 1));
     }
     if (!$this->_isMambot) {
         $document->setTitle($w->parseMessageForPlaceHolder($params->get('page_title'), $_REQUEST));
     }
     $this->table = new stdClass();
     $this->table->label = $w->parseMessageForPlaceHolder($table->label, $_REQUEST);
     $this->table->intro = $w->parseMessageForPlaceHolder($table->introduction);
     $this->table->id = $table->id;
     $this->table->db_table_name = $table->db_table_name;
     $this->group_by = $table->group_by;
     $this->form = new stdClass();
     $this->form->id = $table->form_id;
     $this->formid = 'tableform_' . $table->id;
     $form =& $model->getForm();
     FabrikHelperHTML::tips('.hasTip', array(), "\$('" . $this->formid . "')");
     $this->table->action = $this->get('TableAction');
     $this->showCSV = $model->canCSVExport();
     $this->showCSVImport = $model->canCSVImport();
     $this->assignRef('navigation', $nav);
     $this->nav = JRequest::getInt('fabrik_show_nav', $params->get('show-table-nav', 1)) ? $nav->getListFooter($model->_id, $this->getTmpl()) : '';
     $this->nav = '<div class="fabrikNav">' . $this->nav . '</div>';
     $this->fabrik_userid = $user->get('id');
     $this->canDelete = $model->deletePossible() ? true : false;
     $jsdelete = "oPackage.submitfabrikTable({$table->id}, 'delete')";
     $this->deleteButton = $model->deletePossible() ? "<input class=\"button\" type=\"button\" onclick=\"{$jsdelete}\" value=\"" . JText::_('DELETE') . "\" name=\"delete\"/>" : '';
     $this->showPDF = $params->get('pdf', 0);
     if ($this->showPDF) {
         $this->pdfLink = FabrikHelperHTML::pdfIcon($model, $params);
     }
     $this->emptyButton = $model->canEmpty() ? "<input class=\"button\" type=\"button\" value=\"" . JText::_('EMPTY') . "\" name=\"doempty\"/>" : "";
     $this->csvImportLink = $this->showCSVImport ? JRoute::_("index.php?option=com_fabrik&c=import&view=import&filetype=csv&tableid=" . $table->id) : '';
     $this->showAdd = $model->canAdd();
     if ($this->showAdd) {
         if ($params->get('show-table-add', 1)) {
             $this->assign('addRecordLink', $this->get('AddRecordLink'));
             $this->assign('addRecordLabel', $this->get('AddRecordLabel'));
         } else {
             $this->showAdd = false;
         }
     }
     $this->assign('addRecordId', "table_" . $model->_id . "_addRecord");
     $this->showRSS = $params->get('rss', 0) == 0 ? 0 : 1;
     if ($this->showRSS) {
         $this->rssLink = $model->getRSSFeedLink();
         if ($this->rssLink != '') {
             $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
             $document->addHeadLink($this->rssLink, 'alternate', 'rel', $attribs);
         }
     }
     list($this->headings, $groupHeadings, $this->headingClass, $this->cellClass) = $this->get('Headings');
     $this->filter_action = $model->getFilterAction();
     JDEBUG ? $_PROFILER->mark('fabrik getfilters start') : null;
     $this->filters =& $model->getFilters('tableform_' . $model->_id, 'table');
     $this->assign('clearFliterLink', $this->get('clearButton'));
     JDEBUG ? $_PROFILER->mark('fabrik getfilters end') : null;
     $form->getGroupsHiarachy();
     $this->assign('showFilters', count($this->filters) > 0 && $params->get('show-table-filters', 1) && JRequest::getVar('showfilters', 1) == 1 ? 1 : 0);
     $this->assign('emptyDataMessage', $this->get('EmptyDataMsg'));
     $this->assignRef('groupheadings', $groupHeadings);
     $this->assignRef('calculations', $this->_getCalculations($this->headings));
     $this->assign('isGrouped', $table->group_by);
     $this->assign('colCount', count($this->headings));
     $this->assignRef('grouptemplates', $model->grouptemplates);
     $this->assignRef('params', $params);
     $this->_loadTemplateBottom();
     $this->getManagementJS($this->rows);
     // get dropdown list of other tables for quick nav in admin
     $this->tablePicker = $app->isAdmin() ? FabrikHelperHTML::tableList($this->table->id) : '';
     $this->pluginButtons = $model->getPluginButtons();
     //force front end templates
     $this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
     $tmpl = $this->getTmpl();
     $this->_setPath('template', $this->_basePath . DS . $this->_name . DS . 'tmpl' . DS . $tmpl);
     $this->setLayout('default');
     // kludge for convincing J! to look for the right files in loadTemplate()
     $text = $this->loadTemplate();
     if ($params->get('process-jplugins')) {
         $opt = JRequest::getVar('option');
         JRequest::setVar('option', 'com_content');
         jimport('joomla.html.html.content');
         $text .= '{emailcloak=off}';
         $text = JHTML::_('content.prepare', $text);
         $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text);
         JRequest::setVar('option', $opt);
     }
     FabrikHelperHTML::cleanMootools();
     JDEBUG ? $_PROFILER->mark('end fabrik display') : null;
     // $$$ rob 09/06/2011 no need for isMambot test? should use ob_start() in module / plugin to capture the output
     echo $text;
 }
Ejemplo n.º 21
0
 /**
  * main setup routine for displaying the form/detail view
  * @param string template
  */
 function display($tpl = null)
 {
     global $_PROFILER;
     $app =& JFactory::getApplication();
     $w = new FabrikWorker();
     $model =& $this->getModel();
     FabrikHelperHTML::mootools();
     $model->setId($this->getId());
     $model->_isMambot = $this->_isMambot;
     $form =& $model->getForm();
     $model->getPostMethod();
     if ($model->render() === false) {
         return false;
     }
     $this->isMultiPage = $model->isMultiPage();
     $tableModel =& $model->getTableModel();
     $table = $tableModel->noTable() ? null : $tableModel->getTable();
     if (!$model->canPublish()) {
         if (!$app->isAdmin()) {
             echo JText::_('SORRY THIS FORM IS NOT PUBLISHED');
             return false;
         }
     }
     $this->assign('access', $model->checkAccessFromTableSettings());
     if ($this->access == 0) {
         return JError::raiseWarning(500, JText::_('ALERTNOTAUTH'));
     }
     //moved under checkAccessFromTableSettings() so that plugins can get form editable state
     list($this->plugintop, $this->pluginbottom, $this->pluginend) = $model->_getFormPluginHTML();
     JDEBUG ? $_PROFILER->mark('form view before join group ids got') : null;
     if (!$tableModel->noTable()) {
         $joins =& $tableModel->getJoins();
         $model->getJoinGroupIds($joins);
     }
     $params =& $model->getParams();
     $this->setTitle($w, $params);
     FabrikHelperHTML::debug($params->get('note'), 'note');
     $params->def('icons', $app->getCfg('icons'));
     $params->set('popup', JRequest::getVar('tmpl') == 'component' ? 1 : 0);
     $this->editable = $model->_editable;
     $form->label = $this->get('label');
     $form->intro = $this->get('Intro');
     $form->action = $this->get('Action');
     $form->formid = $model->_editable ? "form_" . $model->getId() : 'details_' . $model->getId();
     $form->name = "form_" . $model->getId();
     $form->origerror = $form->error;
     $form->error = count($model->_arErrors) > 0 ? $form->error : '';
     $this->_addButtons();
     JDEBUG ? $_PROFILER->mark('form view before validation classes loaded') : null;
     $model->loadValidationRuleClasses();
     JDEBUG ? $_PROFILER->mark('form view before group view got') : null;
     $this->groups =& $model->getGroupView();
     //$this->assignRef('groups', $this->get('GroupView'));
     JDEBUG ? $_PROFILER->mark('form view after group view got') : null;
     $this->assignRef('data', $model->data);
     $this->assignRef('modeldata', $model->_data);
     $this->assignRef('params', $params);
     FabrikHelperHTML::debug($this->groups, 'form:view:groups');
     //cck in admin?
     $this->cck();
     JDEBUG ? $_PROFILER->mark('form view: after cck') : null;
     //force front end templates
     $this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
     $t = $model->_editable ? $form->form_template : $form->view_only_template;
     if ($this->_isMambot) {
         // need to do this otherwise when viewing form in form module and in category/blog content page
         // you get a 500 error regarding layout default not found.
         $form->form_template = JRequest::getVar('flayout', $t);
     } else {
         $form->form_template = JRequest::getVar('layout', $t);
     }
     $tmpl = $form->form_template == '' ? 'default' : $form->form_template;
     if (!JFolder::exists($this->_basePath . DS . $this->_name . DS . 'tmpl' . DS . $tmpl)) {
         $tmpl = 'default';
     }
     $this->_addJavascript($tableModel->getId());
     JDEBUG ? $_PROFILER->mark('form view: after add js') : null;
     $this->_loadTmplBottom($form);
     JDEBUG ? $_PROFILER->mark('form view: after tmpl bottom loaded') : null;
     if ($model->_editable) {
         $form->startTag = "<form action=\"{$form->action}\" class=\"fabrikForm\" method=\"post\" name=\"{$form->name}\" id=\"{$form->formid}\" enctype=\"{$model->getFormEncType()}\">";
         $form->endTag = "</form>";
     } else {
         $form->startTag = '<div class="fabrikForm fabrikDetails" id="' . $form->formid . '">';
         $form->endTag = '</div>';
     }
     $form->endTag .= $this->pluginend;
     $this->assignRef('form', $form);
     JDEBUG ? $_PROFILER->mark('form view: form assigned as ref') : null;
     $table = new stdClass();
     $table->id = $form->record_in_database ? $model->getTableModel()->getTable()->id : 0;
     $this->assignRef('table', $table);
     JDEBUG ? $_PROFILER->mark('form view: before getRelatedTables()') : null;
     $this->assignRef('linkedTables', $this->get('RelatedTables'));
     JDEBUG ? $_PROFILER->mark('form view: after getRelatedTables()') : null;
     $this->setMessage();
     $this->_setPath('template', $this->_basePath . DS . $this->_name . DS . 'tmpl' . DS . $tmpl);
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     JDEBUG ? $_PROFILER->mark('form view before template load') : null;
     $text = $this->loadTemplate();
     if ($params->get('process-jplugins') == 1 || $params->get('process-jplugins') == 2 && $model->_editable === false) {
         $opt = JRequest::getVar('option');
         JRequest::setVar('option', 'com_content');
         jimport('joomla.html.html.content');
         $text .= '{emailcloak=off}';
         $text = JHTML::_('content.prepare', $text);
         $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text);
         JRequest::setVar('option', $opt);
     }
     JDEBUG ? $_PROFILER->mark('form view display end') : null;
     echo $text;
 }
Ejemplo n.º 22
0
    /** 
     * edits a database connection
     * @param object connection
     */
    function edit($row)
    {
        FabrikHelperHTML::mootools();
        FabrikViewConenction::setConnectionToolbar();
        JRequest::setVar('hidemainmenu', 1);
        $app =& JFactory::getApplication();
        $config =& JFactory::getConfig();
        if ($row->id == 1) {
            $app->enqueueMessage(JText::_('THIS IS THE ORIGINAL CONNECTION'));
            if (!($config->getValue('host') == $row->host && $config->getValue('user') == $row->user && $config->getValue('password') == $row->password && $config->getValue('db') == $row->database)) {
                JError::raiseWarning(E_WARNING, JText::_('YOUMUSTSAVETHISCNN'));
            }
            $row->host = $config->getValue('host');
            $row->user = $config->getValue('user');
            $row->password = $config->getValue('password');
            $row->database = $config->getValue('db');
        }
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm"> 
		<div class="col100">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
		<table class="admintable">
		<tbody>
			<tr>
				<td valign="top" class="key">
					<label for="description"><?php 
        echo JText::_('DESCRIPTION');
        ?>
</label>
				</td>
				<td><input class="inputbox" type="text" id="description" name="description" size="75" value="<?php 
        echo $row->description;
        ?>
" /></td>
			</tr>
			<tr>
				<td valign="top" class="key">
					<label for="host"><?php 
        echo JText::_('HOST');
        ?>
</label>
				</td>
				<td><input class="inputbox" type="text" id="host" name="host" size="75" value="<?php 
        echo $row->host;
        ?>
" /></td>
			</tr>
			<tr>
		<td valign="top" class="key">
			<label for="database"><?php 
        echo JText::_('DATABASE');
        ?>
</label>
		</td>
		<td><input class="inputbox" type="text" id="database" name="database" size="75" value="<?php 
        echo $row->database;
        ?>
" /></td>
			</tr> 
			<tr>
				<td valign="top" class="key">
					<label for="user"><?php 
        echo JText::_('USER');
        ?>
</label>
				</td>
				<td><input class="inputbox" type="text" name="user" id="user" size="75" value="<?php 
        echo $row->user;
        ?>
" /></td>
			</tr>
			<?php 
        if ($row->host != "") {
            ?>
				<tr>
				<td valign="top" class="key"><?php 
            echo JText::_('ENTER PASSWORD OR LEAVE AS IS');
            ?>
</td>
				<td></td>
			</tr>	
			<?php 
        }
        ?>
		
			<tr>
				<td valign="top" class="key">
					<label for="password"><?php 
        echo JText::_('PASSWORD');
        ?>
</label>
				</td>
				<td><input class="inputbox" type="password" id="password" name="password" size="20" value="<?php 
        echo $row->password;
        ?>
" /></td>
			</tr>
			<tr>
				<td valign="top" class="key">
					<label for="passwordConf"><?php 
        echo JText::_('CONFIRM PASSWORD');
        ?>
</label>
				</td>
				<td><input class="inputbox" type="password" id="passwordConf" name="passwordConf" size="20" value="<?php 
        echo $row->password;
        ?>
" /></td>
			</tr>			
			<tr>
				<td valign="top" class="key"><label for="state"><?php 
        echo JText::_('PUBLISHED');
        ?>
</label></td>
				<td>
					<input type="checkbox" id="state" name="state" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
				</td>
			</tr>
			<tbody>					
		</table>
		<input type="hidden" name="option" value="com_fabrik" /> 
		<input type="hidden" name="task" value="save" />
		<input type="hidden" name="c" value="connection" /> 
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		</fieldset>
		</div>
		<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
	</form>
<?php 
    }
Ejemplo n.º 23
0
<?php

/**
* @version
* @package Joomla
* @subpackage Fabrik
* @copyright Copyright (C) 2005 Rob Clayburn. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
$defines = JFile::exists(JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'user_defines.php') ? JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'user_defines.php' : JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'defines.php';
require_once $defines;
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php';
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
FabrikHelperHTML::cleanMootools();
Ejemplo n.º 24
0
 function display($tmpl = 'default')
 {
     global $Itemid;
     $app =& JFactory::getApplication();
     JHTML::_('behavior.calendar');
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $plugin =& $pluginManager->getPlugIn('calendar', 'visualization');
     if (FabrikWorker::nativeMootools12()) {
         FabrikHelperHTML::script('Mootools.Lang.js', 'components/com_fabrik/libs/mootools1.2/', true);
         FabrikHelperHTML::script('date.js', 'components/com_fabrik/plugins/element/fabrikdate/', false);
         FabrikHelperHTML::addScriptDeclaration("Date.defineParsers('%d([-./]%m([-./]%Y((T| )%X)?)?)?');");
     }
     FabrikHelperHTML::mocha();
     FabrikHelperHTML::loadCalendar();
     $model =& $this->getModel();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
     $model->setId($id);
     $this->row =& $model->getVisualization();
     $model->setTableIds();
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $calendar =& $model->_row;
     $this->calName = $model->getCalName();
     $config =& JFactory::getConfig();
     $document =& JFactory::getDocument();
     $canAdd = $this->get('CanAdd');
     $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
     if ($canAdd && $this->requiredFiltersFound) {
         $app->enqueueMessage(JText::_('COM_FABRIK_DOUBLE_CLICK_TO_ADD_EVENT'));
     }
     $this->assign('canAdd', $canAdd);
     //FabrikHelperHTML::mocha();
     FabrikHelperHTML::packageJS();
     $fbConfig =& JComponentHelper::getParams('com_fabrik');
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     FabrikHelperHTML::script('element.js', 'media/com_fabrik/js/', true);
     FabrikHelperHTML::script('form.js', 'media/com_fabrik/js/', true);
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     FabrikHelperHTML::script('calendar.js', 'components/com_fabrik/plugins/visualization/calendar/', true);
     $params =& $model->getParams();
     //Get the active menu item
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $urlfilters = JRequest::get('get');
     unset($urlfilters['option']);
     unset($urlfilters['view']);
     unset($urlfilters['controller']);
     unset($urlfilters['Itemid']);
     unset($urlfilters['visualizationid']);
     unset($urlfilters['format']);
     if (empty($urlfilters)) {
         $urlfilters = new stdClass();
     }
     $urls = new stdClass();
     //dont JRoute as its wont load with sef?
     $urls->del = 'index.php?option=com_fabrik&controller=visualization.calendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $id;
     $urls->add = 'index.php?option=com_fabrik&view=visualization&controller=visualization.calendar&format=raw&Itemid=' . $Itemid . '&id=' . $id;
     $user =& JFactory::getUser();
     $legend = $params->get('show_calendar_legend', 0) ? $model->getLegend() : '';
     $tmpl = $params->get('calendar_layout', 'default');
     $pluginManager->loadJS();
     $options = new stdClass();
     $options->url = $urls;
     $options->eventTables =& $model->getEventTables();
     $options->calendarId = $calendar->id;
     $options->popwiny = $params->get('yoffset', 0);
     $options->urlfilters = $urlfilters;
     $options->canAdd = $canAdd;
     $options->tmpl = $tmpl;
     $formView =& $this->_formView;
     $formView->_isMambot = true;
     $o = $model->getAddStandardEventFormInfo();
     if ($o != null) {
         $options->tableid = $o->id;
         $formView->setId($o->form_id);
         $options->formid = $o->form_id;
     }
     $formModel =& $formView->getModel();
     $form =& $formModel->getForm();
     $options->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
     $model->setRequestFilters();
     $options->filters =& $model->filters;
     // end not sure
     $options->Itemid = $Itemid;
     $options->standard_event_form = $params->get('use_standard_event_table', 0) == 1 ? true : false;
     $options->show_day = $params->get('show_day', true);
     $options->show_week = $params->get('show_week', true);
     $options->days = array(JText::_('Sunday'), JText::_('Monday'), JText::_('Tuesday'), JText::_('Wednesday'), JText::_('Thursday'), JText::_('Friday'), JText::_('Saturday'));
     $options->shortDays = array(JText::_('Sun'), JText::_('Mon'), JText::_('Tue'), JText::_('Wed'), JText::_('Thu'), JText::_('Fri'), JText::_('Sat'));
     $options->months = array(JText::_('January'), JText::_('February'), JText::_('March'), JText::_('April'), JText::_('May'), JText::_('June'), JText::_('July'), JText::_('August'), JText::_('September'), JText::_('October'), JText::_('November'), JText::_('December'));
     $options->shortMonths = array(JText::_('Jan'), JText::_('Feb'), JText::_('Mar'), JText::_('Apr'), JText::_('May'), JText::_('Jun'), JText::_('Jul'), JText::_('Aug'), JText::_('Sept'), JText::_('Oct'), JText::_('Nov'), JText::_('Dec'));
     $options->first_week_day = (int) $params->get('first_week_day', 0);
     $options->monthday = new stdClass();
     $options->monthday->width = (int) $params->get('calendar-monthday-width', 90);
     $options->monthday->height = (int) $params->get('calendar-monthday-height', 90);
     $options->greyscaledweekend = $params->get('greyscaled-week-end', 0);
     $options->viewType = $params->get('calendar_default_view', 'month');
     $json = json_encode($options);
     $lang = new stdClass();
     $lang->next = htmlspecialchars(JText::_('Next'));
     $lang->previous = JText::_('Previous');
     $lang->day = JText::_('Day');
     $lang->week = JText::_('Week');
     $lang->month = JText::_('Month');
     $lang->key = htmlspecialchars(JText::_('Key'));
     $lang->today = JText::_('Today');
     $lang->start = JText::_('Start');
     $lang->end = JText::_('End');
     $lang->deleteConf = JText::_('Are you sure you want to delete this?');
     $lang->del = JText::_('delete');
     $lang->view = JText::_('view');
     $lang->edit = JText::_('edit');
     $lang->windowtitle = JText::_('add/edit event');
     $lang = json_encode($lang);
     //$$$ rob - was assigning 'calendar_x' to oPackage.blocks,
     // but now assigning as 'visualization_x' to enable filter clear link
     $str = "window.addEvent('domready', function(e) {\n" . "  //var m = new MochaUI.Modal();\n" . "  {$this->calName} = new fabrikCalendar('calendar_{$calendar->id}');\n" . "  {$this->calName}.render({}, {$json}, {$lang});\n" . "  oPackage.addBlock('vizualization_" . $calendar->id . "', {$this->calName});\n";
     if ($o != null) {
         $str .= "  {$this->calName}.addListenTo('form_{$o->form_id}');\n";
     }
     $fids =& $model->getLinkedFormIds();
     foreach ($fids as $fid) {
         $str .= "  {$this->calName}.addListenTo('form_{$fid}');\n";
     }
     $str .= $legend . "\n});\n";
     FabrikHelperHTML::addScriptDeclaration($str);
     $viewName = $this->getName();
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     $tmpl = $pluginParams->get('calendar_layout', $tmpl);
     $tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'calendar' . DS . 'views' . DS . 'calendar' . 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/calendar/views/calendar/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 . "calendar" . DS . "views" . DS . "calendar" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }
Ejemplo n.º 25
0
    function edit($row, $pluginManager, $lists, $params, $form)
    {
        JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, '');
        FabrikViewElement::setElementToolbar();
        FabrikViewElement::editJs($row, $pluginManager, $lists, $params);
        jimport('joomla.html.pane');
        $pane =& JPane::getInstance();
        $fbConfig =& JComponentHelper::getParams('com_fabrik');
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        JRequest::setVar('hidemainmenu', 1);
        $document =& JFactory::getDocument();
        if ($fbConfig->get('fbConf_wysiwyg_label', false)) {
            $editor =& FabrikHelperHTML::getEditor();
        }
        ?>
<form action="index.php" method="post" name="adminForm" >
<?php 
        if ($row->parent_id != 0) {
            ?>
	<div id="system-message">
	<dl>
		<dd class="notice">
		<ul>
			<li>
				<?php 
            echo JText::_('THIS ELEMENTS PROPERTIES ARE LINKED TO');
            ?>
:
			</li>
			<li>
				<a href="#" id="swapToParent" class="element_<?php 
            echo $lists['parent']->id;
            ?>
"><?php 
            echo $lists['parent']->label;
            ?>
</a>
			</li>
			<li>
				<label><input id="unlink" name="unlink" id="unlinkFromParent" type="checkbox"> <?php 
            echo JText::_('UNLINK');
            ?>
</label>
			</li>
		</ul>
		</dd>
	</dl>
	</div>
<?php 
        }
        echo JHTML::_('form.token');
        ?>
	<input type="hidden" name="id" value="<?php 
        echo (int) $row->id;
        ?>
" />
<table style="width:100%" id="elementFormTable" >
<tbody>
	<tr>
		<td style="width:50%" valign="top">
			<?php 
        FabrikViewElement::editLeft($row, $lists, $params, $form, $fbConfig);
        FabrikViewElement::editPluginOptions($pluginManager, $lists, $row);
        ?>
		</td>
		<td style="width:50%" valign="top">
		<?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel(JText::_('PUBLISHING'), "publish-page");
        FabrikViewElement::editPublishing($form);
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('TABLE SETTINGS'), "table-page");
        FabrikViewElement::editTableSettings($form);
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('VALIDATIONS'), "validations-page");
        FabrikViewElement::editValidations($form);
        echo $pane->endPanel();
        echo $pane->startPanel(JText::_('JAVASCRIPT'), "javascript-page");
        FabrikViewElement::editJavascript($form);
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
</td>
	</tr>
	</tbody>
</table>
	<input type="hidden" name="task" value="save" />
	<input type="hidden" name="option" value="com_fabrik" />
	<input type="hidden" name="c" value="element" />
	<input type="hidden" name="boxchecked" value="" />
	<input type="hidden" name="redirectto" value="" />
	</form>
		<?php 
        echo JHTML::_('behavior.keepalive');
        FabrikHelperHTML::cleanMootools();
    }
Ejemplo n.º 26
0
    /**
     * Display the form to add or edit a cronjob
     * @param object cronjob
     * @param object parameters from attributes
     * @param array lists
     * @param object pluginmanager
     */
    function edit($row, $params, $lists, &$pluginManager)
    {
        JRequest::setVar('hidemainmenu', 1);
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('admincron.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::tips();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::addScriptDeclaration("\n\t\t\twindow.addEvent('domready', function(e) {\n\t\t\t\tnew adminCron({'sel':'" . $row->plugin . "'});\n\t\t\t});\n\n\t\t\tfunction submitbutton(pressbutton) {\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* do field validation */\n\t\t\t\tif (form.label.value == '') {\n\t\t\t\t\talert( '" . JText::_('PLEASE ENTER A LABEL', true) . "');\n\t\t\t\t} else {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}\n\t\t\t}\n\t\t\t");
        FabrikViewCron::setCronToolbar();
        FabrikHelperHTML::loadCalendar();
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm">
		<div class="col100">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
			<table class="admintable">

				<tr>
					<td class="key"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
					<td><input class="inputbox" type="text" id="label" name="label" size="75" value="<?php 
        echo $row->label;
        ?>
" /></td>
				</tr>

				<tr>
					<td class="key"><label for="frequency"><?php 
        echo JText::_('EVERY');
        ?>
</label></td>
					<td><input class="inputbox" type="text" id="frequency" name="frequency" size="4" value="<?php 
        echo $row->frequency;
        ?>
" /></td>
				</tr>

				<tr>
					<td class="key"><label for="unit"><?php 
        echo JText::_('UNIT');
        ?>
</label></td>
					<td><?php 
        echo $lists['unit'];
        ?>
</td>
				</tr>

				<tr>
					<td class="key"><label for="lastrun"><?php 
        echo JText::_('STARTING FROM');
        ?>
</label></td>
					<td><?php 
        echo JHTML::calendar($row->lastrun, 'lastrun', 'lastrun', '%Y-%m-%d %H:%M:%S', array('size' => 23));
        ?>
</td>
				</tr>

				<tr>
					<td class="key"><label for="state"><?php 
        echo JText::_('PUBLISHED');
        ?>
</label></td>
					<td>
					<input type="checkbox" id="state" name="state" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td colspan="2">
					<?php 
        echo stripslashes($params->render());
        ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for=""><?php 
        echo JText::_('PLUGIN');
        ?>
</label>
					</td>
					<td>
						<?php 
        echo $lists['plugins'];
        ?>
					</td>
				</tr>
				<?php 
        foreach ($pluginManager->_plugIns['cron'] as $oPlugin) {
            $oPlugin->setId($row->id);
            ?>
					<tr>
					<td colspan="2">
						<?php 
            $oPlugin->renderAdminSettings();
            ?>
						</td>
					</tr>
					<?php 
        }
        ?>
			</table>
			</fieldset>
				<input type="hidden" name="option" value="com_fabrik" />
				<input type="hidden" name="c" value="cron" />
				<input type="hidden" name="task" />
				<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			</div>
			<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
		</form>
	<?php 
    }
Ejemplo n.º 27
0
    /**
     * Display the form to add or edit a group
     * @param object group
     * @param object parameters from attributes
     */
    function edit($row, $params)
    {
        $document =& JFactory::getDocument();
        JRequest::setVar('hidemainmenu', 1);
        FabrikHelperHTML::tips();
        FabrikViewGroup::setGroupToolbar();
        FabrikHelperHTML::cleanMootools();
        $js = "function submitbutton(pressbutton) {\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (form.name.value == '') {\n\t\t\t\t\talert( '" . JText::_('PLEASE ENTER A NAME', true) . "');\n\t\t\t\t} else {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}\n\t\t\t}";
        $document->addScriptDeclaration($js);
        ?>
		<form action="index.php" method="post" name="adminForm">
		<div class="col100">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
			<table class="admintable">
				<tr>
					<td class="key"><label for="name"><?php 
        echo JText::_('NAME');
        ?>
:</label></td>
					<td><input class="inputbox" type="text" id="name" name="name" size="75" value="<?php 
        echo $row->name;
        ?>
" /></td>
				</tr>
				<tr>
					<td class="key"><label for="label"><?php 
        echo JText::_('TITLE');
        ?>
:</label></td>
					<td><input class="inputbox" type="text" id="label" name="label" size="75" value="<?php 
        echo $row->label;
        ?>
" /></td>
				</tr>
				<tr>
					<td class="key"><label for="css"><?php 
        echo JText::_('CSS');
        ?>
:</label></td>
					<td> <textarea rows="8" cols="72" id="css" name="css" class="inputbox"><?php 
        echo $row->css;
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td colspan="2">
				<?php 
        echo stripslashes($params->render());
        ?>
					</td>
				</tr>
			</table>
			</fieldset>
			 <fieldset class="adminform">
				<legend><?php 
        echo JText::_('PAGINATION');
        ?>
</legend>
			<?php 
        echo $params->render('params', 'pagination');
        ?>
				<input type="hidden" name="option" value="com_fabrik" />
				<input type="hidden" name="c" value="group" />
				<input type="hidden" name="task" />
				<input type="hidden" name="is_join" value="<?php 
        echo $row->is_join;
        ?>
" />
				<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			</fieldset>
			</div>
			<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
		</form>
	<?php 
    }
Ejemplo n.º 28
0
    /**
     * Display the form to add or edit a package
     * @param object package
     * @param object parameters from attributes
     * @param array lists
     */
    function edit($row, $tables, $lists)
    {
        FabrikHelperHTML::mootools();
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        JRequest::setVar('hidemainmenu', 1);
        jimport('joomla.html.pane');
        $pane =& JPane::getInstance();
        FabrikViewPackage::setPackageToolbar();
        FabrikHelperHTML::script('adminpackage.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::cleanMootools();
        ?>
 
		<form action="index.php" method="post" name="adminForm">
		<table style="width:100%;">
		 	<tr>
	 			<td style="width:50%;" valign="top">
	 			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
				<table class="admintable"> 
					<tr>
						<td class="key">
						<label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label>
						</td>
						<td><input class="inputbox" type="text" id="label" name="label" size="30" value="<?php 
        echo $row->label;
        ?>
" /></td>
					</tr>
					<tr>
						<td class="key" valign="top"  style="text-align:right">
						<label for="state"><?php 
        echo JText::_('PUBLISHED');
        ?>
</label>
						</td>
						<td>
						<input type="checkbox" id="state" name="state" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
						</td>
					</tr>
					<tr>
						<td class="key" valign="top"  style="text-align:right">
							<label for="template"><?php 
        echo JText::_('TEMPLATE');
        ?>
</label>
						</td>
						<td>
						<?php 
        echo $lists['template'];
        ?>
						</td>
					</tr>
				</table>
				</fieldset>
				<fieldset class="adminform">
				<legend><?php 
        echo JText::_('TABLES');
        ?>
</legend>
				
				<table class="admintable"> 
					
					<?php 
        foreach ($tables as $table) {
            ?>
					<tr class="packageTable" >
						<td><?php 
            echo $table;
            ?>
</td>
						<td style="width:5em"><a href="#" class="addButton"><?php 
            echo JText::_('ADD');
            ?>
</a></td>
						<td><a href="#" class="removeButton"><?php 
            echo JText::_('DELETE');
            ?>
</a></td>
					</tr> 
					<?php 
        }
        ?>
				</table>
				</fieldset>
				</td>
				<td style="width:50%;"  valign="top">
			
				<?php 
        echo $pane->endPanel();
        echo $pane->endPane();
        ?>
				</td>
			</tr>
		</table>
		<input type="hidden" name="option" value="com_fabrik" /> 
		<input type="hidden" name="c" value="package" />
		<input type="hidden" name="task" value="savePackage" /> 
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" /> 	
		<input type="hidden" name="cid[]" value="<?php 
        echo $row->id;
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
	</form>
	<?php 
    }
Ejemplo n.º 29
0
 function display($tmpl = 'default')
 {
     $document =& JFactory::getDocument();
     FabrikHelperHTML::packageJS();
     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('js', $this->get('JS'));
     $viewName = $this->getName();
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $plugin =& $pluginManager->getPlugIn('slideshow', 'visualization');
     $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams =& $model->getPluginParams();
     $this->assignRef('params', $pluginParams);
     $tmpl = $pluginParams->get('slideshow_viz_layout', $tmpl);
     JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     $tmplpath = $model->pathBase . 'slideshow' . DS . 'views' . DS . 'slideshow' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     if ($this->get('RequiredFiltersFound')) {
         FabrikHelperHTML::script('slideshow.js', 'components/com_fabrik/libs/slideshow2/js/', true);
         $slideshow_viz_type = $pluginParams->get('slideshow_viz_type', 1);
         switch ($slideshow_viz_type) {
             case 1:
                 break;
             case 2:
                 FabrikHelperHTML::script('slideshow.kenburns.js', 'components/com_fabrik/libs/slideshow2/js/', true);
                 break;
             case 3:
                 FabrikHelperHTML::script('slideshow.push.js', 'components/com_fabrik/libs/slideshow2/js/', true);
                 break;
             case 4:
                 FabrikHelperHTML::script('slideshow.fold.js', 'components/com_fabrik/libs/slideshow2/js/', true);
                 break;
             default:
                 break;
         }
         JHTML::stylesheet('slideshow.css', 'components/com_fabrik/libs/slideshow2/css/');
         FabrikHelperHTML::script('slideshow.js', 'components/com_fabrik/plugins/visualization/slideshow/', true);
     }
     FabrikHelperHTML::addScriptDeclaration($this->js);
     $ab_css_file = $tmplpath . DS . "template.css";
     if (JFile::exists($ab_css_file)) {
         JHTML::stylesheet('template.css', $this->srcBase . 'slideshow/views/slideshow/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 . "slideshow" . DS . "views" . DS . "slideshow" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     //ensure we don't have an incorrect version of mootools loaded
     FabrikHelperHTML::cleanMootools();
     echo parent::display();
 }