本文整理匯總了PHP中FabrikHelperHTML::mediaFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::mediaFile方法的具體用法?PHP FabrikHelperHTML::mediaFile怎麽用?PHP FabrikHelperHTML::mediaFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::mediaFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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);
}
示例2: getManagementJS
/**
* Get JS objects
*
* @param array $data list data
*
* @return void
*/
protected function getManagementJS($data = array())
{
$input = $this->app->input;
$itemId = FabrikWorker::itemId();
/** @var FabrikFEModelList $model */
$model = $this->getModel();
$params = $model->getParams();
$item = $model->getTable();
$listRef = $model->getRenderContext();
$listId = $model->getId();
$formModel = $model->getFormModel();
$elementsNotInTable = $formModel->getElementsNotInTable();
$toggleCols = (bool) $params->get('toggle_cols', false);
$ajax = (int) $model->isAjax();
$ajaxLinks = (bool) $params->get('list_ajax_links', $ajax);
$opts = new stdClass();
$pluginManager = FabrikWorker::getPluginManager();
if ($ajaxLinks) {
$modalTitle = 'test';
$modalOpts = array('content' => '', 'id' => 'ajax_links', 'title' => JText::_($modalTitle), 'modal' => false, 'expandable' => true);
FabrikHelperHTML::jLayoutJs('ajax_links', 'fabrik-modal', (object) $modalOpts);
}
// Advanced search
if ($params->get('advanced-filter')) {
$modalOpts = array('content' => '', 'id' => 'advanced-filter', 'title' => JText::_('COM_FABRIK_FIELD_ADVANCED_SEARCH_LABEL'), 'modal' => false, 'expandable' => true);
FabrikHelperHTML::jLayoutJs('advanced-filter', 'fabrik-modal', (object) $modalOpts);
}
FabrikHelperHTML::jLayoutJs('modal-state-label', 'list.fabrik-filters-modal-state-label', $layoutData = (object) array('label' => '', 'displayValue' => '', 'key' => ''));
$this->csvJS($opts, $model);
if ($model->requiresSlimbox()) {
FabrikHelperHTML::slimbox();
}
if ($model->requiresSlideshow()) {
FabrikHelperHTML::slideshow();
}
$src = FabrikHelperHTML::framework();
$shim = array();
$dep = new stdClass();
$dep->deps = array();
$shim['fab/list'] = $dep;
$src['FbList'] = FabrikHelperHTML::mediaFile('list.js');
$src['FbListFilter'] = FabrikHelperHTML::mediaFile('listfilter.js');
$src['ListPlugin'] = FabrikHelperHTML::mediaFile('list-plugin.js');
$src = $model->getPluginJsClasses($src, $shim);
$pluginManager->runPlugins('loadJavascriptClassName', $model, 'list');
$pluginManager->data = array_filter($pluginManager->data, function ($v) {
return $v !== '';
});
$model->getCustomJsAction($src);
$tmpl = $model->getTmpl();
$this->tmpl = $tmpl;
$model->getListCss();
// Check for a custom js file and include it if it exists
$aJsPath = JPATH_SITE . '/components/com_fabrik/views/list/tmpl/' . $tmpl . '/javascript.js';
if (JFile::exists($aJsPath)) {
$src['CustomJs'] = 'components/com_fabrik/views/list/tmpl/' . $tmpl . '/javascript.js';
}
$origRows = $this->rows;
$this->rows = array(array());
$tmpItemid = !isset($itemId) ? 0 : $itemId;
$this->_row = new stdClass();
$script = array();
$params = $model->getParams();
$opts->admin = $this->app->isAdmin();
$opts->ajax = $ajax;
$opts->ajax_links = $ajaxLinks;
$opts->links = array('detail' => $params->get('detailurl', ''), 'edit' => $params->get('editurl', ''), 'add' => $params->get('addurl', ''));
$opts->filterMethod = $this->filter_action;
$opts->advancedFilters = $model->getAdvancedFilterValues();
$opts->resetFilters = (bool) FabrikWorker::getMenuOrRequestVar('resetfilters', 0, false, 'request');
$opts->form = 'listform_' . $listRef;
$this->listref = $listRef;
$opts->headings = $model->jsonHeadings();
$labels = $this->headings;
foreach ($labels as &$l) {
$l = strip_tags($l);
}
$opts->labels = $labels;
$opts->primaryKey = $item->db_primary_key;
$opts->Itemid = $tmpItemid;
$opts->listRef = $listRef;
$opts->formid = $model->getFormModel()->getId();
$opts->canEdit = $model->canEdit() ? '1' : '0';
$opts->canView = $model->canView() ? '1' : '0';
$opts->page = JRoute::_('index.php');
$opts->isGrouped = $this->isGrouped;
$opts->toggleCols = $toggleCols;
$opts->j3 = FabrikWorker::j3();
$opts->singleOrdering = (bool) $model->singleOrdering();
// Reset data back to original settings
$this->rows = $origRows;
$formEls = array();
foreach ($elementsNotInTable as $tmpElement) {
//.........這裏部分代碼省略.........