當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FabrikHelperHTML::packageJS方法代碼示例

本文整理匯總了PHP中FabrikHelperHTML::packageJS方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::packageJS方法的具體用法?PHP FabrikHelperHTML::packageJS怎麽用?PHP FabrikHelperHTML::packageJS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FabrikHelperHTML的用法示例。


在下文中一共展示了FabrikHelperHTML::packageJS方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display

 function display($tmpl = 'default')
 {
     FabrikHelperHTML::packageJS();
     $model =& $this->getModel();
     $usersConfig =& JComponentHelper::getParams('com_fabrik');
     $model->setId(array('id' => JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))), 'package_id' => JRequest::getVar('package_id')));
     $visualization =& $model->getVisualization();
     $pluginParams =& $model->getPluginParams();
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $plugin =& $pluginManager->getPlugIn($visualization->plugin, 'visualization');
     $plugin->_row = $visualization;
     if ($visualization->state == 0) {
         return JError::raiseWarning(500, JText::_('SORRY THIS VISUALIZATION IS UNPUBLISHED'));
     }
     //plugin is basically a model
     $pluginTask = JRequest::getVar('plugintask', 'render', 'request');
     $plugin->_params = $pluginParams;
     $tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
     $plugin->{$pluginTask}($this);
     $this->plugin =& $plugin;
     $viewName = $this->getName();
     $this->_setPath('template', $this->_basePath . DS . 'plugins' . DS . $this->_name . DS . $plugin->_name . DS . 'tmpl' . DS . $tmpl);
     $ab_css_file = JPATH_SITE . "/components/com_fabrik/plugins/" . $viewName . "/" . $plugin->_name . "/tmpl/{$tmpl}/template.css";
     if (file_exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/' . $viewName . '/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
     }
     $model->getCustomJsAction();
     if (isset($this->_isMambot) && $this->_isMambot) {
         return $this->loadTemplate();
     } else {
         parent::display();
     }
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:33,代碼來源:view.html.php

示例2: display

 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();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:29,代碼來源:view.html.php

示例3: display

 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();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:35,代碼來源:view.html.php

示例4: display

 function display($tmpl = 'default')
 {
     JHTML::_('behavior.calendar');
     FabrikHelperHTML::packageJS();
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/');
     FabrikHelperHTML::script('advanced-search.js', 'media/com_fabrik/js/');
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
     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();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:54,代碼來源:view.html.php

示例5: display

    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);
    }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:49,代碼來源:view.html.php

示例6: getFilters

 /**
  * get all table models filters
  * @return array table filters
  */
 function getFilters()
 {
     FabrikHelperHTML::packageJS();
     $params =& $this->getParams();
     $tableModels =& $this->getTableModels();
     $filters = array();
     foreach ($tableModels as $tableModel) {
         $filters[$tableModel->getTable()->label] = $tableModel->getFilters($this->getContainerId(), 'vizualization', $this->_row->id);
     }
     $this->getRequireFilterMsg();
     return $filters;
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:16,代碼來源:visualization.php

示例7: getManagementJS

 protected function getManagementJS($data = array())
 {
     global $Itemid;
     // $$$ rob ALWAYS load the calendar (so its avaible in ajax forms)
     FabrikHelperHTML::loadcalendar();
     $app =& JFactory::getApplication();
     $model =& $this->getModel();
     $table =& $model->getTable();
     $formModel =& $model->getForm();
     $elementsNotInTable =& $formModel->getElementsNotInTable();
     $keys = array('id' => '', 'name' => '', 'label' => '');
     foreach ($elementsNotInTable as &$i) {
         if (is_a($i, 'TableElement')) {
             $i = array_intersect_key($i->getPublicProperties(), $keys);
         }
     }
     FabrikHelperHTML::packageJS();
     $document =& JFactory::getDocument();
     if ($model->requiresSlimbox()) {
         FabrikHelperHTML::slimbox();
     }
     if ($model->requiresMocha()) {
         FabrikHelperHTML::mocha();
     }
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     $tmpl = $this->getTmpl();
     FabrikHelperHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     // check for a custom css file and include it if it exists
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "template.css");
     //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 table template css file overrides template css generic table css and generic custom css
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     // check for a custom js file and include it if it exists
     $aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
     if (JFile::exists($aJsPath)) {
         FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/', true);
     }
     $origRows = $this->rows;
     $this->rows = array(array());
     $tmpItemid = !isset($Itemid) ? 0 : $Itemid;
     $this->_c = 0;
     $this->_row = new stdClass();
     $script = '';
     // $$$ rob done in HTMLHelper
     //$script = "/* <![CDATA[ */ \n";
     static $tableini;
     if (!$tableini) {
         $tableini = true;
         $script .= "var oTables = \$H();\n";
     }
     $opts = new stdClass();
     $opts->admin = $app->isAdmin();
     $opts->postMethod = $model->getPostMethod();
     $opts->filterMethod = $this->filter_action;
     $opts->form = 'tableform_' . $model->_id;
     $opts->headings = $model->_jsonHeadings();
     $labels = $this->headings;
     foreach ($labels as &$l) {
         $l = strip_tags($l);
     }
     $opts->labels = $labels;
     $opts->primaryKey = $table->db_primary_key;
     $opts->Itemid = $tmpItemid;
     $opts->formid = $model->_oForm->getId();
     $opts->canEdit = $model->canEdit() ? "1" : "0";
     $opts->canView = $model->canView() ? "1" : "0";
     $opts->page = JRoute::_('index.php');
     $opts->isGrouped = $this->isGrouped;
     $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
     if (FabrikWorker::nativeMootools12()) {
         $opts->mooversion = 1.24;
     }
     $opts->formels = $elementsNotInTable;
     //if table data starts as empty then we need the html from the row
     // template otherwise we can't add a row to the table
     if ($model->_postMethod == 'ajax') {
         ob_start();
         $this->_row = new stdClass();
         $this->_row->id = '';
         $this->_row->class = 'fabrik_row';
         require COM_FABRIK_FRONTEND . DS . 'views' . DS . 'table' . DS . 'tmpl' . DS . 'default' . DS . 'default_row.php';
         $opts->rowtemplate = ob_get_contents();
         ob_end_clean();
     }
     //$$$rob if you are loading a table in a window from a form db join select record option
     // then we want to know the id of the window so we can set its showSpinner() method
     $opts->winid = JRequest::getVar('winid', '');
     $opts->ajaxEditViewLink = $model->ajaxEditViewLink() ? 1 : 0;
     $opts = json_encode($opts);
     $lang = new stdClass();
     $lang->select_rows = JText::_('SELECT SOME ROWS FOR DELETION');
     $lang->yes = JText::_('Yes');
     $lang->no = JText::_('No');
     $lang->select_colums_to_export = JText::_('SELECT_COLUMNS_TO_EXPORT');
     $lang->include_filters = JText::_('INCLUDE_FILTERS');
     $lang->include_data = JText::_('INCLUDE_DATA');
     $lang->inlcude_raw_data = JText::_('INCLUDE_RAW_DATA');
     $lang->include_calculations = JText::_('INLCUDE_CALCULATIONS');
     $lang->export = JText::_('EXPORT');
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:view.html.php

示例8: display

 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');
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:view.html.php

示例9: _addJavascript

 /**
  * append the form javascript into the document head
  * @param int table id
  */
 function _addJavascript($tableId)
 {
     // $$$ rob ALWAYS load the calendar (so its avaible in ajax forms)
     FabrikHelperHTML::loadcalendar();
     $app =& JFactory::getApplication();
     $document =& JFactory::getDocument();
     $model =& $this->getModel();
     $aLoadedElementPlugins = array();
     $jsActions = array();
     $jsControllerKey = $model->_editable ? 'form_' . $model->getId() : 'details_' . $model->getId();
     $allJsActions = $model->getJsActions();
     FabrikHelperHTML::packageJS();
     if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
         define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
         FabrikHelperHTML::slimbox();
         FabrikHelperHTML::script('form.js', 'media/com_fabrik/js/', true);
         FabrikHelperHTML::script('element.js', 'media/com_fabrik/js/', true);
     }
     $aWYSIWYGNames = array();
     // $$$ hugh - yeat another one where if we =&, the $groups array pointer get buggered up and it
     // skips a group
     $groups = $model->getGroupsHiarachy();
     foreach ($groups as $groupModel) {
         $elementModels =& $groupModel->getPublishedElements();
         foreach ($elementModels as $elementModel) {
             $res = $elementModel->useEditor();
             if ($res !== false) {
                 $aWYSIWYGNames[] = $res;
             }
             $eparams =& $elementModel->getParams();
             //load in once the element js class files
             // $$$ hugh - only needed getParent when we weren't saving changes to parent params to child
             // which we should now be doing ... and getParent() causes an extra table lookup for every child
             // element on the form.
             //$element =& $elementModel->getParent();
             $element =& $elementModel->getElement();
             if (!in_array($element->plugin, $aLoadedElementPlugins)) {
                 $aLoadedElementPlugins[] = $element->plugin;
                 $elementModel->formJavascriptClass();
             }
             $eventMax = $groupModel->_repeatTotal == 0 ? 1 : $groupModel->_repeatTotal;
             for ($c = 0; $c < $eventMax; $c++) {
                 $jsActions[] = $elementModel->getFormattedJSActions($allJsActions, $jsControllerKey, $c);
             }
         }
     }
     //new
     $actions = trim(implode("\n", $jsActions));
     //end new
     $params =& $model->getParams();
     $tableModel =& $model->getTableModel();
     $table =& $tableModel->getTable();
     $form =& $model->getForm();
     FabrikHelperHTML::mocha();
     $bkey = $model->_editable ? 'form_' . $model->getId() : 'details_' . $model->getId();
     FabrikHelperHTML::tips('.hasTip', array(), "\$('{$bkey}')");
     $key = FabrikString::safeColNameToArrayKey($table->db_primary_key);
     $this->get('FormCss');
     $this->get('CustomJsAction');
     //$startJs = "window.addEvent('domready', function() {\n";
     $startJs = "window.addEvent('" . FabrikHelperHTML::useLoadEvent() . "', function() {\n";
     $endJs = "});\n";
     $start_page = isset($model->sessionModel->last_page) ? (int) $model->sessionModel->last_page : 0;
     if ($start_page !== 0) {
         $app->enqueueMessage(JText::_('RESTARTINGMUTLIPAGEFORM'));
     } else {
         // form submitted but fails validation - needs to go to the last page
         $start_page = JRequest::getInt('currentPage', 0);
     }
     $opts = new stdClass();
     $opts->admin = $app->isAdmin();
     $opts->postMethod = $this->get('PostMethod');
     $opts->ajaxValidation = $params->get('ajax_validations');
     $opts->primaryKey = $key;
     $opts->liveSite = COM_FABRIK_LIVESITE;
     $opts->error = @$form->origerror;
     $opts->pages = $model->getPages();
     $opts->plugins = array();
     $opts->multipage_save = (bool) $model->saveMultiPage();
     $opts->editable = $model->_editable;
     $opts->start_page = $start_page;
     $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
     //$$$rob dont int this as keys may be string
     $opts->rowid = $model->_rowId;
     //$$$rob if you are loading a table in a window from a form db join select record option
     // then we want to know the id of the window so we can set its showSpinner() method
     $opts->winid = JRequest::getVar('winid', '');
     //for editing groups with joined data and an empty joined record (ie no joined records)
     $hidden = array();
     $maxRepeat = array();
     $showMaxRepeats = array();
     $postedRepeatGroupCounts = (array) JRequest::getVar('fabrik_repeat_group');
     foreach ($this->groups as $g) {
         $hidden[$g->id] = $g->startHidden;
         if (JArrayHelper::getValue($postedRepeatGroupCounts, $g->id, 1) == 0) {
             $hidden[$g->id] = true;
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:view.html.php

示例10: display

 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();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:62,代碼來源:view.html.php

示例11: generalIncludes

 /**
  * load the required fabrik files
  *
  * @param string $view
  */
 function generalIncludes($view)
 {
     $view = trim($view);
     require_once COM_FABRIK_FRONTEND . DS . 'controller.php';
     require_once COM_FABRIK_FRONTEND . DS . 'controllers' . DS . 'form.php';
     require_once COM_FABRIK_FRONTEND . DS . 'controllers' . DS . 'package.php';
     require_once COM_FABRIK_FRONTEND . DS . 'controllers' . DS . 'table.php';
     require_once COM_FABRIK_FRONTEND . DS . 'controllers' . DS . 'visualization.php';
     require_once COM_FABRIK_FRONTEND . DS . 'models' . DS . 'parent.php';
     JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_fabrik' . DS . 'tables');
     JModel::addIncludePath(COM_FABRIK_FRONTEND . DS . 'models');
     if ($view == 'details') {
         $view = 'form';
     }
     if ($view == '') {
         JError::raiseError(500, 'Please specify a view in your fabrik {} code');
     }
     //$$$rob looks like including the view does something to the layout variable
     $layout = JRequest::getVar('layout');
     require_once COM_FABRIK_FRONTEND . DS . 'views' . DS . $view . DS . 'view.html.php';
     JRequest::setVar('layout', $layout);
     FabrikHelperHTML::packageJS();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:28,代碼來源:fabrik.php

示例12: getManagementJS

 function getManagementJS($data = array())
 {
     global $Itemid;
     $app =& JFactory::getApplication();
     $model =& $this->getModel();
     $table =& $model->getTable();
     FabrikHelperHTML::packageJS();
     $document =& JFactory::getDocument();
     FabrikHelperHTML::slimbox();
     FabrikHelperHTML::mocha();
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     $tmpl = JRequest::getVar('layout', $table->template);
     // check for a custom css file and include it if it exists
     $ab_css_file = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "template.css";
     if (file_exists($ab_css_file)) {
         JHTML::stylesheet('template.css', 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/');
     }
     // check for a custom js file and include it if it exists
     $aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
     if (file_exists($aJsPath)) {
         FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/', true);
     }
     // temporarily set data to load requierd info for js templates
     $origRows = $this->rows;
     $this->rows = array(array());
     $tmpItemid = !isset($Itemid) ? 0 : $Itemid;
     $this->_c = 0;
     $this->_row = new stdClass();
     $script = '';
     static $tableini;
     if (!$tableini) {
         $tableini = true;
         $script .= "var oTables = \$H();\n";
     }
     $opts = new stdClass();
     $opts->admin = $app->isAdmin();
     $opts->postMethod = $model->getPostMethod();
     $opts->filterMethod = $this->filter_action;
     $opts->form = 'tableform_' . $model->getId();
     $opts->headings = $model->_jsonHeadings();
     $opts->labels = $this->headings;
     $opts->primaryKey = $table->db_primary_key;
     $opts->data = $data;
     $opts->Itemid = $tmpItemid;
     $opts->formid = $model->_oForm->getId();
     $opts->canEdit = $model->canEdit() ? "1" : "0";
     $opts->canView = $model->canView() ? "1" : "0";
     $opts->page = JRoute::_('index.php');
     $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
     $opts = json_encode($opts);
     $lang = new stdClass();
     $lang->select_rows = JText::_('SELECT SOME ROWS FOR DELETION');
     $lang = json_encode($lang);
     $script .= "\n" . "var oTable = new fabrikTable(" . $model->getId() . ",";
     $script .= $opts . "," . $lang;
     $script .= "\n" . ");";
     $script .= "\n" . "oTable.addListenTo('form_" . $model->_oForm->getId() . "');";
     $script .= "\n" . "oTable.addListenTo('table_" . $model->getId() . "');";
     $script .= "\n" . "oPackage.addBlock('table_" . $model->getId() . "', oTable);";
     //add in plugin objects
     $plugins = $this->get('PluginJsObjects');
     $script .= "\noTable{$model->_id}.addPlugins([\n";
     $script .= "  " . implode(",\n  ", $plugins);
     $script .= "]\n);\n";
     $script .= "oTables.set({$model->_id}, oTable);\n";
     FabrikHelperHTML::addScriptDeclaration($script);
     //reset data back to original settings
     $this->rows = $origRows;
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:69,代碼來源:view.pdf.php

示例13: display

 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();
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:80,代碼來源:view.html.php


注:本文中的FabrikHelperHTML::packageJS方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。