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


PHP FabrikHelperHTML::addScriptDeclaration方法代碼示例

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


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

示例1: getBottomContent

 /**
  * set up the html to be injected into the bottom of the form
  *
  * @param object $params (no repeat counter stuff needed here as the plugin manager
  * which calls this function has already done the work for you
  */
 function getBottomContent(&$params, &$formModel)
 {
     $user =& JFactory::getUser();
     if ($user->get('id') == 0) {
         $this->html = JText::_('PLG_CRON_NOTIFICATION_SIGN_IN_TO_RECEIVE_NOTIFICATIONS');
         return;
     }
     $opts = new stdClass();
     $opts->tableid = $formModel->getTableModel()->_id;
     $opts->fabrik = $formModel->_id;
     $opts->rowid = $formModel->_rowId;
     $opts->senderBlock = JRequest::getCmd('view') == 'form' ? 'form_' : 'details_';
     $opts->senderBlock .= $formModel->_id;
     $opts = json_encode($opts);
     $id = uniqid('fabrik_notification');
     if ($params->get('notification_ajax', 0) == 1) {
         FabrikHelperHTML::script('javascript.js', 'components/com_fabrik/plugins/form/fabriknotification/', true);
         $script = "window.addEvent('domready', function() {\n\t\t\t\tvar notify = new Notify('{$id}', {$opts});\n \t\t\t});";
         FabrikHelperHTML::addScriptDeclaration($script);
     }
     //see if the checkbox should be checked
     $db =& JFactory::getDBO();
     $ref = $this->getRef($formModel->getTableModel()->_id);
     $db->setQuery("SELECT COUNT(id) FROM #__fabrik_notification WHERE user_id = " . (int) $user->get('id') . " AND reference = {$ref}");
     $found = $db->loadResult();
     $checked = $found ? "checked=\"checked\"" : "";
     $this->html = "\n\t\t<label><input id=\"{$id}\" {$checked} type=\"checkbox\" name=\"fabrik_notification\" class=\"input\" value=\"1\"  />\n\t\t " . JText::_('NOTIFY_ME') . "</label>";
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:34,代碼來源:fabriknotification.php

示例2: getBottomContent

	/**
	 * set up the html to be injected into the bottom of the form
	 *
	 * @param object $params (no repeat counter stuff needed here as the plugin manager
	 * which calls this function has already done the work for you
	 */

	function getBottomContent(&$params, &$formModel)
	{
		$user = JFactory::getUser();
		if ($user->get('id') == 0) {
			$this->html = JText::_('PLG_CRON_NOTIFICATION_SIGN_IN_TO_RECEIVE_NOTIFICATIONS');
			return;
		}
		$opts = new stdClass();
		$opts->listid = $formModel->getListModel()->_id;
		$opts->fabrik = $formModel->_id;
		$opts->rowid = $formModel->_rowId;
		$opts->senderBlock = JRequest::getCmd('view') == 'form' ? 'form_' : 'details_';
		$opts->senderBlock .= $formModel->_id;
		$opts = json_encode($opts);
		$id = uniqid('fabrik_notification');
		if ($params->get('notification_ajax', 0) == 1) {
			FabrikHelperHTML::script('components/com_fabrik/plugins/form/fabriknotification/javascript.js', true);
			$script = "head.ready(function() {
				var notify = new Notify('$id', $opts);
 			});";

			FabrikHelperHTML::addScriptDeclaration($script);
		}
		//see if the checkbox should be checked
		$db = FabrikWorker::getDbo();
		$ref =$this->getRef($formModel->getListModel()->_id);
		$db->setQuery("SELECT COUNT(id) FROM #__{package}_notification WHERE user_id = ".(int)$user->get('id') . " AND reference = $ref");
		$found = $db->loadResult();
		$checked = $found ? "checked=\"checked\"" : "";
		$this->html = "
		<label><input id=\"$id\" $checked type=\"checkbox\" name=\"fabrik_notification\" class=\"input\" value=\"1\"  />
		 ".JText::_('PLG_CRON_NOTIFICATION_NOTIFY_ME') . "</label>";
	}
開發者ID:Jobar87,項目名稱:fabrik,代碼行數:40,代碼來源:notification.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

 /**
  * Display
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     FabrikHelperHTML::framework();
     $app = JFactory::getApplication();
     $input = $app->input;
     $state = $this->get('State');
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $srcs = array('media/com_fabrik/js/icons.js', 'media/com_fabrik/js/icongen.js', 'media/com_fabrik/js/canvas.js', 'media/com_fabrik/js/history.js', 'media/com_fabrik/js/keynav.js', 'media/com_fabrik/js/tabs.js', 'media/com_fabrik/js/pages.js', 'media/com_fabrik/js/frontpackage.js');
     FabrikHelperHTML::script($srcs);
     FabrikHelperHTML::stylesheet('media/com_fabrik/css/package.css');
     $canvas = $item->params->get('canvas');
     // $$$ rob 08/11/2011 test if component name set but still rendering
     // in option=com_fabrik then we should use fabrik as the package
     if ($input->get('option') === 'com_fabrik') {
         $item->component_name = 'fabrik';
     }
     $opts = JArrayHelper::getvalue($canvas, 'options', array());
     $tabs = JArrayHelper::getValue($canvas, 'tabs', array('Page 1'));
     $tabs = json_encode($tabs);
     $d = new stdClass();
     $layout = JArrayHelper::getValue($canvas, 'layout', $d);
     $layout = json_encode(JArrayHelper::getValue($canvas, 'layout', $d));
     $id = $this->get('State')->get('package.id');
     $script = "window.addEvent('fabrik.loaded', function() {\n\t\t\tnew FrontPackage({\n\t\ttabs : {$tabs},\n\t\ttabelement : 'packagemenu',\n\t\tpagecontainer : 'packagepages',\n\t\tlayout: {$layout},\n\t\t'packageId': {$id},\n\t\t'package':'{$item->component_name}'\n\t});\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($script);
     // Force front end templates
     $this->_basePath = COM_FABRIK_FRONTEND . '/views';
     $tmpl = !isset($item->template) ? 'default' : $item->template;
     $this->addTemplatePath($this->_basePath . '/' . $this->_name . '/tmpl/' . $tmpl);
     $text = $this->loadTemplate();
     FabrikHelperHTML::runConentPlugins($text);
     echo $text;
 }
開發者ID:ppantilla,項目名稱:bbninja,代碼行數:41,代碼來源:view.html.php

示例5: dolist

 /**
  * list of items
  *
  * @return  null
  */
 public function dolist()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $db = FabrikWorker::getDbo(true);
     $query = $db->getQuery(true);
     $list = $input->get('list', 'form');
     $selected = $input->get('selected');
     $query->select('id, label')->from('#__fabrik_' . $list . 's');
     if ($selected != '') {
         // $query->where('id NOT IN ('.$selected.')');
     }
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     echo "<ul id=\"{$list}-additems\">";
     if (empty($rows)) {
         echo "<li>" . JText::sprintf('COM_FABRIK_NO_FREE_ITEMS_FOUND') . "</li>";
     } else {
         foreach ($rows as $row) {
             echo "<li><a href=\"#\" id=\"{$row->id}\">{$row->label}</a>";
         }
     }
     echo "</ul>";
     $script = "\$('{$list}-additems').getElements('a').addEvent('click', function(e){\n\t\t\tFabrik.fireEvent('fabrik.package.item.selected', [e]);\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($script);
 }
開發者ID:LGBGit,項目名稱:tierno,代碼行數:31,代碼來源:package.raw.php

示例6: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 function display($tpl = 'default')
 {
     $srcs = FabrikHelperHTML::framework();
     $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();
     if ($this->get('RequiredFiltersFound')) {
         $model->render();
     }
     $params = $model->getParams();
     $this->assign('params', $params);
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('row', $row);
     $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0);
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams = $model->getPluginParams();
     $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/coverflow/views/coverflow/tmpl/' . $tpl;
     $this->_setPath('template', $tmplpath);
     $srcs[] = 'media/com_fabrik/js/listfilter.js';
     // Assign something to Fabrik.blocks to ensure we can clear filters
     $ref = $model->getJSRenderContext();
     $js = "{$ref} = {};";
     $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});";
     $js .= $model->getFilterJs();
     FabrikHelperHTML::addScriptDeclaration($srcs, $js);
     echo parent::display();
 }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:37,代碼來源:view.html.php

示例7: getBottomContent

    /**
     * Sets up HTML to be injected into the form's bottom
     *
     * @param   object  $params     params
     * @param   object  $formModel  form model
     *
     * @return void
     */
    public function getBottomContent($params, $formModel)
    {
        $user = JFactory::getUser();
        if ($user->get('id') == 0) {
            $this->html = JText::_('PLG_CRON_NOTIFICATION_SIGN_IN_TO_RECEIVE_NOTIFICATIONS');
            return;
        }
        if ($params->get('send_mode') == '1') {
            return;
        }
        $opts = new stdClass();
        $opts->listid = $formModel->getListModel()->getId();
        $opts->formid = $formModel->getId();
        $opts->rowid = $formModel->_rowId;
        $opts->senderBlock = JRequest::getCmd('view') == 'form' ? 'form_' : 'details_';
        $opts->senderBlock .= $formModel->getId();
        $opts = json_encode($opts);
        $id = uniqid('fabrik_notification');
        if ($params->get('notification_ajax', 0) == 1) {
            FabrikHelperHTML::script('components/com_fabrik/plugins/form/notification/notify.js');
            $script = "head.ready(function() {\n\t\t\t\tvar notify = new Notify('{$id}', {$opts});\n \t\t\t});";
            FabrikHelperHTML::addScriptDeclaration($script);
        }
        // See if the checkbox should be checked
        $db = FabrikWorker::getDbo();
        $ref = $this->getRef($formModel->getListModel()->getId());
        $query = $db->getQuery(true);
        $query->select('COUNT(id)')->from('#__{package}_notification')->where('user_id = ' . (int) $user->get('id') . ' AND reference = ' . $ref);
        $db->setQuery($query);
        $found = $db->loadResult();
        $checked = $found ? 'checked="checked"' : '';
        $this->html = '
		<label><input id="' . $id . '" ' . $checked . ' type="checkbox" name="fabrik_notification" class="input" value="1"  />
		 ' . JText::_('PLG_CRON_NOTIFICATION_NOTIFY_ME') . '</label>';
    }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:43,代碼來源:notification.php

示例8: loadJavascriptInstance

 /**
  * return the javascript to create an instance of the class defined in formJavascriptClass
  * @param object parameters
  * @param object table model
  * @param array [0] => string table's form id to contain plugin
  * @return bool
  */
 function loadJavascriptInstance($params, $model, $args)
 {
     $form_id = $args[0];
     $js = trim($params->get('table_js_code'));
     if ($js !== '') {
         FabrikHelperHTML::addScriptDeclaration($js);
     }
     $this->jsInstance = '';
     //script
     $script = $params->get('table_js_file');
     if ($script == '-1') {
         return;
     }
     $className = substr($script, 0, strlen($script) - 3);
     $document =& JFactory::getDocument();
     $id =& $model->getTable()->id;
     $container = 'oTable';
     if (JRequest::getVar('tmpl') != 'component') {
         FabrikHelperHTML::script($script, 'components/com_fabrik/plugins/table/tablejs/scripts/');
     } else {
         // included scripts in the head don't work in mocha window
         // read in the class and insert it into the body as an inline script
         $class = JFile::read(JPATH_BASE . "/components/com_fabrik/plugins/table/tablejs/scripts/{$script}");
         // $$$ rob dont want/need to delay the loading of the class
         //FabrikHelperHTML::addScriptDeclaration($class);
         $document =& JFactory::getDocument();
         $document->addScriptDeclaration($class);
     }
     $this->jsInstance = "new {$className}({$container}{$id})";
     return true;
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:38,代碼來源:tablejs.php

示例9: display

    /**
     * Execute and display a template script.
     *
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
     *
     * @return  mixed  A string if successful, otherwise a JError object.
     */
    function display($tpl = 'default')
    {
        FabrikHelperHTML::framework();
        $app = JFactory::getApplication();
        $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();
        $params = $model->getParams();
        $this->assign('params', $params);
        $pluginParams = $model->getPluginParams();
        $tpl = $pluginParams->get('fb_gm_layout', $tpl);
        $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/kaltura/views/kaltura/tmpl/' . $tpl;
        $js = <<<EOT
\t\t<script type="text/javascript" >
function entryClicked ( entry_id )
{
\twindow.location = "./player.php?entry_id=" + entry_id;
}
</script>
EOT;
        $this->assignRef('data', $this->get('Data'));
        FabrikHelperHTML::addScriptDeclaration($js);
        FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/kaltura/views/kaltura/tmpl/' . $tpl . '/template.css');
        $template = null;
        $this->assign('containerId', $this->get('ContainerId'));
        $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0);
        $this->assignRef('filters', $this->get('Filters'));
        $this->_setPath('template', $tmplpath);
        echo parent::display($template);
    }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:40,代碼來源:view.html.php

示例10: display

 function display($tmpl = 'default')
 {
     $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->setListIds();
     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 = JPATH_ROOT . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'coverflow' . DS . 'views' . DS . 'coverflow' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     //ensure we don't have an incorrect version of mootools loaded
     JHTML::stylesheet('media/com_fabrik/css/table.css');
     FabrikHelperHTML::script('media/com_fabrik/js/list.js', true);
     //assign something to Fabrik.blocks to ensure we can clear filters
     $str = "head.ready(function() {\r\n\t\t\tfabrikChart{$this->row->id} = {};";
     $str .= "\n" . "Fabrik.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\r\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($str);
     echo parent::display();
 }
開發者ID:juliano-hallac,項目名稱:fabrik,代碼行數:30,代碼來源:view.html.php

示例11: chooseAddEvent

 /**
  * Choose which list to add an event to
  *
  * @return  void
  */
 public function chooseAddEvent()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $this->setLayout('chooseAddEvent');
     $model = $this->getModel();
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
     $rows = $model->getEventLists();
     $model->getVisualization();
     $options = array();
     $options[] = JHTML::_('select.option', '', FText::_('PLG_VISUALIZATION_FULLCALENDAR_PLEASE_SELECT'));
     $model->getEvents();
     $attribs = 'class="inputbox" size="1" ';
     $options = array_merge($options, $rows);
     $this->_eventTypeDd = JHTML::_('select.genericlist', $options, 'event_type', $attribs, 'value', 'text', '', 'fabrik_event_type');
     /*
      * Tried loading in iframe and as an ajax request directly - however
      * in the end decided to set a call back to the main calendar object (via the package manager)
      * to load up the new add event form
      */
     $ref = $model->getJSRenderContext();
     $script = array();
     $script[] = "document.id('fabrik_event_type').addEvent('change', function(e) {";
     $script[] = "var fid = e.target.get('value');";
     $script[] = "var o = ({'id':'','listid':fid,'rowid':0});";
     $script[] = "o.title = Joomla.JText._('PLG_VISUALIZATION_FULLCALENDAR_ADD_EVENT');";
     $script[] = "Fabrik.blocks['" . $ref . "'].addEvForm(o);";
     $script[] = "Fabrik.Windows.chooseeventwin.close();";
     $script[] = "});";
     echo '<h2>' . FText::_('PLG_VISUALIZATION_FULLCALENDAR_PLEASE_CHOOSE_AN_EVENT_TYPE') . ':</h2>';
     echo $this->_eventTypeDd;
     FabrikHelperHTML::addScriptDeclaration(implode("\n", $script));
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:39,代碼來源:view.partial.php

示例12: display

 function display($tmpl = 'default')
 {
     FabrikHelperHTML::framework();
     $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->setListIds();
     if ($this->get('RequiredFiltersFound')) {
         $model->render();
     }
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assignRef('row', $row);
     $this->assign('showFilters', JRequest::getInt('showfilters', $params->get('show_filters')) === 1 ? 1 : 0);
     $this->assignRef('filters', $this->get('Filters'));
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $pluginParams = $model->getPluginParams();
     $this->assignRef('params', $model->getParams());
     $tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/coverflow/views/coverflow/tmpl/' . $tmpl;
     $this->_setPath('template', $tmplpath);
     FabrikHelperHTML::script('media/com_fabrik/js/list.js');
     //assign something to Fabrik.blocks to ensure we can clear filters
     $str = "head.ready(function() {\r\n\t\t\tfabrikChart{$this->row->id} = {};";
     $str .= "\n" . "Fabrik.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\r\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($str);
     echo parent::display();
 }
開發者ID:rhotog,項目名稱:fabrik,代碼行數:28,代碼來源:view.html.php

示例13: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 public function display($tpl = 'default')
 {
     $document = JFactory::getDocument();
     $app = JFactory::getApplication();
     $input = $app->input;
     $model = $this->getModel();
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
     if (!$model->canView()) {
         echo FText::_('JERROR_ALERTNOAUTHOR');
         return false;
     }
     $srcs = FabrikHelperHTML::framework();
     FabrikHelperHTML::styleSheet('plugins/fabrik_visualization/nvd3_chart/lib/novus-nvd3/src/nv.d3.css');
     $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js';
     $srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js';
     $lib = COM_FABRIK_LIVESITE . 'plugins/fabrik_visualization/nvd3_chart/lib/novus-nvd3/';
     $document->addScript($lib . 'lib/d3.v2.js');
     $document->addScript($lib . 'nv.d3.js');
     $document->addScript($lib . 'src/tooltip.js');
     $document->addScript($lib . 'lib/fisheye.js');
     $document->addScript($lib . 'src/utils.js');
     $document->addScript($lib . 'src/models/legend.js');
     $document->addScript($lib . 'src/models/axis.js');
     $document->addScript($lib . 'src/models/scatter.js');
     $document->addScript($lib . 'src/models/line.js');
     $document->addScript($lib . 'src/models/lineChart.js');
     $document->addScript($lib . 'src/models/multiBar.js');
     $document->addScript($lib . 'src/models/multiBarChart.js');
     $this->row = $model->getVisualization();
     $this->requiredFiltersFound = $model->getRequiredFiltersFound();
     $params = $model->getParams();
     $js = $model->js();
     FabrikHelperHTML::addScriptDeclaration($js);
     $this->params = $params;
     $viewName = $this->getName();
     $pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikFEModel');
     $plugin = $pluginManager->getPlugIn('calendar', 'visualization');
     $this->params = $params;
     $this->postText = $model->postText;
     $this->assign('containerId', $this->get('ContainerId'));
     $this->assign('filters', $this->get('Filters'));
     $this->showFilters = $model->showFilters();
     $this->assign('filterFormURL', $this->get('FilterFormURL'));
     $tpl = $params->get('nvd3_chart_layout', $tpl);
     $this->_setPath('template', JPATH_ROOT . '/plugins/fabrik_visualization/nvd3_chart/views/nvd3_chart/tmpl/' . $tpl);
     FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/nvd3_chart/views/nvd3_chart/tmpl/' . $tpl . '/template.css');
     // Assign something to Fabrik.blocks to ensure we can clear filters
     $ref = $model->getJSRenderContext();
     $js = "{$ref} = {};";
     $js .= "\n" . "Fabrik.addBlock('{$ref}', {$ref});";
     $js .= $model->getFilterJs();
     FabrikHelperHTML::iniRequireJs($model->getShim());
     FabrikHelperHTML::script($srcs, $js);
     $text = $this->loadTemplate();
     FabrikHelperHTML::runContentPlugins($text);
     echo $text;
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:65,代碼來源:view.html.php

示例14: display

 function display($tmpl = 'default')
 {
     FabrikHelperHTML::framework();
     $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->setListIds();
     if ($this->row->published == 0) {
         JError::raiseWarning(500, JText::_('JERROR_ALERTNOAUTHOR'));
         return '';
     }
     $this->assign('js', $this->get('JS'));
     $viewName = $this->getName();
     $pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
     $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', $model->getParams());
     $tmpl = $pluginParams->get('slideshow_viz_layout', $tmpl);
     $tmplpath = $model->pathBase . 'slideshow' . DS . 'views' . DS . 'slideshow' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     FabrikHelperHTML::script('media/com_fabrik/js/list.js');
     if ($this->get('RequiredFiltersFound')) {
         FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.js');
         $slideshow_viz_type = $pluginParams->get('slideshow_viz_type', 1);
         switch ($slideshow_viz_type) {
             case 1:
                 break;
             case 2:
                 FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.kenburns.js');
                 break;
             case 3:
                 FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.push.js');
                 break;
             case 4:
                 FabrikHelperHTML::script('components/com_fabrik/libs/slideshow2/js/slideshow.fold.js');
                 break;
             default:
                 break;
         }
         JHTML::stylesheet('components/com_fabrik/libs/slideshow2/css/slideshow.css');
         FabrikHelperHTML::script('plugins/fabrik_visualization/slideshow/slideshow.js');
     }
     FabrikHelperHTML::addScriptDeclaration($this->js);
     $ab_css_file = $tmplpath . DS . "template.css";
     $tmplpath = JPATH_ROOT . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'slideshow' . DS . 'views' . DS . 'slideshow' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     if (JFile::exists($ab_css_file)) {
         JHTML::stylesheet($this->srcBase . 'slideshow/views/slideshow/tmpl/' . $tmpl . '/template.css');
     }
     echo parent::display();
 }
開發者ID:rw1,項目名稱:fabrik,代碼行數:55,代碼來源:view.html.php

示例15: display

	function display($tmpl = 'default')
	{
		JHTML::_('behavior.calendar');
		FabrikHelperHTML::script('media/com_fabrik/js/list.js');
		FabrikHelperHTML::script('media/com_fabrik/js/advanced-search.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->setListIds();

		if ($this->row->published == 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', 'FabrikFEModel');
		$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);
		$tmpl = $pluginParams->get('chart_layout', $tmpl);
		$tmplpath = JPATH_ROOT.DS.'plugins'.DS.'fabrik_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('plugins/fabrik_visualization/chart/views/chart/tmpl/'.$tmpl.'/template.css', true);
		}

		//assign something to Fabrik.blocks to ensure we can clear filters
		$str = "head.ready(function() {
			fabrikChart{$this->row->id} = {};";
		$str .= "\n" . "Fabrik.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});
		});";
		FabrikHelperHTML::addScriptDeclaration($str);
		echo parent::display();
	}
開發者ID:Jobar87,項目名稱:fabrik,代碼行數:54,代碼來源:view.html.php


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