public static function fetchHead($params, $module) { $document = JFactory::getDocument(); $mainframe = JFactory::getApplication(); $template = $mainframe->getTemplate(); JHTML::_('behavior.framework'); $language = JFactory::getLanguage(); $mapApi = 'http://maps.google.com/maps/api/js?sensor=true&language=' . $language->getTag(); if ($params->get('weather')) { $mapApi .= '&libraries=weather'; } $document->addScript($mapApi); if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/js/default.js')) { $document->addScript(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/js/default.js'); } else { $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js'); if ($params->get('enable-custom-infobox')) { $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/infobox.js'); } $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/default.js'); } if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/css/styles.css')) { $document->addStyleSheet(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/css/style.css'); } else { $document->addStyleSheet(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/css/style.css'); } }
/** * fetch Element */ function fetchElement($name, $values, &$node, $control_name) { $mediaPath = JURI::root() . str_replace(DS, '/', str_replace(JPATH_ROOT, '', dirname(dirname(dirname(__FILE__))))) . '/assets/'; JHTML::stylesheet('form.css', $mediaPath); $attributes = $node->attributes(); $class = isset($attributes['group']) && trim($attributes['group']) == 'end' ? 'lof-end-group' : 'lof-group'; $title = isset($attributes['title']) ? JText::_($attributes['title']) : 'Group'; $title = isset($attributes['title']) ? JText::_($attributes['title']) : ''; $for = isset($attributes['for']) ? $attributes['for'] : ''; if (isset($attributes['onoff'])) { // echo $control_name; die; // echo $name; die; // echo '<pre>'.print_r($values,1); die; $string = '<div ' . ($title ? "" : 'style="display:none"') . ' class="' . $class . '" title="' . $for . '">'; $checked = $values ? 'checked="checked"' : ""; // echo $checked; die; $string .= '<input type="checkbox" class="lof-onoff" id="params' . $for . '" value="" ' . $checked . ' name="' . $control_name . '[' . $for . ']" /><b>' . $title . '</b></div>'; return $string; } else { $string = '<div ' . ($title ? "" : 'style="display:none"') . ' class="' . $class . '" title="' . $for . '">' . $title . '</div>'; if (!defined('LOF_ADDED_TIME')) { $string .= '<input type="hidden" class="text_area" value="' . time() . '" id="paramsmain_lof_added_time" name="params[lof_added_time]">'; define('LOF_ADDED_TIME', 1); } } if (!defined('ADD_MEDIA_CONTROL')) { define('ADD_MEDIA_CONTROL', 1); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator/", "", $uri); JHTML::stylesheet('form.css', $uri . "/media/"); JHTML::script('form.js', $uri . "/media/"); } return $string; }
function display($tpl = null) { // Do not allow cache JResponse::allowCache(false); $app = JFactory::getApplication(); $style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); $lang = JFactory::getLanguage(); JHtml::_('behavior.framework', true); $document = JFactory::getDocument(); $document->addStyleSheet('../media/media/css/medialist-' . $style . '.css'); if ($lang->isRTL()) { $document->addStyleSheet('../media/media/css/medialist-' . $style . '_rtl.css'); } $document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\twindow.parent.document.updateUploader();\n\t\t\t\$\$('a.img-preview').each(function(el) {\n\t\t\t\tel.addEvent('click', function(e) {\n\t\t\t\t\tnew Event(e).stop();\n\t\t\t\t\twindow.top.document.preview.fromElement(el);\n\t\t\t\t});\n\t\t\t});\n\t\t});"); $images = $this->get('images'); $documents = $this->get('documents'); $folders = $this->get('folders'); $state = $this->get('state'); $this->baseURL = JURI::root(); $this->assignRef('images', $images); $this->assignRef('documents', $documents); $this->assignRef('folders', $folders); $this->assignRef('state', $state); parent::display($tpl); }
/** * Method to get the field input markup for a generic list. * Use the multiple attribute to enable multiselect. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $document = JFactory::getDocument(); $jsPath = JURI::root(true) . '/modules/mod_currentdatetime/js'; $joomlaVersion = new JVersion(); if ($joomlaVersion->isCompatible('3')) { JHtml::_('jquery.ui', array('core', 'sortable')); } else { $document->addStyleSheet($jsPath . '/25/css/chosen.min.css'); $document->addScript($jsPath . '/25/jquery.min.js'); $document->addScript($jsPath . '/25/jquery-noconflict.js'); $document->addScript($jsPath . '/25/chosen.jquery.min.js'); $document->addScript($jsPath . '/25/jquery.ui.core.min.js'); $document->addScript($jsPath . '/25/jquery.ui.widget.min.js'); $document->addScript($jsPath . '/25/jquery.ui.mouse.min.js'); $document->addScript($jsPath . '/25/jquery.ui.sortable.min.js'); } $document->addScript($jsPath . '/jquery-chosen-sortable.min.js'); $script = 'jQuery(function(){jQuery(".chzn-sortable").chosen().chosenSortable();});'; $document->addScriptDeclaration($script); if (!is_array($this->value)) { $this->value = explode(',', $this->value); } $html = parent::getInput(); return $html; }
function sendMemberDaytimeToAdmin($member_id, $service_id, $daytime_id) { define("BodyMemberDaytimeToAdmin", "<h1>Nouvelle inscription à une tranche horaire</h1><p>Un bénévole s'est inscrit à un secteur / tranche horaire.</p><p><strong>Nom :</strong> %s <br /><strong>Secteur :</strong> %s<br /><strong>Date :</strong> %s<br /><strong>Tranche horaire :</strong> %s</p><p><a href=\"" . JURI::root() . "/administrator/index.php?option=com_estivole&view=member&layout=edit&member_id=%s\">Cliquez ici</a> pour valider l'inscription et/ou recontacter le bénévole.</p>"); define("SubjectMemberDaytimeToAdmin", "Nouvelle inscription à une tranche horaire"); $db = JFactory::getDBO(); $query = $db->getQuery(TRUE); $this->user = JFactory::getUser(); // Get the dispatcher and load the user's plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('user'); $data = new JObject(); $data->id = $this->user->id; // Trigger the data preparation event. $dispatcher->trigger('onContentPrepareData', array('com_users.profilestivole', &$data)); $userProfilEstivole = $data; $userName = $userProfilEstivole->profilestivole['firstname'] . ' ' . $userProfilEstivole->profilestivole['lastname']; $query->select('*'); $query->from('#__estivole_members as b, #__estivole_services as s, #__estivole_daytimes as d'); $query->where('b.member_id = ' . (int) $member_id); $query->where('s.service_id = ' . (int) $service_id); $query->where('d.daytime_id = ' . (int) $daytime_id); $db->setQuery($query); $mailModel = $db->loadObject(); $mail = JFactory::getMailer(); $mail->setBody(sprintf(constant("BodyMemberDaytimeToAdmin"), $userName, $mailModel->service_name, date('d-m-Y', strtotime($mailModel->daytime_day)), date('H:i', strtotime($mailModel->daytime_hour_start)) . ' - ' . date('H:i', strtotime($mailModel->daytime_hour_end)), $mailModel->member_id)); $mail->setSubject(constant("SubjectMemberDaytimeToAdmin")); $mail->isHtml(); $recipient = array('*****@*****.**', $mailModel->email_responsable); $mail->addRecipient($recipient); $mail->Send('*****@*****.**'); }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { global $JElementJSComboJSWritten; if (!$JElementJSComboJSWritten) { $jsFile = dirname(__FILE__) . DS . "jscombobox.js"; $jsUrl = str_replace(JPATH_ROOT, JURI::root(true), $jsFile); $jsUrl = str_replace(DS, "/", $jsUrl); $document = JFactory::getDocument(); $document->addScript($jsUrl); $document->addstylesheet(str_replace('jscombobox.js', 'jscombobox.css', $jsUrl)); $JElementJSComboJSWritten = TRUE; } $html = array(); $attr = ''; // Initialize some field attributes. $attr .= $this->element['class'] ? ' class="combobox ' . (string) $this->element['class'] . '"' : ' class="combobox"'; // To avoid user's confusion, readonly="true" should imply disabled="true". if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') { $attr .= ' disabled="disabled"'; } $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; // Initialize JavaScript field attributes. $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; // Get the field options. $options = (array) $this->getOptions(); //store saved value for textbox $attr .= $this->value ? ' data-value="' . $this->value . '"' : ''; // Create a regular list. $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); return implode($html); }
private function _initDefaultPage() { $document = JFactory::getDocument(); $document->addCustomTag('<link href="' . JURI::root(true) . '/media/cbcc/js/jstree/themes/default/style.css" rel="stylesheet" />'); $document->addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $document->addScript(JURI::root(true) . '/media/cbcc/js/jstree/jquery.jstree.js'); }
/** * This renders the necessary bootstrap data into the html headers. */ public function bootstrap() { static $isRendered = false; $doc = JFactory::getDocument(); if( !$isRendered && $doc->getType() == 'html' ) { // @task: Include dependencies from foundry. require_once( JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'foundry' . DIRECTORY_SEPARATOR . '3.1' . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'configuration.php' ); $config = Komento::getConfig(); $environment = JRequest::getVar( 'komento_environment' , $config->get( 'komento_environment' ) ); $folder = 'scripts'; // @task: Let's see if we should load the dev scripts. if( $environment == 'development' ) { $folder = 'scripts_'; } $doc->addScript( rtrim( JURI::root() , '/' ) . '/media/com_komento/' . $folder . '/abstract.js' ); $isRendered = true; } return $isRendered; }
function fetchElement($name, $value, &$node, $control_name) { $doc = JFactory::getDocument(); $doc->addScript(JURI::root(true) . '/plugins/vmpayment/klikandpay/klikandpay/assets/js/admin.js'); $doc->addStyleSheet(JURI::root(true) . '/plugins/vmpayment/klikandpay/klikandpay/assets/css/klikandpay.css'); return ''; }
function plgcontentloadozio($galleriaozio) { $db =& JFactory::getDBO(); $query = 'SELECT published, link, id, access, params' . ' FROM #__menu' . ' WHERE id=' . (int) $galleriaozio; $db->setQuery($query); $codice = $db->loadObject(); $query = 'SELECT *' . ' FROM #__menu' . ' WHERE (link LIKE "index.php?option=com_oziogallery2&view=01tilt3d" OR link LIKE "index.php?option=com_oziogallery2&view=02flashgallery" OR link LIKE "index.php?option=com_oziogallery2&view=03imagin" OR link LIKE "index.php?option=com_oziogallery2&view=04carousel" OR link LIKE "index.php?option=com_oziogallery2&view=05imagerotator" OR link LIKE "index.php?option=com_oziogallery2&view=06accordion" OR link LIKE "index.php?option=com_oziogallery2&view=07flickrslidershow" OR link LIKE "index.php?option=com_oziogallery2&view=08flickrphoto" OR link LIKE "index.php?option=com_oziogallery2&view=09mediagallery" OR link LIKE "index.php?option=com_oziogallery2&view=10cooliris" )'; $db->setQuery($query); $cp = $db->loadObject(); $document =& JFactory::getDocument(); if ($cp->id = $galleriaozio) { @($gall = JURI::root() . $codice->link . '&Itemid=' . (int) $galleriaozio); $parametar = new JParameter($codice->params); // alexred if (@$codice->published != 0 && @$codice->access != 1 && @$codice->access != 2) { $document->addScript(JURI::root(true) . '/components/com_oziogallery2/assets/js/autoHeight.js'); $contents = ''; $contents .= '<div class="clr"></div>'; $contents .= '<iframe src="' . $gall . '&tmpl=component" width="' . $parametar->get("width") . '" marginwidth="0px" allowtransparency="true" frameborder="0" scrolling="no" class="autoHeight">'; $contents .= '</iframe>'; $contents .= '<div class="clr"></div>'; return $contents; } } }
/** * Set admin toolbar title and auto add page title to HTML head document. */ static function title($title, $icon = 'generic.png') { $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $doc->setTitle($title); $view = JRequest::getVar('view'); $layout = JRequest::getVar('layout', 'default'); $option = JRequest::getVar('option'); // Strip the extension. $icons = explode(' ', $icon); foreach ($icons as &$icon) { $icon = 'icon-48-' . preg_replace('#\\.[^.]*$#', '', $icon); } $class = "header-{$view}-{$layout}"; $img = "components/{$option}/images/admin-icons/{$class}.png"; if (JFile::exists(JPATH_ADMINISTRATOR . '/' . $img)) { $icon = $class; } if (JVERSION >= 3) { $icon = null; } $admin = $app->isSite() ? JURI::root() . 'administrator/' : ''; $img = $admin . "components/{$option}/images/admin-icons/{$class}.png"; $doc->addStyleDeclaration("\n.{$class} {\n background: url({$img}) no-repeat;\n}\n "); $html = '<div class="pagetitle ' . htmlspecialchars($icon) . '"><h2>' . $title . '</h2></div>'; //$html = $title ; $app->JComponentTitle = $html; }
protected function getInput() { $this->value = JURI::root() . 'plugins/vmpayment/realex_hpp_api/jump.php'; $class = !empty($this->class) ? 'class="' . $this->class . '"' : 'class="text_area"'; $size = $this->size ? 'size="' . $this->size . '"' : ''; return '<input type="text" name="' . $this->name . '" id="' . $this->name . '" value="' . $this->value . '" ' . $class . ' ' . $size . ' />'; }
public function display($tpl = null) { global $mainframe; $document = & JFactory::getDocument(); $document->addScript('components/com_gglms/js/jquery-ui-1.8.2.custom.min.js'); $document->addStyleSheet(JURI::root(true) . '/components/com_gglms/css/provagratuita.css'); $user = JFactory::getUser(); $userid = $user->get('id'); if (!$userid) { $tpl = "loggati"; } else { $model = & $this->getModel(); $pg = $model->check_Coupon(); if (!empty($pg)) { $this->assignRef('data_scadenza', $pg['data_scadenza_f']); $this->assignRef('ora_scadenza', $pg['ora_scadenza_f']); if (strtotime($pg['data_scadenza']) < strtotime(date("Y-m-d H:i:s"))) $tpl = "scaduta"; else $tpl = "incorso"; } else $tpl = "attivala"; } parent::display($tpl); }
public static function ListExtensions(&$extensions) { $root = JURI::root() . '../../'; $base = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'plugins'; $db = JFactory::getDBO(); $query = ' SELECT ext.name FROM #__jckplugins ext INNER JOIN #__jckplugins parent on parent.id = ext.parentid WHERE parent.name = "jtreelink" AND parent.published = 1 AND ext.published = 1'; $db->setQuery($query); $results = $db->loadResultArray(); if (empty($results)) { return; } foreach ($results as $extension) { $path = $base . DS . $extension . DS . 'images' . DS . 'icon.gif'; $url = $root . $extension . '/images/icon.gif'; $icon = array('_open', '_closed'); //We default to default icon if no custom icon has been supplied by plugin. if (JFile::exists($path)) { $icon = array($url, $url); } else { $path = $base . DS . $extension . DS . 'images' . DS . 'icon.png'; $url = $root . $extension . '/images/icon.png'; if (JFile::exists($path)) { $icon = array($url, $url); } } $extensions[$extension] = $icon; } }
function display($tpl = null) { $document = JFactory::getDocument(); $document->setMimeEncoding('application/json'); if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) { //JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' ); $model = VmModel::getModel('Media'); $image = $model->createMediaByIds($virtuemart_media_id); // echo '<pre>'.print_r($image,1).'</pre>'; $this->json = $image[0]; //echo json_encode($this->json); if (isset($this->json->file_url)) { $this->json->file_root = JURI::root(true) . '/'; $this->json->msg = 'OK'; echo @json_encode($this->json); } else { $this->json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>'; echo @json_encode($this->json); } } else { if (!class_exists('VmMediaHandler')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php'; } $start = vRequest::getInt('start', 0); $type = vRequest::getCmd('mediatype', 0); $list = VmMediaHandler::displayImages($type, $start); echo @json_encode($list); } jExit(); }
function __construct() { parent::__construct(); $this->_siteurl = JURI::root(); $user = JFactory::getUser(); $this->_uid = $user->id; }
/** * * 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); }
public function getInput() { if (!class_exists('Yjsg')) { return; } jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); $yjsg = Yjsg::getInstance(); // make sure is YJ template if ($yjsg->yjtmpl()) { $e_folder = basename(dirname(dirname(__FILE__))); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . 'plugins/system/' . $e_folder . '/elements/css/yjsgplg.css'); if (intval(JVERSION) < 3) { $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/assets/src/libraries/jquery.min.js'); $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/assets/src/libraries/jquery-noconflict.js'); } $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/elements/src/yjsgplg.js'); $document->addScriptDeclaration("\n\t\t\t\n\t\t\t\n\t\t\t\t\tvar yjsgPlgpath = '" . JURI::root() . "';\n\t\t\t\t\tvar updatingTemplate ='" . JText::_('YJSG_UPDATING_TXT') . "';\n\t\t\t\t\tvar restoringTemplate ='" . JText::_('YJSG_RESTORING_TXT') . "';\n\t\t\t"); } $html = '<div class="update_template">'; $html .= '<div class="update_msg"><i class="fa fa-refresh fa-spin"></i> ' . JText::_('YJSG_COMP_CHECK') . '</div>'; $html .= '<a id="update" class="updatebuttons" href="#">' . JText::_('YJSG_UPDATE') . '</a>'; $html .= '<a id="restore" class="updatebuttons" href="#">' . JText::_('YJSG_RESTORE') . '</a>'; $html .= '<a id="cleanup" class="updatebuttons" href="#">' . JText::_('YJSG_CLEANUP') . '</a>'; $html .= '</div>'; if ($yjsg->yjtmpl()) { return $html; } else { return; } }
function setStyle() { $app = JFactory::getApplication(); $doc = JFactory::getDocument(); if ($doc->getType() != 'html') { return; } //include_once AK_LIB_PATH.DS.'dom'.DS.'simple_html_dom.php'; $body = JResponse::getBody(); $body = explode('</head>', $body); $base = JURI::root(); $style = "\n"; if ($app->isSite()) { if (JVERSION < 3.0) { $style .= '<link rel="stylesheet" href="' . AK_ADMIN_CSS_URL . '/system.css" type="text/css" />' . "\n"; } $style .= '<link rel="stylesheet" href="' . AK_CSS_URL . '/custom-typo.css" type="text/css" />' . "\n"; $style .= '<link rel="stylesheet" href="' . AK_CSS_URL . '/custom.css" type="text/css" />' . "\n"; } else { if (JVERSION < 3.0) { $style .= '<link rel="stylesheet" href="' . AK_ADMIN_CSS_URL . '/system.css" type="text/css" />' . "\n"; } $style .= '<link rel="stylesheet" href="' . AK_CSS_URL . '/custom-admin.css" type="text/css" />' . "\n"; } $body[0] .= $style; //Fold content $replace['{fold}'] = '<div class="ak-fold-warp"><div class="ak-fold-outter"><div class="ak-fold-inner">'; $replace['{/fold}'] = '</div></div><div class="ak-fold-button"></div></div><div class="clearfix"></div>'; if ($app->isSite()) { $body[1] = strtr($body[1], $replace); } $body = implode('</head>', $body); JResponse::setBody($body); }
protected function getInput() { JHtml::_('behavior.modal', 'a.modal'); $script = array(); $script[] = ' function jSelectArticle_' . $this->id . '(id, title, catid, object) {'; $script[] = ' document.id("' . $this->id . '_id").value = id;'; $script[] = ' document.id("' . $this->id . '_name").value = title;'; $script[] = ' SqueezeBox.close();'; $script[] = ' }'; JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); $html = array(); $uri = JFactory::getURI(); $link = JURI::root(true) . '/modules/mod_junewsultra/img/imgsetting.php'; $html[] = '<div style="clear: both;"></div><div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="' . JText::_('MOD_JUNEWS_IMAGE_CONF') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 980, y: 590}}">' . JText::_('MOD_JUNEWS_IMAGE_CONF') . '</a>'; $html[] = ' </div>'; $html[] = '</div>'; $html[] = '<div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="' . JText::_('MOD_JUNEWS_NOTICE12') . '" href="' . $link . '?clearcache=1" rel="{handler: \'iframe\', size: {x: 330, y: 130}}">' . JText::_('MOD_JUNEWS_NOTICE12') . '</a>'; $html[] = ' </div>'; $html[] = '</div>'; /* $html[] = '<div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="'.JText::_('MOD_JUNEWS_DONATE').'" href="'. JURI::root( true ).'/modules/mod_junewsultra/fields/donate.php" rel="{handler: \'iframe\', size: {x: 400, y: 450}}">'.JText::_('MOD_JUNEWS_DONATE').'</a>'; $html[] = ' </div>'; $html[] = '</div>'; */ $html[] = '<p style="clear: both;" />'; return implode("\n", $html); }
public static function getLink($params, $fields = array('simple', 'menu', 'article'), $content_item = false, $isJoomlaArticle = true) { $simple = $fields[0]; $menu = $fields[1]; $article = $fields[2]; $link = ''; if ($params->get($simple, '') != '') { $link = str_ireplace('{SITE}/', JURI::root(), $params->get($simple)); } elseif ($params->get($menu, '') != '') { $application = JFactory::getApplication(); $cms_menu = $application->getMenu(); $menu_item = $cms_menu->getItem($params->get($menu)); $link = JRoute::_($menu_item->link . '&Itemid=' . $menu_item->id); } elseif ($params->get($article, '') != '') { if (self::getjVersion() > 2) { $link = JRoute::_('index.php?option=com_content&view=article&id=' . $params->get($article, '')); } else { $link = JRoute::_(ContentHelperRoute::getArticleRoute($params->get($article, ''))); } } elseif ($content_item && $isJoomlaArticle) { if (self::getjVersion() > 2) { $link = JRoute::_('index.php?option=com_content&view=article&id=' . $content_item->id); } else { $link = JRoute::_(ContentHelperRoute::getArticleRoute($content_item->id, $content_item->catid)); } } elseif ($content_item) { if (@isset($content_item->link)) { $link = $content_item->link; } } return $link; }
public function render($params = array()) { // init vars $params = $this->app->data->create($params); $title = $this->get('title'); $file = $this->app->zoo->resizeImage(JPATH_ROOT . DS . $this->get('file'), $params->get('width', 0), $params->get('height', 0)); $link = JURI::root() . $this->app->path->relative($file); $url = $target = $rel = ''; if ($params->get('link_to_item', false)) { if ($this->getItem()->getState()) { $url = $this->app->route->item($this->_item, false); $title = empty($title) ? $this->_item->name : $title; } } else { if ($this->get('link')) { $url = $this->get('link'); $target = $this->get('target'); $rel = $this->get('rel'); } else { if ($this->get('lightbox_image')) { $url = JURI::root() . $this->app->path->relative($this->app->zoo->resizeImage(JPATH_ROOT . DS . $this->get('lightbox_image', ''), 0, 0)); } } } // get alt $alt = empty($title) ? $this->_item->name : $title; // render layout if ($file && ($layout = $this->getLayout())) { return $this->renderLayout($layout, compact('file', 'title', 'alt', 'link', 'params', 'url', 'target', 'rel')); } return null; }
public function fetchElement($name, $value, &$node, $control_name) { $application = JFactory::getApplication(); $document = JFactory::getDocument(); $fieldName = $control_name . '[' . $name . ']'; $link = JURI::root() . COLOR_PICKER_URL . 'index.php?object=' . $name . '&color=' . preg_replace('/([^a-zA-Z0-9]?)/', '', $value); JHTML::script('colorpicker.js', COLOR_PICKER_URL); JHTML::_('behavior.modal', 'a.modal'); $title = JText::_('Select a Color'); $short_title = JText::_('Select'); $name_value = !empty($value) ? $value : $title; $background_color = !empty($value) ? $value : '#ffffff'; $html = <<<EOF <div style="float:left;"> <input style="background-color:#ffffff;" type="text" id="{$name}_name" value="{$name_value}" disabled="disabled" size="12" /> </div> <div style="float:left;"> <div style="background-color: {$background_color}; width:15px; height:15px; border: 1px solid #a3a3a3; margin-left:2px" id="{$name}_preview"></div> </div> <div class="button2-left"> <div class="blank"> <a class="modal" title="{$title}" href="{$link}" rel="{handler:'iframe', size: {x: 450, y: 375}}">{$short_title}</a> </div> </div> <input type="hidden" id="{$name}_id" name="{$fieldName}" value="{$value}" /> EOF; return $html; }
public static function addAdminScript() { $checkJqueryLoaded = false; $document = JFactory::getDocument(); $header = $document->getHeadData(); JHTML::_('behavior.framework'); if (!version_compare(JVERSION, '3.0', 'ge')) { foreach ($header['scripts'] as $scriptName => $scriptData) { if (substr_count($scriptName, '/jquery')) { $checkJqueryLoaded = true; } } //Add js if (!$checkJqueryLoaded) { $document->addScript(JURI::root() . 'components/com_bt_socialconnect/assets/js/jquery.min.js'); } } $document->addScript(JURI::root() . 'components/com_bt_socialconnect/assets/js/default.js'); $document->addScript(JURI::root() . 'components/com_bt_socialconnect/assets/js/menu.js'); $document->addScript(JURI::root() . 'administrator/components/com_bt_socialconnect/assets/js/bt_social.js'); $document->addScriptDeclaration('jQuery.noConflict();'); $document->addStyleSheet(JURI::root() . 'components/com_bt_socialconnect/assets/icon/admin.css'); $document->addStyleSheet(JURI::root() . 'components/com_bt_socialconnect/assets/css/legacy.css'); $document->addStyleSheet(JURI::root() . 'administrator/components/com_bt_socialconnect/assets/css/bt_social.css'); if (!Bt_SocialconnectLegacyHelper::isLegacy()) { JHtml::_('formbehavior.chosen', 'select'); } }
/** * Display the button * * @return array A two element array of ( imageName, textToInsert ) */ function render($name) { $mainframe =& JFactory::getApplication(); $button = new JObject(); if ($mainframe->isSite()) { $enable_frontend = $this->params->enable_frontend; if (!$enable_frontend) { return $button; } } JHTML::_('behavior.modal'); $document =& JFactory::getDocument(); $button_style = 'modulesanywhere'; if (!$this->params->button_icon) { $button_style = 'blank blank_modulesanywhere'; } $document->addStyleSheet(JURI::root(true) . '/plugins/editors-xtd/modulesanywhere/css/style.css'); $link = 'index.php?nn_qp=1' . '&folder=plugins.editors-xtd.modulesanywhere' . '&file=modulesanywhere.inc.php' . '&name=' . $name; $text = JText::_(str_replace(' ', '_', $this->params->button_text)); if ($text == str_replace(' ', '_', $this->params->button_text)) { $text = JText::_($this->params->button_text); } $button->set('modal', true); $button->set('link', $link); $button->set('text', $text); $button->set('name', $button_style); $button->set('options', "{handler: 'iframe', size: {x:window.getSize().x-100, y: window.getSize().y-100}}"); return $button; }
public static function &getInstance() { static $instance; if (!$instance) { $instance = new PhocaGalleryPath(); //$baseFront = str_replace('/administrator', '', JURI::base(true)); $baseFront = JURI::root(true); $instance->image_abs = JPATH_ROOT . DS . 'images' . DS . 'phocagallery' . DS; $instance->image_rel = 'images/phocagallery/'; $instance->avatar_abs = JPATH_ROOT . DS . 'images' . DS . 'phocagallery' . DS . 'avatars' . DS; $instance->avatar_rel = 'images/phocagallery/avatars/'; $instance->image_rel_full = $baseFront . '/' . $instance->image_rel; $instance->image_rel_admin = 'media/com_phocagallery/images/administrator/'; $instance->image_rel_admin_full = $baseFront . '/' . $instance->image_rel_admin; $instance->image_rel_front = 'media/com_phocagallery/images/'; $instance->image_rel_front_full = $baseFront . '/' . $instance->image_rel_front; $instance->image_abs_front = JPATH_ROOT . DS . 'media' . DS . 'com_phocagallery' . DS . 'images' . DS; $instance->media_css_abs = JPATH_ROOT . DS . 'media' . DS . 'com_phocagallery' . DS . 'css' . DS; $instance->media_img_abs = JPATH_ROOT . DS . 'media' . DS . 'com_phocagallery' . DS . 'images' . DS; $instance->media_js_abs = JPATH_ROOT . DS . 'media' . DS . 'com_phocagallery' . DS . 'js' . DS; $instance->media_css_rel = 'media/com_phocagallery/css/'; $instance->media_img_rel = 'media/com_phocagallery/images/'; $instance->media_js_rel = 'components/com_phocagallery/assets/'; $instance->media_css_rel_full = $baseFront . '/' . $instance->media_css_rel; $instance->media_img_rel_full = $baseFront . '/' . $instance->media_img_rel; $instance->media_js_rel_full = $baseFront . '/' . $instance->media_js_rel; $instance->assets_abs = JPATH_ROOT . DS . 'components' . DS . 'com_phocagallery' . DS . 'assets' . DS; $instance->assets_rel = 'components/com_phocagallery/assets/'; } return $instance; }
function getMessage($extension = '', $xml = '', $version = '', $addmargin = 0) { if (!$extension || !$xml && !$version) { return; } $alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension))); if ($xml) { $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml)); if ($xml && isset($xml['version'])) { $version = $xml['version']; } } if (!$version) { return; } JHTML::_('behavior.mootools'); $document =& JFactory::getDocument(); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js?v=' . $this->_version); $url = 'http://www.nonumber.nl/ext/version.php?ext=' . $alias . '&version=' . $version; $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $msg = html_entity_decode(JText::sprintf('NN_A_NEWER_VERSION_IS_AVAILABLE', 'http://www.nonumber.nl/' . $alias . '/download', '<span id="nonumber_newversionnumber_' . $alias . '"></span>', $version), ENT_COMPAT, 'UTF-8'); $margin = $addmargin ? '10px;' : '3px;'; $msg = '<div style="border:3px solid #F0DC7E;color:#CC0000;margin-bottom:' . $margin . '"><div style="padding: 2px 5px;background-color:#EFE7B8">' . $msg . '</div></div>'; $msg = '<div id="nonumber_version_' . $alias . '" style="display: none;">' . $msg . '</div>'; return $msg; }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { // Load the language file. FD::language()->loadAdmin(); // Render the headers FD::page()->start(); // Attach dialog's css file. JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css'); $theme = FD::themes(); $label = (string) $this->element['label']; $name = (string) $this->name; $title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_BADGE'); if ($this->value) { $badge = FD::table('Badge'); $badge->load($this->value); $title = $badge->get('title'); } $theme->set('name', $name); $theme->set('id', $this->id); $theme->set('value', $this->value); $theme->set('label', $label); $theme->set('title', $title); $output = $theme->output('admin/jfields/badge'); // We do not want to process stylesheets on Joomla 2.5 and below. $options = array(); if (FD::version()->getVersion() < 3) { $options['processStylesheets'] = false; } FD::page()->end($options); return $output; }
protected function getInput() { JHTML::_('behavior.framework'); $document =& JFactory::getDocument(); if (!version_compare(JVERSION, '3.0', 'ge')) { $checkJqueryLoaded = false; $header = $document->getHeadData(); foreach ($header['scripts'] as $scriptName => $scriptData) { if (substr_count($scriptName, '/jquery')) { $checkJqueryLoaded = true; } } //Add js if (!$checkJqueryLoaded) { $document->addScript(JURI::root() . $this->element['path'] . 'js/jquery.min.js'); } $document->addScript(JURI::root() . $this->element['path'] . 'js/chosen.jquery.min.js'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/chosen.css'); } $document->addScript(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/jquery.lightbox-0.5.min.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/btbase64.min.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/bt.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/script.js'); //Add css $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/bt.css'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.css'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/jquery.lightbox-0.5.css'); return null; }
function build(&$vars, &$segments, &$do_sef, &$metadata, &$item_limitstart) { // Extract variables extract($vars); if (isset($link)) { if ($this->_helperExists) { $link = MailtoHelper::validateHash($link); } else { $link = base64_decode($link); } $link = str_replace(JURI::root(), '', $link); // Remove URL Suffix if ($this->params->get('remove_url_suffix', 0) && $this->MijosefConfig->url_suffix != '') { $urlSuffix = $this->MijosefConfig->url_suffix; if ($urlSuffix == substr($link, -strlen($urlSuffix))) { $link = substr($link, 0, -strlen($urlSuffix)); } } if (substr($link, 0, 1) == '/') { $link = substr($link, 1, strlen($link) - 1); } $segments[] = rtrim($link, '/'); unset($vars['link']); } $metadata = parent::getMetaData($vars, $item_limitstart); unset($vars['limit']); unset($vars['limitstart']); }