本文整理匯總了PHP中FabrikHelperHTML::framework方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::framework方法的具體用法?PHP FabrikHelperHTML::framework怎麽用?PHP FabrikHelperHTML::framework使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::framework方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
/**
* Display
*
* @param string $tmpl Template
*
* @return void
*/
public function display($tmpl = 'default')
{
$srcs = FabrikHelperHTML::framework();
$app = JFactory::getApplication();
$input = $app->input;
FabrikHelperHTML::script($srcs);
$model = $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
$visualization = $model->getVisualization();
$pluginParams = $model->getPluginParams();
$pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikModel');
$plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
$plugin->_row = $visualization;
if ($visualization->published == 0) {
return JError::raiseWarning(500, FText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'));
}
// Plugin is basically a model
$pluginTask = $input->get('plugintask', 'render', 'request');
// @FIXME cant set params directly like this, but I think plugin model setParams() is not right
$plugin->_params = $pluginParams;
$tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
$plugin->{$pluginTask}($this);
$this->plugin = $plugin;
$viewName = $this->getName();
$this->addTemplatePath($this->_basePath . '/plugins/' . $this->_name . '/' . $plugin->_name . '/tmpl/' . $tmpl);
$root = $app->isAdmin() ? JPATH_ADMINISTRATOR : JPATH_SITE;
$this->addTemplatePath($root . '/templates/' . $app->getTemplate() . '/html/com_fabrik/visualization/' . $plugin->_name . '/' . $tmpl);
$ab_css_file = JPATH_SITE . '/plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/template.css';
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
}
echo parent::display();
}
示例2: display
/**
* Display the view
*/
public function display($tpl = null)
{
FabrikHelperHTML::framework();
if ($this->getLayout() == 'confirmupdate') {
$this->confirmupdate();
return;
}
require_once JPATH_COMPONENT . '/helpers/adminhtml.php';
// Initialiase variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->pluginFields = $this->get('PluginHTML');
$this->js = $this->get('Js');
$this->jsevents = $this->get('JsEvents');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
//used for js part of form
if ($this->item->id == 0) {
$this->elements = array(JText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE'));
} else {
$this->elements = $this->get('Elements');
}
$this->assign('parent', $this->get('Parent'));
parent::display($tpl);
}
示例3: display
/**
* Display the view
*
* @param string $tpl Template
*
* @return void
*/
public function display($tpl = null)
{
// Initialiase variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->pluginFields = $this->get('PluginHTML');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new RuntimeException(implode("\n", $errors), 500);
}
$this->addToolbar();
FabrikAdminHelper::setViewLayout($this);
$srcs = FabrikHelperHTML::framework();
$srcs['Fabrik'] = FabrikHelperHTML::mediaFile('fabrik.js');
$srcs['Namespace'] = 'administrator/components/com_fabrik/views/namespace.js';
$srcs['PluginManager'] = 'administrator/components/com_fabrik/views/pluginmanager.js';
$srcs['CronAdmin'] = 'administrator/components/com_fabrik/views/cron/admincron.js';
$shim = array();
$dep = new stdClass();
$dep->deps = array('admin/pluginmanager');
$shim['admin/cron/admincron'] = $dep;
$opts = new stdClass();
$opts->plugin = $this->item->plugin;
$js = array();
$js[] = "\twindow.addEvent('domready', function () {";
$js[] = "\t\tFabrik.controller = new CronAdmin(" . json_encode($opts) . ");";
$js[] = "\t})";
FabrikHelperHTML::iniRequireJS($shim);
FabrikHelperHTML::script($srcs, implode("\n", $js));
parent::display($tpl);
}
示例4: 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();
}
示例5: 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;
}
示例6: display
function display($tmpl = 'default')
{
FabrikHelperHTML::framework();
$model = $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
$model->setId($id);
$this->assign('id', $id);
$this->assignRef('row', $this->get('Visualization'));
$this->assign('rows', $this->get('Rows'));
$this->assign('containerId', $this->get('ContainerId'));
$this->calName = $this->get('VizName');
$this->assignRef('params', $model->getParams());
$tmpl = $this->params->get('approvals_layout', $tmpl);
$tmplpath = JPATH_SITE . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'approvals' . DS . 'views' . DS . 'approvals' . DS . 'tmpl' . DS . $tmpl;
$this->_setPath('template', $tmplpath);
$ab_css_file = $tmplpath . DS . "template.css";
if (file_exists($ab_css_file)) {
JHTML::stylesheet('/plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tmpl . '/template.css');
}
FabrikHelperHTML::script('plugins/fabrik_visualization/approvals/approvals.js', "var approvals = new fbVisApprovals('approvals_" . $id . "');");
$text = $this->loadTemplate();
$opt = JRequest::getVar('option');
$view = JRequest::getCmd('view');
JRequest::setVar('view', 'article');
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);
echo $text;
}
示例7: display
/**
* Display the view
*
* @param string $tpl Template
*
* @return void
*/
public function display($tpl = null)
{
// Initialise variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->pluginFields = $this->get('PluginHTML');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new RuntimeException(implode("\n", $errors), 500);
}
$this->addToolbar();
FabrikAdminHelper::setViewLayout($this);
$srcs = FabrikHelperHTML::framework();
$srcs[] = 'media/com_fabrik/js/fabrik.js';
$srcs[] = 'administrator/components/com_fabrik/views/namespace.js';
$srcs[] = 'administrator/components/com_fabrik/views/pluginmanager.js';
$srcs[] = 'administrator/components/com_fabrik/views/visualization/adminvisualization.js';
$shim = array();
$dep = new stdClass();
$dep->deps = array('admin/pluginmanager');
$shim['admin/visualization/adminvisualization'] = $dep;
FabrikHelperHTML::iniRequireJS($shim);
$opts = new stdClass();
$opts->plugin = $this->item->plugin;
$js = "\n\tvar options = " . json_encode($opts) . ";\n\t\tFabrik.controller = new AdminVisualization(options);\n";
FabrikHelperHTML::script($srcs, $js);
parent::display($tpl);
}
示例8: 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')
{
$model = $this->getModel();
$j3 = FabrikWorker::j3();
$app = JFactory::getApplication();
$input = $app->input;
$usersConfig = JComponentHelper::getParams('com_fabrik');
$id = $input->get('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)));
$model->setId($id);
if (!$model->canView()) {
echo FText::_('JERROR_ALERTNOAUTHOR');
return false;
}
$this->id = $id;
$this->row = $this->get('Visualization');
$this->rows = $this->get('Rows');
$this->containerId = $this->get('ContainerId');
$this->calName = $this->get('VizName');
$this->params = $model->getParams();
$tpl = $j3 ? 'bootstrap' : $tpl;
$this->_setPath('template', JPATH_SITE . '/plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tpl);
FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tpl . '/template.css');
$ref = $model->getJSRenderContext();
$js = "var {$ref} = new fbVisApprovals('approvals_" . $id . "');\n";
$js .= "Fabrik.addBlock('" . $ref . "', {$ref});\n";
$js .= $model->getFilterJs();
$srcs = FabrikHelperHTML::framework();
$srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js';
$srcs['Approvals'] = 'plugins/fabrik_visualization/approvals/approvals.js';
FabrikHelperHTML::iniRequireJs($model->getShim());
FabrikHelperHTML::script($srcs, $js);
$text = $this->loadTemplate();
FabrikHelperHTML::runContentPlugins($text);
echo $text;
}
示例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')
{
$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();
}
示例10: display
function display($tmpl = 'default')
{
FabrikHelperHTML::framework();
FabrikHelperHTML::script('media/com_fabrik/js/list.js');
$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 '';
}
$calendar = $model->_row;
$this->media = $model->getMedia();
$params = $model->getParams();
$this->assign('params', $params);
$viewName = $this->getName();
$pluginManager = FabrikWorker::getPluginManager();
$plugin = $pluginManager->getPlugIn('media', 'visualization');
$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->assign('params', $model->getParams());
$pluginParams = $model->getPluginParams();
$tmpl = $pluginParams->get('media_layout', $tmpl);
$tmplpath = JPATH_ROOT . '/plugins/fabrik_visualization/media/views/media/tmpl/' . $tmpl;
$this->_setPath('template', $tmplpath);
FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/media/views/media/tmpl/' . $tmpl . '/template.css');
echo parent::display();
}
示例11: 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))));
$visualization = $model->getVisualization();
$pluginParams = $model->getPluginParams();
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikModel');
$plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
$plugin->_row = $visualization;
if ($visualization->published == 0) {
return JError::raiseWarning(500, JText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'));
}
//plugin is basically a model
$pluginTask = JRequest::getVar('plugintask', 'render', 'request');
// @FIXME cant set params directly like this, but I think plugin model setParams() is not right
$plugin->_params = $pluginParams;
$tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
$plugin->{$pluginTask}($this);
$this->plugin = $plugin;
$viewName = $this->getName();
$this->addTemplatePath($this->_basePath . DS . 'plugins' . DS . $this->_name . DS . $plugin->_name . DS . 'tmpl' . DS . $tmpl);
$this->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_fabrik' . DS . 'visualization' . DS . $plugin->_name . DS . $tmpl);
$ab_css_file = JPATH_SITE . "/plugins/fabrik_visualization/" . $plugin->_name . "/tmpl/{$tmpl}/template.css";
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
}
echo parent::display();
}
示例12: display
/**
* Display the view
*
* @param string $tmpl Template
*
* @return JView this
*/
public function display($tmpl = 'default')
{
$app = JFactory::getApplication();
$model = $this->getModel();
$input = $app->input;
$renderOrder = $input->getInt('renderOrder');
$path = JPATH_ROOT . '/plugins/fabrik_list/email/views/popupwin/tmpl/' . $tmpl;
$this->_setPath('template', $path);
$this->showToField = $model->getShowToField();
$records = $model->getRecords();
if (count($records) == 0) {
$app->enqueueMessage('None of the selected records can be emailed', 'notice');
return;
}
$this->recordcount = count($records);
$this->renderOrder = $renderOrder;
$this->recordids = implode(',', $records);
$this->listid = $this->get('id', 'list');
$this->showSubject = $model->getShowSubject();
$this->subject = $model->getSubject();
$this->message = $model->getMessage();
$this->allowAttachment = $model->getAllowAttachment();
$this->editor = $model->getEditor();
$this->toType = $model->_toType();
$this->emailTo = $model->_emailTo();
$this->params = $model->getParams();
$this->listEmailTo = $model->formModel->getElementList('list_email_to');
$this->addressBook = $model->addressBook();
$srcs = FabrikHelperHTML::framework();
FabrikHelperHTML::iniRequireJs();
FabrikHelperHTML::script($srcs);
return parent::display();
}
示例13: display
/**
* display the template
*
* @param sting $tpl
*/
function display($tpl = null)
{
FabrikHelperHTML::framework();
$element = JRequest::getVar('element');
$elementid = JRequest::getVar('elid');
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
$className = JRequest::getVar('plugin');
$plugin = $pluginManager->getPlugIn($className, 'element');
if (JError::isError($plugin)) {
JError::handleMessage($plugin);
return;
}
$plugin->setId($elementid);
$data = array();
$repeatCounter = 0;
$groupModel = $plugin->getGroup();
$srcs = array();
$plugin->formJavascriptClass($srcs);
echo "srcs = ";
print_r($srcs);
FabrikHelperHTML::script($srcs, true);
$html = '<script>';
$html .= $plugin->elementJavascript($repeatCounter);
$html .= '</script>';
$html .= $plugin->_getElement($data, $repeatCounter, $groupModel);
echo $html;
}
示例14: 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);
}
示例15: display
/**
* Display the view
*
* @param string $tpl template
*
* @return void
*/
public function display($tpl = null)
{
// Initialise variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->js = $this->get('Js');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new RuntimeException(implode("\n", $errors), 500);
}
$this->addToolbar();
FabrikAdminHelper::setViewLayout($this);
// Set up the script shim
$shim = array();
$dep = new stdClass();
$dep->deps = array('fab/fabrik');
$shim['admin/pluginmanager'] = $dep;
FabrikHelperHTML::iniRequireJS($shim);
$srcs = FabrikHelperHTML::framework();
$srcs[] = 'administrator/components/com_fabrik/views/namespace.js';
$srcs[] = 'administrator/components/com_fabrik/views/pluginmanager.js';
FabrikHelperHTML::script($srcs, $this->js);
parent::display($tpl);
}