function defaults() { $document = JFactory::getDocument(); $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/jquery.maskedinput.min.js'); $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/upload/jquery.fileupload.js'); $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery.colorbox-min.js'); $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/upload/jquery.iframe-transport.js'); $document->addScript(JUri::base(true) . '/media/cbcc/js/bootstrap.tab.ajax.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/jquery.cookie.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/jstree/jquery.jstree.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/caydonvi.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/jquery.dataTables.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/dataTables.bootstrap.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/dataTables.tableTools.min.js'); $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/datatables.default.config.js'); $document->addStyleSheet(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/css/dataTables.tableTools.css'); $model = Core::model('Thongke/Thongke'); $idUser = JFactory::getUser()->id; $idRoot = Core::getManageUnit($idUser, 'com_thongke', 'treeview', 'treethongke'); if ($idRoot == null) { $this->setLayout('hoso_404'); } else { $root['root_id'] = $idRoot; $tmp = $model->getThongtin(array('name, type'), 'ins_dept', null, array('id=' . $root['root_id']), null); $root['root_name'] = $tmp[0]->name; $root['root_showlist'] = $tmp[0]->type; } $this->assignRef('root_info', $root); }
/** * 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 fetchButton($type = 'Acyactions') { $url = JURI::base() . "index.php?option=com_acymailing&ctrl=filter&tmpl=component"; $top = 0; $left = 0; $width = 700; $height = 500; $text = JText::_('ACTIONS'); if (!ACYMAILING_J30) { $class = "icon-32-acyaction"; } else { $class = "icon-14-acyaction"; } $js = "\r\nfunction getAcyActionUrl() {\r\n\ti = 0;\r\n\tmylink = 'index.php?option=com_acymailing&ctrl=filter&tmpl=component&subid=';\r\n\twhile(window.document.getElementById('cb'+i)){\r\n\t\tif(window.document.getElementById('cb'+i).checked)\r\n\t\t\tmylink += window.document.getElementById('cb'+i).value+',';\r\n\t\ti++;\r\n\t}\r\n\treturn mylink;\r\n}\r\n"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); if (!ACYMAILING_J30) { JHTML::_('behavior.modal', 'a.modal'); return '<a href="' . $url . '" class="modal" onclick="this.href=getAcyActionUrl();" rel="{handler: \'iframe\', size: {x: ' . $width . ', y: ' . $height . '}}"><span class="' . $class . '" title="' . $text . '"></span>' . $text . '</a>'; } $html = '<button class="btn btn-small modal" data-toggle="modal" data-target="#modal-' . $type . '"><i class="' . $class . '"></i> ' . $text . '</button>'; $params['title'] = $text; $params['url'] = '\'+getAcyActionUrl()+\''; //$url; $params['height'] = $height; $params['width'] = $width; $modalHtml = JHtml::_('bootstrap.renderModal', 'modal-' . $type, $params); $html .= str_replace(array('id="modal-' . $type . '"'), array('id="modal-' . $type . '" style="width:' . ($width + 20) . 'px;height:' . ($height + 90) . 'px;margin-left:-' . ($width + 20) / 2 . 'px"'), $modalHtml); $html .= '<script>' . "\r\n" . 'jQuery(document).ready(function(){jQuery("#modal-' . $type . '").appendTo(jQuery(document.body));});' . "\r\n" . '</script>'; return $html; }
/** * RETURN PAY HTML FORM * */ function onTP_GetHTML($vars) { $vars = $this->preFormatingData($vars); $plgPaymentEpaydkHelper = new plgPaymentEpaydkHelper(); // Split the name in first and last name $user = JFactory::getUser(); $nameParts = $user->name; // explode(' ', $user->name, 2); $firstName = $user->name; $lastName = $user->name; // Get the base URL without the path $rootURL = rtrim(JURI::base(), '/'); $subpathURL = JURI::base(true); if (!empty($subpathURL) && $subpathURL != '/') { $rootURL = substr($rootURL, 0, -1 * strlen($subpathURL)); } // Separate URL variable as it cannot be a part of the md5 checksum $url = $this->getPaymentURL(); $data = array('merchant' => $this->getMerchantID(), 'success' => $vars->return, 'cancel' => $vars->cancel_return, 'postback' => $vars->notify_url, 'orderid' => $vars->order_id, 'currency' => strtoupper($vars->currency_code), 'amount' => $vars->amount * 100, 'cardtypes' => implode(',', $this->params->get('cardtypes', array())), 'instantcapture' => '1', 'instantcallback' => '1', 'language' => $this->params->get('language', '0'), 'ordertext' => 'Order id' . ' - [ ' . $vars->order_id . ' ]', 'windowstate' => '3', 'ownreceipt' => '0', 'md5' => $this->params->get('secret', '')); if ($this->params->get('md5', 1)) { // Security hash - must be compiled from ALL inputs sent $data['md5'] = md5(implode('', $data)); } else { $data['md5'] = ''; } $data['actionURL'] = $url; // dont make md5 $data['submiturl'] = $vars->submiturl; // Set array as object for compatability $data = (object) $data; $html = $this->buildLayout($data); return $html; }
function sp_divider_addon($atts, $content) { extract(spAddonAtts(array('divider_type' => '', 'margin_top' => '', 'margin_bottom' => '', 'border_color' => '', 'border_style' => '', 'border_width' => '', 'divider_image' => '', 'background_repeat' => '', 'background_position' => '', 'divider_height' => '', 'class' => ''), $atts)); $style = ''; $style1 = ''; $style2 = ''; if ($margin_top) { $style .= 'margin-top:' . (int) $margin_top . 'px;'; } if ($margin_bottom) { $style .= 'margin-bottom:' . (int) $margin_bottom . 'px;'; } if ($border_color) { $style1 .= 'border-bottom-color:' . $border_color . ';'; } if ($border_style) { $style1 .= 'border-bottom-style:' . $border_style . ';'; } if ($border_width) { $style1 .= 'border-bottom-width:' . (int) $border_width . 'px;'; } if ($divider_height) { $style2 .= 'height:' . (int) $divider_height . 'px;'; } if ($divider_image) { $style2 .= 'background-image: url(' . JURI::base(true) . '/' . $divider_image . ');background-repeat:' . $background_repeat . ';background-position:50% 50%;'; } if ($divider_type == 'image') { $output = '<div class="sppb-divider sppb-divider-' . $divider_type . '" style="' . $style . ' ' . $style2 . '"></div>'; } else { $output = '<div class="sppb-divider sppb-divider-' . $divider_type . '" style="' . $style . ' ' . $style1 . '"></div>'; } return $output; }
function fetchButton($type = 'Acytags', $newstype = 'news') { $url = JURI::base() . "index.php?option=com_acymailing&ctrl=tag&task=tag&tmpl=component&type=" . $newstype; $top = 0; $left = 0; $width = 780; $height = 550; $text = JText::_('TAGS'); if (!ACYMAILING_J30) { $class = "icon-32-tag"; } else { $class = "icon-14-tag"; } if (!ACYMAILING_J30) { JHTML::_('behavior.modal'); $html = "<a class=\"modal\" onclick=\"try{IeCursorFix();}catch(e){}\" href=\"{$url}\" rel=\"{handler: 'iframe', size: {x: {$width}, y: {$height}}}\">\n"; $html .= "<span class=\"{$class}\" title=\"{$text}\"></span>{$text}</a>\n"; return $html; } $html = '<button class="btn btn-small modal" data-toggle="modal" data-target="#modal-' . $type . '"><i class="' . $class . '"></i> ' . $text . '</button>'; $params['title'] = $text; $params['url'] = $url; $params['height'] = $height; $params['width'] = $width; $modalHtml = JHtml::_('bootstrap.renderModal', 'modal-' . $type, $params); $html .= str_replace(array('id="modal-' . $type . '"'), array('id="modal-' . $type . '" style="width:' . ($width + 20) . 'px;height:' . ($height + 90) . 'px;margin-left:-' . ($width + 20) / 2 . 'px"'), $modalHtml); $html .= '<script>' . "\r\n" . 'jQuery(document).ready(function(){jQuery("#modal-' . $type . '").appendTo(jQuery(document.body));});' . "\r\n" . '</script>'; return $html; }
public function postflight(){ define('_FM_COM', 'com_profiles'); if(!defined('DS')) define('DS',DIRECTORY_SEPARATOR); $lang = JFactory::getLanguage(); define('_MY_LANGUAGE',$lang->getTag()); define('_CLOSE_HREF','index.php'); $ABSOLUTE_URI = (getenv('HTTPS') == 'on') ? substr_replace( str_replace("http://", "https://", JURI::base() ), '', -1, 1) : substr_replace(JURI::base(), '', -1, 1) . "/"; define('_FM_ABSOLUTE_URI',$ABSOLUTE_URI); define('_FM_HOME_URL', "index.php?option="._FM_COM."&format=raw"); define('_FM_HOME_FOLDER','components/'._FM_COM.'/filemanager'); define('_FM_HOME_DIR', JPATH_ROOT . '/administrator/components/'._FM_COM.'/filemanager'); define('_FM_LANGUAGE_DIR', _FM_HOME_DIR. DS.'languages'); define('_FM_COOKIE_EXPIRE', time()+60*60*24*60); // Define Peer define('_FM_PEER','joomla'); require_once _FM_HOME_DIR . DS . 'classes'.DS.'file.php'; require_once _FM_HOME_DIR . DS . 'classes'.DS.'text.php'; require_once _FM_HOME_DIR . DS .'includes'.DS.'version.php'; $infoTemplates = _FM_HOME_DIR . DS ."languages" . DS . "info"; $infoPath = $infoTemplates . DS . _MY_LANGUAGE . ".php" ; if(!MFile::is($infoPath)){ $infoPath = $infoTemplates . DS . "en-GB.php"; } $isWelcome = 1; $jed = null; $version=null; require_once $infoPath; } //EOF install
/** * Get the JavaScript command for the button * * @param object $definition Button definition * @return string JavaScript command string * @since 11.1 */ protected function _getCommand($name, $url, $width, $height, $top, $left) { if (substr($url, 0, 4) !== 'http') { $url = JURI::base() . $url; } return $url; }
/** * looking for image inside the media folder. * heave size XS, XL, S, M, L, Generic */ public function lookingForK2Image($item, $size = 'XL') { //Image $item->imageK2Image = ''; if (JFile::exists(JPATH_SITE . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_' . $size . '.jpg')) $item->imageK2Image = JURI::base() . 'media/k2/items/cache/' . md5("Image" . $item->id) . '_' . $size . '.jpg'; return $item; }
protected function getInput() { $document = JFactory::getDocument(); $option = JRequest::getCmd('option'); $globalValue = $this->_getPhocaParams($this->element['name']); JHTML::stylesheet('administrator/components/com_phocadownload/assets/jcp/picker.css'); $document->addScript(JURI::base(true) . '/components/com_phocadownload/assets/jcp/picker.js'); // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : ''; $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : ''; // Initialize JavaScript field attributes. $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'); // TODO 1.6 // MENU - Set Default value to "" because of saving "" value into the menu link ( use global = "") if ($option == "com_menus") { $DefaultValue = (string) $this->element['default']; if ($value == $DefaultValue) { $value = ''; } } $html = '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . $value . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>'; // Color Picker $nameCP = str_replace('[', '_', $this->name); $nameCP = str_replace(']', '', $nameCP); $html .= '<span style="margin-left:10px" onclick="openPicker(\'' . $nameCP . '\')" class="picker_buttons">' . JText::_('COM_PHOCADOWNLOAD_PICK_COLOR') . '</span>'; // MENU - Display the global value if ($option == "com_menus") { $html .= '<span style="margin-left:10px;">[</span><span style="background:#fff"> ' . $globalValue . ' </span><span>]</span>'; } return $html; }
function display($tpl = null) { $app = JFactory::getApplication(); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); //Frontend Changes $tUri = ''; if (!$app->isAdmin()) { $tUri = JURI::base(); } $document = JFactory::getDocument(); $uri =& JFactory::getURI(); JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css'); $eName = JRequest::getVar('e_name'); $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $tmpl['categories'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinkcats&tmpl=component&e_name=' . $eName; //$tmpl['COM_PHOCAGALLERY_CATEGORY'] = 'index.php?option=com_phocagallery&view=phocagallerylinkcat&tmpl=component&e_name='.$eName; $tmpl['images'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinkimg&type=2&tmpl=component&e_name=' . $eName; $tmpl['image'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinkimg&type=1&tmpl=component&e_name=' . $eName; $tmpl['switchimage'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinkimg&type=3&tmpl=component&e_name=' . $eName; $tmpl['slideshow'] = $tUri . 'index.php?option=com_phocagallery&view=phocagallerylinkimg&type=4&tmpl=component&e_name=' . $eName; $this->assignRef('tmpl', $tmpl); parent::display($tpl); }
function __construct(&$subject, $config) { $app = JFactory::getApplication(); if ($app->isAdmin()) { return; } $version = new JVersion(); $joomla_main_version = substr($version->RELEASE, 0, strpos($version->RELEASE, '.')); if ($version->PRODUCT == 'Joomla!' and $joomla_main_version != '3') { throw new Exception(JText::_('PLG_CONTENT_SIGE_NEEDJ3'), 404); } parent::__construct($subject, $config); $this->loadLanguage('plg_content_sige', JPATH_ADMINISTRATOR); if (isset($_SESSION['sigcount'])) { unset($_SESSION['sigcount']); } if (isset($_SESSION['sigcountarticles'])) { unset($_SESSION['sigcountarticles']); } $this->absolute_path = JPATH_SITE; $this->live_site = JURI::base(); if (substr($this->live_site, -1) == '/') { $this->live_site = substr($this->live_site, 0, -1); } $this->plugin_parameter = array(); }
/** * fetch Element */ protected function getInput() { if (!defined('LOF_LOADMEDIACONTROL')) { define('LOF_LOADMEDIACONTROL', 1); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator/", "", $uri); JHTML::stylesheet($uri . "/media/" . 'form.css'); JHTML::script($uri . "/media/" . 'form.js'); } if ($this->title == 'end_form') { ?> <script type="text/javascript"> var panels = $$("#module-form .pane-sliders > .panel").fade("out").removeClass("panel").addClass("lof-panel"); var div = new Element("div", {"class":"lof-wrapper"}); var container = new Element("div", {"class":"lof-container"}); container.innerHTML='<fieldset class="fs-form"><legend><?php echo JText::_("Module Setting"); ?> </legend><div class="lof-toolbars"></div><div class="lof-fscontainer"></div></legend></fieldset>'; var _toolbar = container.getElement(".lof-toolbars"); var _container = container.getElement(".lof-fscontainer"); $$("#module-form .pane-sliders").adopt( div.adopt(container) ); new LofForm(panels, _toolbar, _container ); </script> <?php } // $text = (string)$this->element['text']?(string)$this->element['text']:''; /// return '<div class="lof-header">'.JText::_($text).'</div>'; }
function display() { $tpl = JRequest::getVar('tpl'); // Add toolbar buttons JToolBarHelper::title(JText::_('JOOMLAPACK') . ': <small><small>' . JText::_('DBEF') . '</small></small>'); JToolBarHelper::back('Back', 'index.php?option=' . JRequest::getCmd('option')); JToolBarHelper::spacer(); $bar =& JToolBar::getInstance('toolbar'); switch ($tpl) { case 'tab': JToolBarHelper::deleteList(); $bar->appendButton('Link', 'preview', JText::_('NORMALVIEW'), 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view')); break; case '': default: $bar->appendButton('Link', 'preview', JText::_('TABULARVIEW'), 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=tab'); break; } JToolBarHelper::spacer(); JoomlapackHelperUtils::addLiveHelp('dbef'); if ($tpl == 'tab') { $model =& $this->getModel('Dbef'); $task = JRequest::getCmd('task', 'default'); $list =& $model->getRecordsList(); $this->assignRef('list', $list); $this->assignRef('pagination', $model->getPagination()); $this->assignRef('class', $model->_filterclass); } $document =& JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'components/com_joomlapack/assets/css/joomlapack.css'); parent::display($tpl); }
private function format(&$articles, $params) { if (!$articles) { return; } foreach ($articles as $article) { $category = JTable::getInstance('Category'); $category->load($article->catid); $article->category = $category; $article->permalink = ContentHelperRoute::getArticleRoute($article->id . ':' . $article->alias, $article->catid); $article->permalink = JRoute::_($article->permalink); $article->category->permalink = ContentHelperRoute::getCategoryRoute($category->id . ':' . $category->alias); $article->category->permalink = JRoute::_($article->category->permalink); $article->content = empty($article->introtext) ? $article->fulltext : $article->introtext; $titleLength = $params->get('title_length'); $contentLength = $params->get('content_length'); if ($titleLength) { $article->title = JString::substr($article->title, 0, $titleLength); } // Try to get image of the article $image = $this->processContentImage($article->content); if ($image) { $article->image = $image; } if ($contentLength) { $article->content = JString::substr(strip_tags($article->content), 0, $contentLength) . ' ...'; } else { $base = JURI::base(true) . '/'; $protocols = '[a-zA-Z0-9]+:'; //To check for all unknown protocals (a protocol must contain at least one alpahnumeric fillowed by : $regex = '#(src|href|poster)="(?!/|' . $protocols . '|\\#|\')([^"]*)"#m'; $article->content = preg_replace($regex, "\$1=\"{$base}\$2\"", $article->content); } } }
/** * Returns the payment form to be submitted by the user's browser. The form must have an ID of * "paymentForm" and a visible submit button. * * @param string $paymentmethod * @param JUser $user * @param AkeebasubsTableLevel $level * @param AkeebasubsTableSubscription $subscription * @return string */ public function onAKPaymentNew($paymentmethod, $user, $level, $subscription) { if ($paymentmethod != $this->ppName) { return false; } $nameParts = explode(' ', $user->name, 2); $firstName = $nameParts[0]; if (count($nameParts) > 1) { $lastName = $nameParts[1]; } else { $lastName = ''; } $slug = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->setId($subscription->akeebasubs_level_id)->getItem()->slug; $rootURL = rtrim(JURI::base(), '/'); $subpathURL = JURI::base(true); if (!empty($subpathURL) && $subpathURL != '/') { $rootURL = substr($rootURL, 0, -1 * strlen($subpathURL)); } $kuser = F0FModel::getTmpInstance('Users', 'AkeebasubsModel')->user_id($user->id)->getFirstItem(); $data = (object) array('url' => $this->getPaymentURL(), 'merchant' => $this->params->get('merchant', ''), 'postback' => JURI::base() . 'index.php?option=com_akeebasubs&view=callback&paymentmethod=skrill', 'success' => $rootURL . str_replace('&', '&', JRoute::_('index.php?option=com_akeebasubs&view=message&slug=' . $slug . '&layout=order&subid=' . $subscription->akeebasubs_subscription_id)), 'cancel' => $rootURL . str_replace('&', '&', JRoute::_('index.php?option=com_akeebasubs&view=message&slug=' . $slug . '&layout=cancel&subid=' . $subscription->akeebasubs_subscription_id)), 'currency' => strtoupper(AkeebasubsHelperCparams::getParam('currency', 'EUR')), 'firstname' => $firstName, 'lastname' => $lastName, 'country' => $this->translateCountry($kuser->country)); @ob_start(); include dirname(__FILE__) . '/skrill/form.php'; $html = @ob_get_clean(); return $html; }
/** * onAfterInitialise * * @return void */ public function onAfterInitialise() { $input = JFactory::getApplication()->input; $akmarkdown = $input->getVar('akmarkdown'); if ($akmarkdown) { $text = $input->post->getRaw('data'); $text = $this->render($text); // SEF $base = JURI::base(true) . '/'; $regex = '#href="index.php\\?([^"]*)#m'; $text = preg_replace_callback($regex, array('plgSystemAkmarkdown', 'route'), $text); // To check for all unknown protocals (a protocol must contain at least one alpahnumeric fillowed by : $protocols = '[a-zA-Z0-9]+:'; $regex = '#(src|href|poster)="(?!/|' . $protocols . '|\\#|\')([^"]*)"#m'; $text = preg_replace($regex, "\$1=\"{$base}\$2\"", $text); // Replace some text $text = str_replace('<a', '<a target="_blank"', $text); echo <<<STYLE <style> img { max-width: 550px; } </style> STYLE; echo $text; jexit(); } $upload = $input->get('akmarkdown_upload'); if ($upload) { include_once __DIR__ . '/lib/autoload.php'; Akmarkdown\Uploader\ImageUploader::upload($input); jexit(); } }
/** * Get the JavaScript command for the button * * @param string $url URL for popup * * @return string JavaScript command string * * @since 3.0 */ private function _getCommand($url) { if (substr($url, 0, 4) !== 'http') { $url = JURI::base() . $url; } return $url; }
function __construct(&$subject, $config) { $this->loadLanguage('plg_content_sige', JPATH_ADMINISTRATOR); $version = new JVersion(); if($version->PRODUCT == 'Joomla!' AND $version->RELEASE != '2.5') { JError::raiseWarning(100, JText::_('PLG_CONTENT_SIGE_NEEDJ25')); return; } parent::__construct($subject, $config); if(isset($_SESSION["sigcount"])) { unset($_SESSION["sigcount"]); } if(isset($_SESSION["sigcountarticles"])) { unset($_SESSION["sigcountarticles"]); } $this->_absolute_path = JPATH_SITE; $this->_live_site = JURI::base(); if(substr($this->_live_site, -1) == "/") { $this->_live_site = substr($this->_live_site, 0, -1); } $this->_params = array(); }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3import('core.admin.util'); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); if (!defined('_JA_THEME')) { define('_JA_THEME', 1); $html = "<link href=\"{$uri}/assets/css/jathemesettings.css\" rel=\"stylesheet\" type=\"text/css\" />\n"; $html .= "<script type=\"text/javascript\" src=\"{$uri}/assets/js/jathemesettings.js\"></script>\n"; echo $html; } $objutil = new JAT3_AdminUtil(); $template = $objutil->template; $themes = $objutil->getThemes($template); $value = $this->value; $name = $this->fieldname; if ($value && $themes) { if ((!isset($themes['core']) || isset($themes['core']) && !in_array($value, $themes['core'])) && (!isset($themes['local']) || isset($themes['local']) && !in_array($value, $themes['local']))) { $value = isset($themes['local'][0]) ? $themes['local'][0] : $themes['core'][0]; } } $layout = dirname(__FILE__) . DS . 'tmpl' . DS . 'jathemesettings.php'; if (file_exists($layout)) { ob_start(); include $layout; $content = ob_get_clean(); return $content; } return ''; }
/** * * process input params * @return string element param */ protected function getInput() { if (!defined('_JA_PARAM_HELPER')) { define('_JA_PARAM_HELPER', 1); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator/", "", $uri); //mootools support joomla 1.7 and 2.5 JHTML::_('behavior.framework', true); JHTML::stylesheet($uri . '/assets/css/japaramhelper.css'); JHTML::script($uri . '/assets/js/japaramhelper.js'); } $func = (string) $this->element['function'] ? (string) $this->element['function'] : ''; $value = $this->value ? $this->value : (string) $this->element['default']; // var_dump($func); die; if (substr($func, 0, 1) == '@') { $func = substr($func, 1); if (method_exists($this, $func)) { return $this->{$func}(); } } else { $subtype = isset($this->element['subtype']) ? trim($this->element['subtype']) : ''; if (method_exists($this, $subtype)) { return $this->{$subtype}(); } } return; }
/** * Method to get the field input markup. * * @return string The field input markup. */ protected function getInput() { if (!defined('_JA_PARAM_HELPER_T3')) { define('_JA_PARAM_HELPER_T3', 1); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); $javersion = new JVersion(); if ($javersion->RELEASE == '1.7') { JHtml::_('behavior.framework', true); } else { JHTML::_('behavior.mootools'); } JHTML::stylesheet($uri . '/assets/css/japaramhelper.css'); JHTML::script($uri . '/assets/js/japaramhelper.js'); } $func = (string) $this->element['function'] ? (string) $this->element['function'] : ''; $value = $this->value ? $this->value : (string) $this->element['default']; if (substr($func, 0, 1) == '@') { $func = substr($func, 1); if (method_exists($this, $func)) { return $this->{$func}(); } } else { $subtype = isset($this->element['subtype']) ? trim($this->element['subtype']) : ''; if (method_exists($this, $subtype)) { return $this->{$subtype}(); } } return; }
/** * Render action * @param array $params * @return null|string */ public function render($params = array()) { // init vars $this->_uri = JURI::base(); $this->_path = JPATH_ROOT . '/' . trim($this->config->get('directory'), '/') . '/' . trim($this->_data->get('value'), '/'); // set params $parameter = $this->app->parameter->create()->loadArray((array) $this->config)->loadArray($params); // get thumbnails $thumbs = $this->_getThumbnails($parameter); // no thumbnails found if (!count($thumbs)) { return null; } // sort thumbnails $thumbs = $this->_sortThumbnails($thumbs, $parameter->get('order', 'asc')); // limit thumbnails to count $count = intval($parameter->get('count', 0)); if ($count > 0 && $count < count($thumbs)) { $thumbs = array_slice($thumbs, 0, $count); } // init template vars $rel = $galleryId = 'gallery-' . self::$galleryCount++; // render layout if ($layout = $this->getLayout()) { return self::renderLayout($layout, compact('thumbs', 'galleryId', 'rel')); } return null; }
public static function icons($data, $params) { $icons = array(); $url = urldecode(JRoute::_(strstr($data->link, 'index.php'))); $url = rtrim(JURI::base(), '/') . $url; if ($params->get('btn_like')) { // Facebook Like $icons[] = '<span class="ns2-share-icon"><div class="fb-like" data-href="' . $url . '" data-send="false" data-layout="button_count" data-width="80" data-show-faces="false"></div></span>'; if (defined('_NS2LIKE')) { define('_NS2LIKE', 1); echo '<div id="fb-root"></div>'; JFactory::getDocument()->addScriptDeclaration(' (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=354400064582736"; fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\')); '); } } if ($params->get('btn_twitter')) { //Twitter Button $icons[] = '<span class="ns2-share-icon"><a href="https://twitter.com/share" class="twitter-share-button" data-text="' . $data->title . '" data-url="' . $url . '">Tweet</a></span>'; JFactory::getDocument()->addScript('http://platform.twitter.com/widgets.js'); } if ($params->get('btn_gplus')) { // Goolge Plus Button $icons[] = '<span class="ns2-share-icon"><g:plusone href="' . $url . '" size="medium"></g:plusone></span>'; JFactory::getDocument()->addScript('https://apis.google.com/js/plusone.js'); } return $icons; }
function plgSystemmyApiOpenGraph(&$subject, $config){ parent::__construct($subject, $config); if(!class_exists('plgSystemmyApiConnect')) return; $cache = & JFactory::getCache('plgSystemmyApiOpenGraph - FB Admins query'); $cache->setCaching( 1 ); $config =& JFactory::getConfig(); $connect_plugin =& JPluginHelper::getPlugin('system', 'myApiConnect'); $connect_params = new JParameter( $connect_plugin->params ); $plugin =& JPluginHelper::getPlugin('system', 'myApiOpenGraph'); $plugin_params = new JParameter( $plugin->params ); $db_admins = $cache->call( array( 'plgSystemmyApiOpenGraph', 'getFbAdmins')); $param_admins = ($plugin_params->get('fbadmins') != '') ? explode(',',$plugin_params->get('fbadmins')) : array(); $admins = array_merge($db_admins,$param_admins); $ogptags_default = array(); $ogptags_default['og:title'] = $config->getValue( 'config.sitename' ); $ogptags_default['og:type'] = 'website'; $ogptags_default['og:url'] = JURI::getInstance()->toString(); $ogptags_default['og:site_name'] = $config->getValue( 'config.sitename' ); $ogptags_default['fb:app_id'] = $connect_params->get('appId'); $ogptags_default['fb:admins'] = implode(',',$admins); if($plugin_params->get('ogimage') != '' && $plugin_params->get('ogimage') != -1) $ogptags_default['og:image'] = JURI::base().'images/'.$plugin_params->get('ogimage'); if($plugin_params->get('fbpageid') != '') $ogptags_default['fb:page_id'] = $plugin_params->get('fbpageid'); plgSystemmyApiOpenGraph::setTags($ogptags_default); }
function display() { // Decide what to do; delegate data loading to private methods $task = JRequest::getCmd('task', 'display'); $layout = JRequest::getCmd('layout', 'default'); switch ($layout) { case 'default_edit': switch ($task) { case 'add': $helpfile = 'eff'; JToolBarHelper::title(JText::_('JOOMLAPACK') . ': <small><small>' . JText::_('EFF_PAGETITLE_NEW') . '</small></small>'); $this->_add(); break; case 'edit': $helpfile = 'eff'; JToolBarHelper::title(JText::_('JOOMLAPACK') . ': <small><small>' . JText::_('EFF_PAGETITLE_EDIT') . '</small></small>'); $this->_edit(); break; } break; default: $helpfile = 'eff'; JToolBarHelper::title(JText::_('JOOMLAPACK') . ': <small><small>' . JText::_('EXTRADIRS') . '</small></small>'); $this->_default(); break; } // Load the util helper $this->loadHelper('utils'); $document =& JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'components/com_joomlapack/assets/css/joomlapack.css'); // Add a spacer, a help button and show the template JToolBarHelper::spacer(); JoomlapackHelperUtils::addLiveHelp('$helpfile'); parent::display(); }
/** * Ajax function to save a new wall entry * * @param message A message that is submitted by the user * @param uniqueId The unique id for this group * * */ function onProfileDisplay() { //Load language file. JPlugin::loadLanguage('plg_community_myarticles', JPATH_ADMINISTRATOR); // Attach CSS $document = JFactory::getDocument(); $css = JURI::base() . 'plugins/community/myarticles/myarticles/style.css'; $document->addStyleSheet($css); if (JRequest::getVar('task', '', 'REQUEST') == 'app') { $app = 1; } else { $app = 0; } $user = CFactory::getRequestUser(); $userid = $user->id; $def_limit = $this->params->get('count', 10); $limit = JRequest::getVar('limit', $def_limit, 'REQUEST'); $limitstart = JRequest::getVar('limitstart', 0, 'REQUEST'); $row = $this->getArticle($userid, $limitstart, $limit, $this->section); $cat = $this->getCatAlias(); $total = $this->countArticle($userid, $this->section); if ($this->params->get('hide_empty', 0) && !$total) { return ''; } $mainframe = JFactory::getApplication(); $caching = $this->params->get('cache', 1); if ($caching) { $caching = $mainframe->getCfg('caching'); } $cache = JFactory::getCache('plgCommunityMyArticles'); $cache->setCaching($caching); $callback = array('plgCommunityMyArticles', '_getArticleHTML'); $content = $cache->call($callback, $userid, $limit, $limitstart, $row, $app, $total, $cat, $this->params); return $content; }
public function onAdd($tpl = null) { $media_folder = JURI::base() . '../media/com_akeeba/'; // Get a JSON representation of GUI data $json = AkeebaHelperEscape::escapeJS(AEUtilInihelper::getJsonGuiDefinition(), '"\\'); $this->assignRef('json', $json); // Get profile ID $profileid = AEPlatform::getInstance()->get_active_profile(); $this->assign('profileid', $profileid); // Get profile name $profileName = FOFModel::getTmpInstance('Profiles', 'AkeebaModel')->setId($profileid)->getItem()->description; $this->assign('profilename', $profileName); // Get the root URI for media files $this->assign('mediadir', AkeebaHelperEscape::escapeJS($media_folder . 'theme/')); // Are the settings secured? if (AEPlatform::getInstance()->get_platform_configuration_option('useencryption', -1) == 0) { $this->assign('securesettings', -1); } elseif (!AEUtilSecuresettings::supportsEncryption()) { $this->assign('securesettings', 0); } else { JLoader::import('joomla.filesystem.file'); $filename = JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/serverkey.php'; if (JFile::exists($filename)) { $this->assign('securesettings', 1); } else { $this->assign('securesettings', 0); } } // Add live help AkeebaHelperIncludes::addHelp('config'); }
/** * @param $cData * @param $shipTo */ function __construct($cData, $shipTo) { $this->shipTo = $shipTo; $this->country = $cData['country_code']; $this->country_code_3 = $cData['country_code_3']; $this->currency = $cData['currency_code']; $this->virtuemart_currency_id = $cData['virtuemart_currency_id']; //$this->currency = $vendor_currency; // Get EID and Secret $this->eid = $cData['eid']; $this->secret = $cData['secret']; $this->lang = $cData['language_code']; // Is Invoice enabled? $this->enabled = TRUE; // Set modes $this->mode = $cData['mode']; $this->ssl = KlarnaHandler::getKlarnaSSL($this->mode); $this->web_root = JURI::base(); try { $this->klarna = new Klarna_virtuemart(); $this->klarna->config($this->eid, $this->secret, $this->country, $this->lang, $this->currency, $this->mode, VMKLARNA_PC_TYPE, KlarnaHandler::getKlarna_pc_type(), $this->ssl); } catch (Exception $e) { VmError('klarna_payments', $e); unset($this->klarna); } }
public function display() { $category = $this->getService('com://site/weblinks.model.categories')->getItem(); $items = $this->getService('com://site/weblinks.model.weblinks')->catid(KRequest::get('get.id', 'int'))->getList(); $xml = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL; $xml .= '<rss version="2.0">' . PHP_EOL; $xml .= '<channel>' . PHP_EOL; $xml .= ' <title>' . $category->title . '</title>' . PHP_EOL; $xml .= ' <description><![CDATA[' . $category->description . ']]></description>' . PHP_EOL; $xml .= ' <link>' . KRequest::url() . '</link>' . PHP_EOL; $xml .= ' <lastBuildDate>' . date('r') . '</lastBuildDate>' . PHP_EOL; $xml .= ' <generator>' . JURI::base() . '</generator>' . PHP_EOL; $xml .= ' <language>' . JFactory::getLanguage()->getTag() . '</language>' . PHP_EOL; foreach ($items as $item) { $xml .= ' <item>' . PHP_EOL; $xml .= ' <title>' . htmlspecialchars($item->title) . '</title>' . PHP_EOL; $xml .= ' <link>' . JURI::base() . JRoute::_('index.php?option=com_weblinks&view=weblink&id=' . $item->id) . '</link>' . PHP_EOL; $xml .= ' <guid>' . JURI::base() . JRoute::_('index.php?option=com_weblinks&view=weblink&id=' . $item->id) . '</guid>' . PHP_EOL; $xml .= ' <description><![CDATA[' . htmlspecialchars($item->description) . ']]></description>' . PHP_EOL; $xml .= ' <category>' . $category->title . '</category>' . PHP_EOL; $xml .= ' <pubDate>' . date('r', strtotime($item->date)) . '</pubDate>' . PHP_EOL; $xml .= ' </item>' . PHP_EOL; } $xml .= '</channel>' . PHP_EOL; $xml .= '</rss>'; $this->output = $xml; return parent::display(); }