本文整理汇总了PHP中JSNHtmlAsset::addScript方法的典型用法代码示例。如果您正苦于以下问题:PHP JSNHtmlAsset::addScript方法的具体用法?PHP JSNHtmlAsset::addScript怎么用?PHP JSNHtmlAsset::addScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSNHtmlAsset
的用法示例。
在下文中一共展示了JSNHtmlAsset::addScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display the view
*/
public function display($tpl = null)
{
// Include the component HTML helpers.
JSNFactory::import('components.com_content.helpers.content');
JSNFactory::import('components.com_content.helpers.html.contentadministrator');
$JSNMedia = JSNFactory::getMedia();
$JSNMedia->addStyleSheet(JSN_POWERADMIN_STYLE_URI . 'content.css');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.content.js');
if ($this->getLayout() == 'pagebreak') {
// TODO: This is really dogy - should change this one day.
$eName = JRequest::getVar('e_name');
$eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName);
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE'));
$this->assignRef('eName', $eName);
parent::display($tpl);
return;
}
// Initialiase variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$language = JFactory::getLanguage();
$language->load('com_content');
parent::display($tpl);
}
示例2: display
public function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
// Check if this view is used for module editing page.
$moduleEdit = JRequest::getCmd('moduleedit', '');
$active_positions = array();
$model = $this->getModel('changeposition');
if (!$moduleEdit) {
$moduleid = $app->getUserState('com_poweradmin.changeposition.moduleid');
} else {
$moduleid = array(JRequest::getCmd('moduleid', ''));
}
for ($i = 0; $i < count($moduleid); $i++) {
$active_positions[] = "\$('#" . $model->getModulePosition($moduleid[$i]) . "-jsnposition').addClass('active-position').attr('title', 'Active position');";
}
JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jquery.noconflict.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.functions.js');
//$document->addScript(JSN_POWERADMIN_LIB_JSNJS_URI. 'jsn.filter.visualmode.js');
//Enable position filter.
$this->setFilterable(true);
$customScript = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar moduleid = new Array();\n\t\t\tmoduleid = [" . @implode(",", $moduleid) . "];\n\t\t\t(function (\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\t" . implode(PHP_EOL, $active_positions) . "\n\t\t\t\t});\n\t\t\t})(JoomlaShine.jQuery);\n \t\t";
$this->addCustomScripts($customScript);
//Callback after position clicked.
if (!$moduleEdit) {
$onPostionClick = "\n \t\t\tif ( !\$(this).hasClass('active-position') ){\n\t\t\t\tJoomlaShine.jQuery.setPosition(moduleid, \$(this).attr('id').replace('-jsnposition', ''));\n \t\t\t\tparent.JoomlaShine.jQuery('.ui-dialog-content').dialog('close');\n \t\t\t}\n \t\t\t";
} else {
$onPostionClick = "\n \t\t\tif ( !\$(this).hasClass('active-position') ){\n \t\t\t\tvar posName = \$(this).attr('id').replace('-jsnposition', '');\n \t\t\t\tparent.JoomlaShine.jQuery('#jform_position').val(posName);\n \t\t\t\tparent.modal.close();\n \t\t\t}\n \t\t\t";
}
$this->addPositionClickCallBack($onPostionClick);
parent::display($tpl);
}
示例3: addMedia
/**
*
* Add Scripts and StyleSheets for this view
* @param String $currentUrl
*/
protected function addMedia($currentItemid, $render_url, $php_to_js)
{
$currentItemid = (int) $currentItemid;
/** load libraries for the system rener **/
$JSNTemplate = JSNFactory::getTemplate();
$JSNMedia = JSNFactory::getMedia();
$template = JFactory::getDocument()->template;
$currUri = new JURI($render_url);
JSNHtmlAsset::addStyle(JSN_POWERADMIN_STYLE_URI . 'uilayout/layout-default-latest.css');
JSNHtmlAsset::addStyle(JSN_POWERADMIN_STYLE_URI . 'styles.css');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JS_URI . 'jquery.tinyscrollbar.js');
JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-hotkeys/jquery.hotkeys.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JS_URI . 'jquery-baseencode64.js');
JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-jstorage/jquery.jstorage.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.mousecheck.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.autodragdrop.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.draganddrop.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.component.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.grid.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.functions.js');
JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-layout/js/jquery.layout-latest.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jstree/jstree.override.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jstreecontext.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.submenu.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.menuitems.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jquery.override.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.filter.js');
//check sef on/off
$sef = JFactory::getConfig()->get('sef');
/** Add Custom Scripts **/
$customScript = "\n\t\t\tvar jsnpoweradmin = true;\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar sef = " . $sef . ";\n\t\t\tvar currentUrl = '" . $render_url . "';\n\t\t\tvar lang = '" . $JSNMedia->getLang() . "';\n\t\t\tvar positions = new Array();\n\t\t\tvar JSNGrid, JSNComponent;\n\n\t\t\t(function(\$){\n\t\t\t " . implode(PHP_EOL, $php_to_js) . "\n\t\t\t \$.uiBackCompat = false;\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#page-loading').hide();\n\t\t\t\t\t\$('#jsn-rawmode-layout').css('visibility', 'visible');\n\t\t\t\t\tif (\$('#jsn-adminbar').size() == 0) {\n\t\t\t\t\t\t\$('body').addClass('no-adminbar');\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction setFullScreen () {\n\t\t\t\t\t\t\$('body').toggleClass('jsn-fullscreen');\n\t\t\t\t\t\tif (\$('body').hasClass('jsn-fullscreen')) {\n\t\t\t\t\t\t\t\$('.header').hide();\n\t\t\t\t\t\t\t\$('.subhead-collapse').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\$('.header').show();\n\t\t\t\t\t\t\t\$('.subhead-collapse').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\$(window).trigger('resize');\n\t\t\t\t\t}\n\n\t\t\t\t\t\$('a#jsn-fullscreen').click(function () {\n\t\t\t\t\t\tsetFullScreen();\n\t\t\t\t\t\t\$.cookie('jsn-fullscreen', \$('body').hasClass('jsn-fullscreen'));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\n\t\t\t\t\tvar isFullScreen = \$.cookie('jsn-fullscreen');\n\t\t\t\t\tif (isFullScreen !== undefined && (isFullScreen == 'true' || isFullScreen == '1')) {\n\t\t\t\t\t\tsetFullScreen();\n\t\t\t\t\t}\n\n\t\t\t\t\t\$.jStorage.set('selected_node', " . $currentItemid . ");\n\t\t\t\t\t\$.ajaxSetup({\n\t\t\t\t\t timeout: 10000\n\t\t\t\t\t});\n\t\t\t\t\tJSNGrid = new \$.JSNGrid();\n\t\t\t\t\tJSNComponent = new \$.JSNComponent('" . $currUri->getVar('option') . "', '" . $currUri->getVar('view') . "', '" . $currUri->getVar('layout') . "', '" . $currentItemid . "');\n \t\t\t\t\t\$._menuitems.mode = 'rawmode';\n \t\t\t\t\t\$._menuitems.init();\n \t\t\t\t\t\$.jsnmouse.init();\n\t\t\t\t\tJSNFilter\t= new \$.JSNSpotligthModuleFilter(\$('#module_spotlight_filter'), {defaultText: '" . JText::_('JSN_RAWMODE_MODULE_FILTER_DEFAULT_TEXT', true) . "'});\n\t\t\t\t});\n\n\t\t\t})(JoomlaShine.jQuery);\n\t\t";
$JSNMedia->addScriptDeclaration($customScript);
}
示例4: loadAssets
/**
* Load common assets.
*
* @param boolean $inline Whether to load assets inline or load in header?
*
* @return void
*/
public static function loadAssets($inline = false)
{
// Define common stylesheets
$stylesheets = array();
if (JSNVersion::isJoomlaCompatible('3.0')) {
$stylesheets[] = JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css';
if (preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT'])) {
$stylesheets[] = JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery.ui.1.9.0.ie.css';
}
} else {
$stylesheets[] = JSN_URL_ASSETS . '/3rd-party/bootstrap/css/bootstrap.min.css';
$stylesheets[] = JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.8.16.custom.css';
if (preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT'])) {
$stylesheets[] = JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.8.16.ie.css';
}
}
$stylesheets[] = JSN_URL_ASSETS . '/joomlashine/css/jsn-gui.css';
// Load stylesheets
if (!$inline) {
JSNHtmlAsset::addStyle($stylesheets);
} else {
foreach ($stylesheets as $stylesheet) {
$html[] = '<link type="text/css" href="' . $stylesheet . '" rel="stylesheet" />';
}
echo implode("\n", $html);
}
// Load scripts
if (JSNVersion::isJoomlaCompatible('3.2')) {
JSNHtmlAsset::addScript(JUri::root(true) . '/media/jui/js/jquery.min.js');
}
}
示例5: html
/**
* Generate html for PageBuilder layout.
*
* @return string
*/
public function html()
{
$helper = new JSNPagebuilderHelpersBuilder();
JSNHtmlAsset::addScript(JSNPB_ADMIN_URL . '/assets/js/elements-lang.js');
JSNHtmlAsset::addScript(JSNPB_ADMIN_URL . '/assets/js/handle.js');
JSNHtmlAsset::addScript(JSNPB_ADMIN_URL . '/assets/js/shortcodesetting/settings-handler.js');
// Genrate pagebuilder element template.
$helper->generateElementColumnTemplate();
$helper->generateElementRowTemplate();
$source_content = '';
$data = array();
$source_content = $_POST['form_data'];
// Remove all p tags which auto added by the editor
$source_content = JSNPagebuilderHelpersShortcode::removeAutop($source_content);
$source_content = html_entity_decode($source_content, ENT_COMPAT, 'UTF-8');
$html[] = '<link rel="stylesheet" href="' . JSNPB_ADMIN_URL . '/assets/css/jsn-element-font.css' . '" type="text/css" />';
$html[] = '<link rel="stylesheet" href="' . JSNPB_ADMIN_URL . '/assets/css/pb-layout-font.css' . '" type="text/css" />';
$html[] = '<div id="form-container" class="jsn-layout jsn-section-content">';
if ($source_content) {
//$shortcodeTags = $helper->getShortcodeTags();
$html[] = $helper->generateShortCode($source_content);
} else {
$html[] = $helper->getRowStructure();
}
$html[] = '<a href="javascript:void(0);" id="jsn-add-container"
class="jsn-add-more jsn-add-more-row"><i class="icon-plus"></i> Add Row
</a>';
/**
* Show thumbnail for default layouts
*/
$html[] = '<div class="row-fluid pb-layout-thumbs">';
$layouts = JSNPBShortcodeRow::$layouts;
foreach ($layouts as $columns) {
$columns_name = implode('x', $columns);
$icon_class = implode('-', $columns);
$data_columns = implode(',', $columns);
$icon_class = 'pb-layout-' . $icon_class;
$icon = '<i class="' . $icon_class . '"></i>';
$html[] = '<div class="thumb-wrapper" data-columns="' . $data_columns . '" title="' . $columns_name . '">' . $icon . '</div>';
}
$html[] = '</div>';
$html[] = JSNHtmlGenerate::footer(array(), false);
$html[] = '</div>';
$html[] = $helper->getAddShortcodesPopup();
if (defined("JSN_PAGEBUILDER_EDITION")) {
if (strtolower(JSN_PAGEBUILDER_EDITION) == "free") {
if (file_exists(JPATH_ROOT . '/administrator/components/com_pagebuilder/helpers/articles.php')) {
include_once JPATH_ROOT . '/administrator/components/com_pagebuilder/helpers/articles.php';
$pbTotal = JSNPagebuilderHelpersArticles::getCountArticleUsedPageBuilderFromPlugin();
if ($pbTotal >= 5 && !JFactory::getApplication()->input->getInt('article_id') && JFactory::getApplication()->input->getInt('is_com_modules') != 1) {
$html = array();
$html[] = '<div class="jsn-bootstrap3"><div class="pb-element-container"><p class="jsn-bglabel">You have reached 5 pages limit of using JSN PageBuilder.</p><p style="font-size: 20px;text-align: center;color: #d3d3d3;">Please to upgrade <a target=\'_blank\' href=\'' . JSN_PAGEBUILDER_INFO_LINK . '\'>Pro version</a> or remove your old pages that used JSN PageBuilder.</p><div style="text-align: center"><a href="index.php?option=com_pagebuilder&view=upgrade" target="_blank" class="btn-primary btn-large btn"> Upgrade </a></div></div></div>';
}
}
}
}
print_r(implode("\n", $html));
exit;
}
示例6: addAssets
/**
* Add the libraries css and javascript
*
* @return void
*
* @since 1.6
*/
protected function addAssets()
{
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map', array('jquery', 'jquery.ui'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.services', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.extensions', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
JSNHtmlAsset::addScript('http://maps.google.com/maps/api/js?sensor=false&libraries=places');
echo JSNHtmlAsset::loadScript('uniform/submission', array('nextAndPreviousForm' => $this->nextAndPreviousForm), true);
}
示例7: backend_element_assets
/**
* Include admin scripts
*
* @return type
*/
public function backend_element_assets()
{
$document = JFactory::getDocument();
JSNHtmlAsset::addScript(JSNPB_ELEMENT_URL . '/pricingtable/assets/js/pricingtable-settings.js', 'text/javascript');
JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/pricingtable/assets/js/item_pricingtable.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/pricingtable/assets/css/item_pricingtable.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-linktype.js', 'js');
}
示例8: getInput
protected function getInput()
{
$uri = JURI::root(true);
$enabledCSS = ' jsn-disable';
$menuid = JRequest::getInt('id');
$app = JFactory::getApplication();
$showcaseID = $app->getUserState('com_imageshow.add.showcase_id');
if ($showcaseID != 0) {
$this->value = $showcaseID;
$app->setUserState('com_modules.add.showcase_id', 0);
}
$document = JFactory::getDocument();
$input = $app->input;
$option = $input->getCmd('option', '');
$view = $input->getCmd('view', '');
if ($option == 'com_advancedmodules' && $view == 'module') {
if (file_exists(JPATH_ROOT . '/media/jui/js/jquery.simplecolors.min.js')) {
$document->addScript(JUri::root(true) . '/media/jui/js/jquery.simplecolors.min.js');
}
}
!class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
JHTML::stylesheet('modules/mod_imageshow/assets/css/style.css');
JHTML::stylesheet('administrator/components/com_imageshow/assets/css/imageshow.css');
JSNHtmlAsset::addScript($uri . '/media/jui/js/jquery.min.js');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
JHTML::script('administrator/components/com_imageshow/assets/js/joomlashine/window.js');
JHTML::script('modules/mod_imageshow/assets/js/jsnis_module.js');
JSNHtmlAsset::addScript($uri . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
$jsCode = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar gIframeFunc = undefined;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function () {\n\t\t\t\t\tvar wWidth = \$(window).width()*0.9;\n\t\t\t\t\tvar wHeight = \$(window).height()*0.8;\n\t\t\t\t\t\$('.jsn-is-showcase-modal').click(function(event){\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar link = baseUrl+'administrator/'+\$(this).attr('href')+'&tmpl=component';\n\t\t\t\t\t\tvar save_button_lable = '" . JText::_('JSN_IMAGESHOW_SAVE_AND_SELECT', true) . "';\n\t\t\t\t\t\tvar JSNISShowcaseWindow = new \$.JSNISUIWindow(link,{\n\t\t\t\t\t\t\t\twidth: wWidth,\n\t\t\t\t\t\t\t\theight: wHeight,\n\t\t\t\t\t\t\t\ttitle: '" . JText::_('JSN_IMAGESHOW_SHOWCASE_SETTINGS') . "',\n\t\t\t\t\t\t\t\tscrollContent: true,\n\t\t\t\t\t\t\t\tbuttons:\n\t\t\t\t\t\t\t\t[{\n\t\t\t\t\t\t\t\t\ttext:save_button_lable,\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\tif(typeof gIframeFunc != 'undefined')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgIframeFunc();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('Iframe function not available')\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: '" . JText::_('JSN_IMAGESHOW_CANCEL', true) . "',\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t ";
$document = JFactory::getDocument();
$document->addScriptDeclaration($jsCode);
$db = JFactory::getDBO();
JHTML::stylesheet('modules/mod_imageshow/assets/css/style.css');
//build the list of categories
$query = 'SELECT a.showcase_title AS text, a.showcase_id AS id' . ' FROM #__imageshow_showcase AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering';
$db->setQuery($query);
$data = $db->loadObjectList();
$results[] = JHTML::_('select.option', '0', '- ' . JText::_('JSN_FIELD_SELECT_SHOWCASE') . ' -', 'id', 'text');
$results = array_merge($results, $data);
if ($data) {
$enabledCSS = '';
if (!$menuid && is_null($showcaseID)) {
$this->value = $data[0]->id;
}
} else {
$this->value = '0';
}
$html = "<div id='jsn-showcase-icon-warning'>";
$html .= JHTML::_('select.genericList', $results, $this->name, 'class="inputbox jsn-select-value' . $enabledCSS . '" style="width: 250px;"', 'id', 'text', $this->value, $this->id);
if (!$data) {
$html .= '<span><i>' . JText::_('JSN_DO_NOT_HAVE_ANY_SHOWCASE') . '</i></span>';
}
$html .= "<span><i class=\"jsn-icon16 jsn-icon-warning-sign icon-warning" . $enabledCSS . "\" id = \"showcase-icon-warning\"><span class=\"jsn-tooltip-wrap\"><span class=\"jsn-tooltip-anchor\"></span><p class=\"jsn-tooltip-title\">" . JText::_('JSN_FIELD_TITLE_SHOWCASE_WARNING') . "</p>" . JText::_('JSN_FIELD_DES_SHOWCASE_WARNING') . "</span></i></span>";
$html .= "<a class=\"jsn-link-edit-showcase jsn-is-showcase-modal\" id=\"jsn-link-edit-showcase\" href=\"javascript: void(0);\" rel='{\"action\": \"edit\"}' title=\"" . JText::_('EDIT_SELECTED_SHOWCASE') . "\"><i class=\"jsn-icon16 jsn-icon-pencil\" id=\"showcase-icon-edit\"></i></a>";
$html .= "<a class=\"jsn-is-showcase-modal\" href=\"index.php?option=com_imageshow&controller=showcase&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWCASE') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id=\"showcase-icon-add\"></i></a>";
$html .= "</div>";
return $html;
}
示例9: addAssets
/**
* Add the libraries css and javascript
*
* @return void
*
* @since 1.6
*/
protected function addAssets()
{
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map', array('jquery', 'jquery.ui'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.services', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.extensions', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
$uri = JUri::getInstance();
JSNHtmlAsset::addScript($uri->getScheme() . '://maps.google.com/maps/api/js?sensor=false&libraries=places');
echo JSNHtmlAsset::loadScript('uniform/submission', array('nextAndPreviousForm' => $this->nextAndPreviousForm), true);
JSNHtmlAsset::addScript(JSN_UNIFORM_ASSETS_URI . '/js/jsn.jquery.noconflict.js');
}
示例10: _addAssets
/**
* Add nesscessary JS & CSS files
*
* @return void
*/
private function _addAssets()
{
$objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
!class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
$objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
$objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
// Add toolbar menu
JSNISImageShowHelper::addToolbarMenu();
// Set the submenu
JSNISImageShowHelper::addSubmenu('about');
}
示例11: _addAssets
/**
* Add nesscessary JS & CSS files
*
* @return void
*/
private function _addAssets()
{
$objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
$objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js');
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
!class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
$objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
$objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/image_selector.css');
JSNHtmlAsset::loadScript('imageshow/joomlashine/showlist', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE'))));
}
示例12: display
public function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$positionName = JRequest::getVar('positionname', '');
JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jquery.noconflict.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.functions.js');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.filter.visualmode.js');
//Enable position filter.
$this->setFilterable(true);
$customScript = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\t(function (\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\t\$('#" . $positionName . "-jsnposition').addClass('active-position').attr('title', 'Active position');\n\t\t\t\t});\n\t\t\t})(JoomlaShine.jQuery);\n \t\t";
$this->addCustomScripts($customScript);
parent::display($tpl);
}
示例13: getInput
protected function getInput()
{
$definePath = JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'imageshow.defines.php';
if (is_file($definePath)) {
include_once $definePath;
}
$_app = JFactory::getApplication('admin');
$_input = $_app->input;
$pathOnly = JURI::root(true);
$pathRoot = JURI::root();
$enabledCSS = ' jsn-disable';
$menuid = $_input->getInt('id', 0);
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$doc = JFactory::getDocument();
$doc->addStyleSheet($pathOnly . '/administrator/components/com_imageshow/assets/css/imageshow.css');
$doc->addStyleSheet($pathOnly . '/administrator/components/com_imageshow/assets/css/menu.galleries.collection.css');
JSNHtmlAsset::addScript($pathOnly . '/media/jui/js/jquery.min.js');
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
$doc->addScript($pathOnly . '/administrator/components/com_imageshow/assets/js/joomlashine/window.js');
JSNHtmlAsset::addScript($pathOnly . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
$query = 'SELECT COUNT(*) FROM #__imageshow_showlist';
$db->setQuery($query);
$totalShowlist = $db->loadResult();
if ($totalShowlist >= 3 && strtolower(JSN_IMAGESHOW_EDITION) == 'free') {
$jsCode = "\n\t\t\t\t(function(\$){\n\t\t\t\t\t\$(document).ready(function () {\n\n\t\t\t\t\t\t\$('.jsn-is-showlist-modal').click(function(event){\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tvar cfm = \$('<div id=\"jsn-is-module-backend-confirmbox-container\" style=\"padding:10px; overflow:hidden;\"/>').appendTo('body').html('" . JText::_('JSN_IMAGESHOW_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_SHOWLISTS_IN_FREE_EDITION', true) . "');\n\t\t\t\t\t\t\tcfm.dialog({\n\t\t\t\t\t\t\t\twidth : 500,\n\t\t\t\t\t\t\t\theight : 250,\n\t\t\t\t\t\t\t\tmodal : true,\n\t\t\t\t\t\t\t\tdraggable : false,\n\t\t\t\t\t\t\t\tresizable : false,\n\t\t\t\t\t\t\t\ttitle\t\t: '" . JText::_('JSN_IMAGESHOW_UPGRADE_TO_PRO_EDITION_FOR_MORE', true) . "',\n\t\t\t\t\t\t\t\tbuttons :\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\ttext: 'Close',\n\t\t\t\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcfm.remove();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t\t ";
} else {
$jsCode = "\n\t\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\t\tvar gIframeFunc = undefined;\n\t\t\t\t(function(\$){\n\t\t\t\t\t\$(document).ready(function () {\n\t\t\t\t\t\tvar wWidth = \$(window).width()*0.9;\n\t\t\t\t\t\tvar wHeight = \$(window).height()*0.8;\n\t\t\t\t\t\t\$('.jsn-is-showlist-modal').click(function(event){\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tvar link = baseUrl+'administrator/'+\$(this).attr('href')+'&tmpl=component';\n\t\t\t\t\t\t\tvar save_button_lable = '" . JText::_('JSN_IMAGESHOW_SAVE_AND_SELECT', true) . "';\n\t\t\t\t\t\t\tvar JSNISShowlistWindow = new \$.JSNISUIWindow(link,{\n\t\t\t\t\t\t\t\t\twidth: wWidth,\n\t\t\t\t\t\t\t\t\theight: wHeight,\n\t\t\t\t\t\t\t\t\ttitle: '" . JText::_('JSN_IMAGESHOW_SHOWLIST_SETTINGS') . "',\n\t\t\t\t\t\t\t\t\tscrollContent: true,\n\t\t\t\t\t\t\t\t\tbuttons:\n\t\t\t\t\t\t\t\t\t[{\n\t\t\t\t\t\t\t\t\t\ttext:save_button_lable,\n\t\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\tif(typeof gIframeFunc != 'undefined')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tgIframeFunc();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log('Iframe function not available')\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttext: '" . JText::_('JSN_IMAGESHOW_CANCEL', true) . "',\n\t\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t\t ";
}
$doc->addScriptDeclaration($jsCode);
$query = $db->getQuery(true);
$query->clear();
$query->select('a.showlist_title AS text, a.showlist_id AS id');
$query->from($db->quoteName('#__imageshow_showlist') . ' AS a');
$query->where('a.published = ' . $db->quote(1));
$query->order('a.ordering ASC');
$db->setQuery($query);
$results = $db->loadObjectList();
$html = "<div id='jsn-showlist-container'>";
if (!$results) {
$html .= '<span class="jsn-menu-alert-message">' . JText::_('JSN_DO_NOT_HAVE_ANY_SHOWLIST') . '</span>';
} else {
$html .= JHTML::_('select.genericList', $results, $this->name, 'class="inputbox jsn-select-value' . $enabledCSS . '" multiple="multiple"', 'id', 'text', $this->value, $this->id);
}
$html .= "<a class=\"jsn-is-showlist-modal\" href=\"index.php?option=com_imageshow&controller=showlist&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWLIST') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id = \"showlist-icon-add\"></i></a>";
$html .= "</div>";
return $html;
}
示例14: _addAssets
/**
* Add the libraries css and javascript
*
* @return void
*/
private function _addAssets()
{
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-tipsy/tipsy.css');
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.css');
$formAction = $this->_config->get('form_action');
$this->_document->addScriptDeclaration(" var currentAction = {$formAction}; ");
$arrayTranslated = array('JSN_UNIFORM_BUTTON_SAVE', 'JSN_UNIFORM_BUTTON_CANCEL', 'JSN_UNIFORM_EMAIL_SUBMITTER_TITLE', 'JSN_UNIFORM_EMAIL_ADDRESS_TITLE', 'JSN_UNIFORM_YOU_CAN_NOT_HIDE_THE_COPYLINK', 'JSN_UNIFORM_UPGRADE_EDITION_TITLE', 'JSN_UNIFORM_UPGRADE_EDITION', 'JSN_UNIFORM_SELECT_THE_ACTION_TO_TAKE_AFTER', 'JSN_UNIFORM_SET_THE_FOLDER_TO_STORE', 'JSN_SAMPLE_DISABLE_SHOW_COPYRIGHT_DES');
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map', array('jquery', 'jquery.ui'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.services', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
JSNHtmlAsset::registerDepends('uniform/libs/googlemaps/jquery.ui.map.extensions', array('jquery', 'jquery.ui', 'uniform/libs/googlemaps/jquery.ui.map'));
JSNHtmlAsset::addScript('http://maps.google.com/maps/api/js?sensor=false&libraries=places');
$edition = defined('JSN_UNIFORM_EDITION') ? strtolower(JSN_UNIFORM_EDITION) : "free";
echo JSNHtmlAsset::loadScript('jsn/core', array('lang' => JSNUtilsLanguage::getTranslated(array('JSN_EXTFW_GENERAL_LOADING', 'JSN_EXTFW_GENERAL_CLOSE'))), true);
echo JSNHtmlAsset::loadScript('jsn/config', array('language' => array('JSN_EXTFW_GENERAL_CLOSE' => JText::_('JSN_EXTFW_GENERAL_CLOSE'))), true);
echo JSNHtmlAsset::loadScript('uniform/configuration', array('language' => JSNUtilsLanguage::getTranslated($arrayTranslated), 'edition' => $edition), true);
}
示例15: _addAssets
/**
* Add the libraries css and javascript
*
* @return void
*
* @since 1.6
*/
private function _addAssets()
{
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css');
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/bootstrap/css/bootstrap.min.css');
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/joomlashine/css/jsn-gui.css');
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/joomlashine/css/jsn-view-launchpad.css');
JSNHtmlAsset::addStyle(JURI::base(true) . '/components/com_uniform/assets/css/uniform.css');
if (preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT'])) {
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.8.16.ie.css');
}
JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css');
$arrayTranslated = array('JSN_UNIFORM_UPGRADE_EDITION_TITLE', 'JSN_UNIFORM_LAUNCHPAD_PLUGIN_SYNTAX', 'JSN_UNIFORM_YOU_MUST_SELECT_SOME_FORM', 'JSN_UNIFORM_EDIT_SELECTED_FORM', 'JSN_UNIFORM_LAUNCHPAD_PLUGIN_SYNTAX_DES', 'JSN_UNIFORM_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_FORM_IN_FREE_EDITION', 'JSN_UNIFORM_UPGRADE_EDITION');
$edition = defined('JSN_UNIFORM_EDITION') ? JSN_UNIFORM_EDITION : "free";
JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery/jquery-1.8.2.js');
JSNHtmlAsset::addScriptLibrary('jquery.ui', '3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min', array('jquery'));
echo JSNHtmlAsset::loadScript('uniform/launchpad', array('baseZeroClipBoard' => JSN_URL_ASSETS . '/3rd-party/jquery-zeroclipboard/ZeroClipboard.swf', 'edition' => $edition, 'language' => JSNUtilsLanguage::getTranslated($arrayTranslated)), true);
}