本文整理匯總了PHP中FabrikHelperHTML::getMediaFolder方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::getMediaFolder方法的具體用法?PHP FabrikHelperHTML::getMediaFolder怎麽用?PHP FabrikHelperHTML::getMediaFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::getMediaFolder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadJavascriptClass_result
/**
* Get the src(s) for the list plugin js class
*
* @return mixed string or array
*/
public function loadJavascriptClass_result()
{
$mediaFolder = FabrikHelperHTML::getMediaFolder();
$src = parent::loadJavascriptClass_result();
$src['element'] = $mediaFolder . '/element.js';
return $src;
}
示例2: iniJs
/**
* Initialize the js
*
* @return void
*/
private function iniJs()
{
$model = $this->getModel();
$ref = $model->getJSRenderContext();
$json = json_encode($this->jsOptions());
$js = array();
$js[] = "\tvar {$ref} = new fabrikFullcalendar('{$ref}', {$json});";
$js[] = "\tFabrik.addBlock('" . $ref . "', {$ref});";
$js[] = "" . $model->getFilterJs();
$js = implode("\n", $js);
$mediaFolder = FabrikHelperHTML::getMediaFolder();
$srcs = FabrikHelperHTML::framework();
$srcs['FbListFilter'] = $mediaFolder . '/listfilter.js';
$srcs['fabrikFullcalendar'] = 'plugins/fabrik_visualization/fullcalendar/fullcalendar.js';
/*
$shim = $model->getShim();
$fcLangFolder = 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/lang/';
// Figure out what language we are using
$lang = strtolower(JFactory::getUser()->getParam('language', JFactory::getLanguage()->getTag()));
if ( file_exists( JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false ) {
$lang = FabrikWorker::getShortLang();
if ( file_exists( JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false ) {
$lang = 'en-gb';
}
}
$shim['lang'] = (object) array('deps' =>
array('lib/moment/moment', 'fullcalendar')
);
$shim['viz/fullcalendar/fullcalendar'] = (object) array('deps' =>
array('lang', 'jquery')
);
FabrikHelperHTML::iniRequireJs($shim,
array('fullcalendar' => 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/fullcalendar.min',
'lang' => $fcLangFolder . $lang));
FabrikHelperHTML::script($srcs, $js);
*/
$shim = $model->getShim();
$shim['fullcalendar'] = (object) array('deps' => array('lib/moment/moment'));
$shim['viz/fullcalendar/fullcalendar'] = (object) array('deps' => array('fullcalendar', 'jquery'));
FabrikHelperHTML::iniRequireJs($shim, array('fullcalendar' => 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/fullcalendar.min'));
FabrikHelperHTML::script($srcs, $js);
}
示例3: formJavascriptClass
/**
* Get the class to manage the form element
* to ensure that the file is loaded only once
*
* @param array &$srcs Scripts previously loaded
* @param string $script Script to load once class has loaded
* @param array &$shim Dependant class names to load before loading the class - put in requirejs.config shim
*
* @return void
*/
public function formJavascriptClass(&$srcs, $script = '', &$shim = array())
{
$mediaFolder = FabrikHelperHTML::getMediaFolder();
$files = array('Element' => $mediaFolder . '/element.js', 'ElementList' => $mediaFolder . '/elementlist.js');
$srcs = array_merge($srcs, $files);
parent::formJavascriptClass($srcs, $script, $shim);
}
示例4: _addJavascript
/**
* Append the form javascript into the document head
*
* @param int $listId table id
*
* @return void|boolean
*/
protected function _addJavascript($listId)
{
$pluginManager = FabrikWorker::getPluginManager();
/** @var FabrikFEModelForm $model */
$model = $this->getModel();
$model->elementJsJLayouts();
$aLoadedElementPlugins = array();
$jsActions = array();
$bKey = $model->jsKey();
$mediaFolder = FabrikHelperHTML::getMediaFolder();
$srcs = array_merge(array('FloatingTips' => $mediaFolder . '/tipsBootStrapMock.js', 'FbForm' => $mediaFolder . '/form.js', 'Fabrik' => $mediaFolder . '/fabrik.js'), FabrikHelperHTML::framework());
$shim = array();
$liveSiteReq[] = $mediaFolder . '/tipsBootStrapMock.js';
if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
FabrikHelperHTML::slimbox();
$dep = new stdClass();
$dep->deps = array('fab/element', 'lib/form_placeholder/Form.Placeholder');
$shim['fabrik/form'] = $dep;
$deps = new stdClass();
$deps->deps = array('fab/fabrik', 'fab/element', 'fab/form-submit');
$framework['fab/elementlist'] = $deps;
$srcs['Placeholder'] = 'media/com_fabrik/js/lib/form_placeholder/Form.Placeholder.js';
$srcs['FormSubmit'] = $mediaFolder . '/form-submit.js';
$srcs['Element'] = $mediaFolder . '/element.js';
}
$aWYSIWYGNames = array();
// $$$ hugh - yet 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 && $elementModel->canUse() && $model->isEditable()) {
$aWYSIWYGNames[] = $res;
}
// Load in once the element js class files
$element = $elementModel->getElement();
if (!in_array($element->plugin, $aLoadedElementPlugins)) {
/* $$$ hugh - certain elements, like file-upload, need to load different JS files
* on a per-element basis, so as a test fix, I modified the file-upload's formJavaScriptClass to return false,
* and test for that here, so as to not add it to aLoadedElementPlugins[]. The existing 'static' tests in
* formJavascriptClass() should still prevent scripts being added twice.
*/
if ($elementModel->formJavascriptClass($srcs, '', $shim) !== false) {
$aLoadedElementPlugins[] = $element->plugin;
}
}
$eventMax = $groupModel->repeatTotal == 0 ? 1 : $groupModel->repeatTotal;
for ($c = 0; $c < $eventMax; $c++) {
$jsAct = $elementModel->getFormattedJSActions($bKey, $c);
if (!empty($jsAct)) {
$jsActions[] = $jsAct;
}
}
}
}
FabrikHelperHTML::iniRequireJS($shim);
$actions = trim(implode("\n", $jsActions));
FabrikHelperHTML::windows('a.fabrikWin');
FabrikHelperHTML::tips('.hasTip', array(), "\$('{$bKey}')");
$model->getFormCss();
$opts = $this->jsOpts();
$model->jsOpts = $opts;
$pluginManager->runPlugins('onJSOpts', $model);
$opts = json_encode($model->jsOpts);
if (!FabrikHelperHTML::inAjaxLoadedPage()) {
JText::script('COM_FABRIK_VALIDATING');
JText::script('COM_FABRIK_SUCCESS');
JText::script('COM_FABRIK_NO_REPEAT_GROUP_DATA');
JText::script('COM_FABRIK_VALIDATION_ERROR');
JText::script('COM_FABRIK_CONFIRM_DELETE_1');
}
JText::script('COM_FABRIK_FORM_SAVED');
// $$$ rob don't declare as var $bKey, but rather assign to window, as if loaded via ajax window the function is wrapped
// inside an anonymous function, and therefore $bKey wont be available as a global var in window
$script = array();
$script[] = "\t\tvar {$bKey} = new FbForm(" . $model->getId() . ", {$opts});";
$script[] = "\t\tFabrik.addBlock('{$bKey}', {$bKey});";
// Instantiate js objects for each element
$vstr = "\n";
$groups = $model->getGroupsHiarachy();
$script[] = "\t{$bKey}.addElements(";
$groupedJs = new stdClass();
foreach ($groups as $groupModel) {
$groupId = $groupModel->getGroup()->id;
$groupedJs->{$groupId} = array();
if (!$groupModel->canView('form')) {
continue;
}
$elementJs = array();
$elementModels = $groupModel->getPublishedElements();
//.........這裏部分代碼省略.........