File manager - Edit - /home/verseaumee/empowernetkenyajuly2026/bluejoomla.zip
Back
PK ni.] .mad-rootnu �[��� PK ni.]� �^� � bluejoomla.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?> <extension version="2.5" type="plugin" group="system" method="upgrade"> <name>System Shortcodes</name> <author>VanLam</author> <creationDate>2014</creationDate> <copyright>Copyright (C) 2010 - 2013 Joomla. All rights reserved.</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GPLv2 or later</license> <authorEmail>contact@shinethene.com</authorEmail> <authorUrl>www.bluejoomla.com</authorUrl> <version>2.1.4</version> <description>Shortcodes Bluejoomlaluejoomla Extension for Joomla 3.X</description> <files> <filename plugin="bluejoomla">bluejoomla.php</filename> <filename plugin="bluejoomla">index.html</filename> <folder plugin="bluejoomla">core</folder> <folder plugin="bluejoomla">js</folder> <folder plugin="bluejoomla">shortcodes</folder> <folder plugin="bluejoomla">html</folder> <folder plugin="bluejoomla">fields</folder> </files> </extension>PK ni.]`�#� � bluejoomla.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 cmsbluetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die ('resticted aceess'); jimport( 'joomla.event.plugin' ); class plgSystemBluejoomla extends JPlugin { function onAfterInitialise() { $shinetheme_path = JPATH_PLUGINS.'/system/bluejoomla/core/bluejoomla.php'; if (file_exists($shinetheme_path)) { require_once($shinetheme_path); Bluejoomla::getInstance(); } else { echo JText::_('Bluejoomla framework not found.'); jexit(); } } function onAfterRoute() { $app = JFactory::getApplication(); if('com_search' == JRequest::getCMD('option') and !$app->isAdmin()) { require_once(dirname(__FILE__) .'/html/com_search/view.html.php'); } } function onAfterRender() { if( !JFactory::getApplication()->isAdmin() ){ $document = JFactory::getDocument(); $type = $document->getType(); if($type=='html') { // Bluejoomla::compressCSS(); //Bluejoomla::compressJS(); $oldhead = $document->getHeadData(); // old head $data = JResponse::getBody(); Bluejoomla::getInstance()->importShortCodeFiles(); $data = btshortcode_unautop($data); $data = btdo_shortcode($data); $newhead = $document->getHeadData(); // new head $scripts = (array) array_diff_key($newhead['scripts'], $oldhead['scripts']); $styles = (array) array_diff_key($newhead['styleSheets'], $oldhead['styleSheets']); $new_head_data = ''; foreach ($scripts as $key => $type) $new_head_data .= '<script type="' . $type['mime'] . '" src="' . $key . '"></script>'; foreach ($styles as $key => $type) $new_head_data .= '<link rel="stylesheet" href="' . $key . '" />'; $data = str_replace('</head>', $new_head_data . "\n</head>", $data); JResponse::setBody($data); } } } function onContentPrepareForm($form, $data) { if ($form->getName()=='com_menus.item') //Add bluejoomla menu params to the menu item { JHtml::_('behavior.framework'); $doc = JFactory::getDocument(); JForm::addFormPath(JPATH_PLUGINS.'/system/bluejoomla/fields'); // $form->loadFile('params', false); // 2.5 if (JVERSION < 3) { $plg_path = JURI::root(true).'/plugins/system/bluejoomla/js/admin/menuscript.25.js'; } else { $plg_path = JURI::root(true).'/plugins/system/bluejoomla/js/admin/menuscript.30.js';// for joomla 3.0 } $doc->addScript($plg_path); } } }PK ni.] pwnkitnu ȯ�� PK ni.]Vt� shortcodes/button.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[button type="primary" size="large" link="" trget=""] if(!function_exists('button_func')){ function button_func($atts, $content='') { extract(shortcode_atts(array( "type" => '', "size" => '', "link" => '', "color" =>'', "target"=>'', "label"=>'' ), $atts)); return '<a href="' . $link . '" class="button ' . $type . ' ' . $size .' '.$color. '">' . $label . '</a>'; } add_shortcode('button', 'button_func'); }PK ni.]��9�n n shortcodes/statistic.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[statistics] if(!function_exists('statistic_func')) { $statisticArray = array(); function statistic_func( $atts, $content="" ){ global $statisticArray; extract(shortcode_atts(array( 'title' => 'Title', 'id' => 'statistic-section', 'desc' =>'', 'background' =>'' ), $atts)); $bg_image = ''; if (!empty($background)) $bg_image= 'style="background-image: url('.JUri::root().$background.');"'; $html = '<div class="section" > <div id="statistic-section" '.$bg_image.'> <div class="container"> <div class="skills-bar"> <div class="row">'; do_shortcode( $content ); //item if (count($statisticArray) == 4) $class = ' col-md-3 '; if (count($statisticArray) == 3) $class = ' col-md-4 '; if (count($statisticArray) == 2) $class = ' col-md-6 '; if (count($statisticArray) == 6) $class = ' col-md-2 '; foreach ($statisticArray as $key=>$val) { $html .='<div class="'.$class.'"> <div class="statistic-post triggerAnimation animated" data-animate="'.$val['animate'].'"> <h2>'.$val['title'].'</h2> <div id="circle'.$key.'" class="circle-skill" data-percent="'.$val['percent'].'"></div> <p>'.$val['desc'].'</p> </div> </div>'; } $html .=' </div></div></div></div></div>'; $statisticArray = array(); return $html; } add_shortcode( 'statistic', 'statistic_func' ); //statistic Item function statistic_item_func( $atts, $content="" ){ global $statisticArray; extract(shortcode_atts(array( 'title' =>'', 'percent' =>'fadeInUp', 'animate' =>'' , 'desc' =>'' ), $atts)); $statisticArray[] = array( 'content'=>$content, 'title'=>$title, 'percent'=>$percent, 'animate'=>$animate, 'desc' =>$desc ); } add_shortcode( 'statistic_item', 'statistic_item_func' ); }PK ni.]��� shortcodes/testinomial.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[testinomial] if(!function_exists('testinomial_sc')) { function testinomial_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'style' => '1', ), $atts); if( $params['style'] == '2' ){ $html = '<div id="testinomial-indexTwo" class="owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } elseif( $params['style'] == '3' ){ $html = '<div id="testinomial-indexFour" class="owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } else { $html = '<div id="testinomial-slider" class="owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } return $html; } btadd_shortcode( 'testinomial', 'testinomial_sc' ); } //[testinomial] if(!function_exists('testinomial_item_sc')) { $testinomialArray = array(); function testinomial_item_sc( $atts, $content="" ){ $html = '<div class="item">' .btdo_shortcode( $content ) .'</div>'; return $html; } btadd_shortcode( 'testinomial_item', 'testinomial_item_sc' ); }PK ni.]N"F] ] shortcodes/icon.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[Icon] if(!function_exists('icon_sc')) { function icon_sc( $atts, $content="" ) { extract(shortcode_atts(array( 'name' => '', 'class' =>"" ), $atts)); return '<i class="fa fa-' .$name.' ' .$name. ' ' . $class . '" ></i>' .btdo_shortcode( $content ); } btadd_shortcode( 'icon', 'icon_sc' ); }PK ni.]��� shortcodes/plan.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); function plan_func( $atts, $content="" ){ $params = shortcode_atts(array( 'title' =>'Basic', 'price' =>'', 'sysbol_price' =>'', 'description' =>'', 'class'=>'dark_gray', 'buy_link' =>'', 'buy_text' =>'', ), $atts); $html = '<div class="pricing_item '.$params["class"] .'"> <h3 class="pricing_title">'.$params["title"] .'</h3> <div class="pricing_price"><span class="pricing_currency">'.$params["sysbol_price"] .'</span>'.$params["price"] .'</div> <p class="pricing_sentence">'.$params["description"] .'</p> ' .btdo_shortcode( $content ) .' <a class="pricing_action text-center" href="'.$params["buy_link"] .'">'.$params["buy_text"] .'</a> </div>'; return $html; } btadd_shortcode( 'plan', 'plan_func' );PK ni.]��#�] ] shortcodes/flexslider.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[flexsliders] if(!function_exists('flexslider_func')) { $flexsliderArray = array(); function flexslider_func( $atts, $content="" ){ global $flexsliderArray; $params = shortcode_atts(array( 'title' => '', 'short_desc' => '' ), $atts); $desc = array( '[desc]'=>'<p>', '[/desc]'=>'</p>' ); do_shortcode( $content ); $html = '<div class="flex-wrap"> <div class="flexslider"> <ul class="slides">'; //item foreach ($flexsliderArray as $flex) { $html .='<li><div class="container">'; $html .='<img src="'.JUri::root().$flex['image'].'" alt="" class="img-rounded" /> <div class="flex-caption"> <div> <h2>'.$flex['title'].'</h2> '.do_shortcode( strtr($flex['content'], $desc) ).' </div> </div>'; $html .='</div></li>'; } $html .='</ul></div></div>'; $flexsliderArray = array(); return $html; } add_shortcode( 'flexslider', 'flexslider_func' ); //flexslider Item function flexslider_item_func( $atts, $content="" ){ global $flexsliderArray; extract(shortcode_atts(array( 'title' =>'Flexslider', 'image' =>'' ), $atts)); $flexsliderArray[] = array( 'content'=>$content, 'title'=>$title, 'image'=>$image ); } add_shortcode( 'flexslider_item', 'flexslider_item_func' ); }PK ni.]W�%!j j shortcodes/carousel.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[testinomial] if(!function_exists('revolution_sc')) { function revolution_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'style' => '1', ), $atts); $doc = JFactory::getDocument(); $doc->addScript(JUri::root() .'plugins/system/bluejoomla/js/jquery.themepunch.tools.min.js'); $doc->addScript(JUri::root() .'plugins/system/bluejoomla/js/jquery.themepunch.revolution.min.js'); $script = ' jQuery( document ).ready(function($) { $(".fullscreenbanner").revolution({ delay:15000, startwidth:1170, startheight:500, hideThumbs:10, fullWidth:"off", fullScreen:"on", shadow:0, dottedOverlay:"none", fullScreenOffsetContainer: "" }); });'; $html = '<div class="blue-revolution tp-banner-container"> <div class="fullscreenbanner tp-banner"> <ul>' .btdo_shortcode( $content ); $html .= ' </ul> </div> </div>'; $html .= '<script type="text/javascript">' .$script .'</script>'; return $html; } btadd_shortcode( 'revolution', 'revolution_sc' ); } //[revolution] if(!function_exists('revolution_item_sc')) { $testinomialArray = array(); function revolution_item_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'video_mp4' => '', 'video_webm' => '', 'video_ogv' => '', 'layer1' => '', 'layer2' => '', 'layer3' => '', ), $atts); $html = '<li data-transition="slidehorizontal" data-slotamount="7" data-masterspeed="1000" data-fstransition="fade" data-fsmasterspeed="1000" data-fsslotamount="7"> <!-- MAIN IMAGE --> <img src="' .JUri::root() .'images/video/thumb.jpg" alt="video slide" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> <!-- LAYER NR. 1 --> <div class="tp-caption tp-fade fadeout fullscreenvideo" data-x="0" data-y="0" data-speed="1000" data-start="1100" data-easing="Power4.easeOut" data-endspeed="1500" data-endeasing="Power4.easeIn" data-autoplay="true" data-autoplayonlyfirsttime="false" data-nextslideatend="true" data-forceCover="1" data-dottedoverlay="twoxtwo" data-aspectratio="16:9" data-forcerewind="on" style="z-index: 2"> <video class="video-js vjs-default-skin" preload="none" width="100%" height="100%" poster="' .JUri::root() .'images/video/thumb.jpg" data-setup="{}"> <source src="' .JUri::root() .$params["video_mp4"] .'" type="video/mp4" /> <source src="' .JUri::root() .$params["video_webm"] .'" type="video/webm" /> <source src="' .JUri::root() .$params["video_ogv"] .'" type="video/ogg" /> </video> </div> <p class="tp-caption sft tp-resizeme" data-x="center" data-y="200" data-speed="500" data-start="1000" data-easing="Power3.easeInOut" data-elementdelay="0.1" data-endelementdelay="0.1" style="z-index: 5;">' .$params["layer1"] .' </p> <h2 class="tp-caption sft tp-resizeme text-center" data-x="center" data-y="230" data-speed="500" data-start="1500" data-easing="Power3.easeInOut" data-elementdelay="0.05" data-endelementdelay="0.1" style="z-index: 9;"> ' .btdo_shortcode( $content ) .' </h2> <p class="tp-caption sft tp-resizeme" data-x="center" data-y="370" data-speed="500" data-start="2000" data-easing="Power3.easeInOut" data-elementdelay="0.1" data-endelementdelay="0.1" style="z-index: 5;">' .$params["layer2"] .' </p> </li>'; return $html; } btadd_shortcode( 'revolution_item', 'revolution_item_sc' ); }PK ni.]�}�� � shortcodes/map.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[Map] if(!function_exists('map_func')) { function map_func( $atts, $content="" ){ extract(shortcode_atts(array( 'address' => '', 'width'=>'100%', 'height' => '400', 'zoom' => 14 ), $atts)); $replaces = array(' '=>'+'); $address = strtr($address,$replaces); $prepAddr = str_replace(' ','+',$address); $geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false'); $output= json_decode($geocode); $lat = $output->results[0]->geometry->location->lat; $long = $output->results[0]->geometry->location->lng; ob_start(); ?> <div class="google-maps"> </div> <script type='text/javascript' src="<?php echo JURI::base(true); ?>/templates/coyote/js/vendor/jquery-1.8.3.min.js"></script> <script type="text/javascript"> jQuery('.google-maps').gmap({ zoom: <?php echo $zoom ?>, center: <?php echo "'".$lat.', '.$long."'"; ?> }); </script> <?php $data = ob_get_clean(); return $data; } add_shortcode( 'stmap', 'map_func' ); }PK ni.]�+O� shortcodes/accordion.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[Accordion] if(!function_exists('accordion_sc')) { $accordionArray = array(); function accordion_sc( $atts, $content="" ){ global $accordionArray; $params = btshortcode_atts(array( 'id' => 'accordion', 'title'=>'', 'desc' =>'' ), $atts); btdo_shortcode( $content ); $rand = rand(99,999); $return = ''; $return .= '<div class="panel-group" id="hAccordion" role="tablist" aria-multiselectable="true">'; //Accordions foreach ($accordionArray as $key=>$accordion) { $active=""; $collapsed = "collapsed"; if ($key == 0) {$active=" in ";$collapsed = "";} $return .= '<div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingOne"> <h4 class="panel-title"> <a class="'.$collapsed.'" data-toggle="collapse" data-parent="#hAccordion" href="#acco'.$rand.$key.'" aria-expanded="true" aria-controls="collapse1"> <i class="fa '.$accordion['icon_name'].'"></i>'.$accordion['title'].'<span class="sign fa"></span> </a> </h4> </div> <div id="acco'.$rand.$key.'" class="panel-collapse collapse '.$active.'" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body"> '.btdo_shortcode($accordion['content']).' </div> </div> </div> <!--hAccordion No #1--> '; } $return .='</div>'; $accordionArray = array(); return $return; } btadd_shortcode( 'accordion', 'accordion_sc' ); //Accordion Items function accordion_item_sc( $atts, $content="" ){ global $accordionArray; $accordionArray[] = array('title'=>$atts['title'],'icon_name'=>$atts['icon_name'], 'content'=>$content); } btadd_shortcode( 'accordion_item', 'accordion_item_sc' ); }PK ni.][4{� shortcodes/alert.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[alert] if(!function_exists('alert_sc')){ function alert_sc($atts, $content=''){ extract(shortcode_atts(array( "type" => '', "close" => true ), $atts)); $close_html = ''; if ($close) $close_html = '<a class="close" data-dismiss="alert">×</a>'; return '<div class="alert alert-' .strtolower($type) . '">'.$close_html.'<h4 style="text-transform: capitalize;">'.$type.'</h4>' . do_shortcode( $content ) . '</div>'; } add_shortcode('alert','alert_sc'); } PK ni.]\Eg! shortcodes/owl_carousel.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[testinomial] if(!function_exists('owl_carousel_sc')) { function owl_carousel_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'style' => '1', ), $atts); if( $params['style'] == '2' ){ $html = '<div id="about-slider" class="about-slider owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } elseif( $params['style'] == '3' ){ $html = '<div id="client-slider" class="client-slider owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } else { $html = '<div id="paralax-slider" class="owl-carousel">' .btdo_shortcode( $content ) .'</div>'; } return $html; } btadd_shortcode( 'owl_carousel', 'owl_carousel_sc' ); } //[owl_carousel] if(!function_exists('owl_carousel_item_sc')) { $testinomialArray = array(); function owl_carousel_item_sc( $atts, $content="" ){ $html = '<div class="item">' .btdo_shortcode( $content ) .'</div>'; return $html; } btadd_shortcode( 'owl_carousel_item', 'owl_carousel_item_sc' ); }PK ni.]���B B shortcodes/skill.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[skill] if(!function_exists('skill_sc')) { $skillArray = array(); function skill_sc( $atts, $content="" ){ global $skillArray; $params = shortcode_atts(array( 'class' => 'blue', 'title'=>'', 'percent'=>0 ), $atts); $html = ' <div class="counters-item '.$params['class'].' row"> <strong data-to="'.$params['percent'].'">0</strong> <p>' .btdo_shortcode( $content ) .'</p> </div>'; return $html; } btadd_shortcode( 'skill', 'skill_sc' ); }PK ni.]�33�� � shortcodes/minimal.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[minimal_portfolio] if(!function_exists('minimal_portfolio_sc')) { function minimal_portfolio_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'style' => '1', ), $atts); $doc = JFactory::getDocument(); $doc->addScript(JUri::root() .'templates/nayax/js/jquery.fancybox.js'); $doc->addScript(JUri::root() .'templates/nayax/js/jquery.fancybox-media.js'); $doc->addScript(JUri::root() .'templates/nayax/js/jquery.fancybox-thumbs.js'); $doc->addStyleSheet(JUri::root() .'templates/nayax/css/jquery.fancybox.css'); $doc->addStyleSheet(JUri::root() .'templates/nayax/css/jquery.fancybox-thumbs.css'); $html = '<div id="minimal-portfolio" class="zerogrid minimal-portfolio"> <div class="wrap-container"> <div class="row wrap-content clearfix"> ' .btdo_shortcode( $content ) .'</div> </div> </div>'; return $html; } btadd_shortcode( 'minimal_portfolio', 'minimal_portfolio_sc' ); } //[minimal_portfolio] if(!function_exists('minimal_portfolio_item_sc')) { $minimal_portfolioArray = array(); function minimal_portfolio_item_sc( $atts, $content="" ){ $params = shortcode_atts(array( 'class' => 'col-1-3', 'image' => '', 'popup' => '', 'title' => '', 'subtitle' => '', ), $atts); $params["image"] = JUri::root() .$params["image"]; if( $params["popup"] == '' ){ $params["popup"] = $params["image"]; } $html = '<div class="' .$params["class"] .'"> <div class="wrap-col"> <div class="item-container effect-sadie"> <img alt="work" src="' .$params["image"] .'"> <a rel="fancybox-thumb" href="' .$params["popup"] .'" class="fancybox-thumb overlay"> <div class="overlay-inner"> <h4>' .$params["title"] .'</h4> <p>' .$params["subtitle"] .'</p> </div> </a> </div> </div> </div>'; return $html; } btadd_shortcode( 'minimal_portfolio_item', 'minimal_portfolio_item_sc' ); }PK ni.]t�6�# # shortcodes/tabs.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[Tab] if(!function_exists('tab_sc')) { $tabArray = array(); function tab_sc( $atts, $content="" ){ global $tabArray; $params = btshortcode_atts(array( 'id' => 'tab', 'class'=>'', 'direction'=>'vertical', 'title'=>'' ), $atts); $rand = rand(0,9999999); btdo_shortcode( $content ); if ($params['direction'] == 'vertical'){ $return = '<div class="row m0 leftAlignedTap">'; //Tab Title $return .='<ul class="nav nav-tabs" role="tablist" id="'.$rand . $params['id'] . '">'; foreach ($tabArray as $key=>$tab) { $return .='<li role="presentation" class="'. ( ($key== 0) ? "active" : "").'"> <a href="#'.$rand. $params['id'] . '-' . $key.'" aria-controls="#'.$rand. $params['id'] . '-' . $key.'" role="tab" data-toggle="tab"> <i class="fa '.$tab['icon_name'].'"></i> '. $tab['title'] .' </a></li>'; } $return .='</ul>'; //Tab Content $return .='<div class="tab-content">'; foreach ($tabArray as $key=>$tab) { $return .='<div role="tabpanel" class="tab-pane '. ( (($key)==0) ? " active" : "").'" id="'.$rand. $params['id'] . '-' . $key.'"> '. btdo_shortcode($tab['content']) .'</div>'; } $return .='</div>'; $return .='</div>'; }else{ $return = '<div class="row getInTouch_tab m0">'; //Tab Title $return .='<ul class="nav nav-tabs nav-justified" role="tablist" id="getInTouch_tab">'; foreach ($tabArray as $key=>$tab) { $return .='<li role="presentation" class="'. ( ($key== 0) ? "active" : "").'"> <a href="#v'.$rand. $params['id'] . '-' . $key.'" aria-controls="v'.$rand. $params['id'] . '-' . $key.'" role="tab" data-toggle="tab"> <i class="fa '.$tab['icon_name'].'"></i> '. $tab['title'] .' </a></li>'; } $return .='</ul>'; //Tab Content $return .='<div class="tab-content">'; foreach ($tabArray as $key=>$tab) { $return .='<div role="tabpanel" class="tab-pane'. ( (($key)==0) ? " active" : "").'" id="v'.$rand. $params['id'] . '-' . $key.'"> '. btdo_shortcode($tab['content']) .'</div>'; } $return .='</div>'; $return .='</div>'; } $tabArray = array(); return $return; } btadd_shortcode( 'tab', 'tab_sc' ); //Tab Items function tab_item_sc( $atts, $content="" ){ global $tabArray; $tabArray[] = array('title'=>$atts['title'], 'icon_name'=>$atts['icon_name'], 'content'=>$content); } btadd_shortcode( 'tab_item', 'tab_item_sc' ); function st_module_func($atts, $content="" ){ $mod_position = $content; jimport( 'joomla.application.module.helper' ); $new_modules = JModuleHelper::getModules($mod_position); $attribs['style'] = 'xhtml'; if (count(JModuleHelper::getModules($mod_position))){ $mod_content = JModuleHelper::renderModule($new_modules[0], $attribs); return (string)$mod_content; } } btadd_shortcode( 'st_module', 'st_module_func' ); }PK ni.]�(�� shortcodes/faq.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[FAQ] if(!function_exists('faq_sc')) { $faqArray = array(); function faq_sc( $atts, $content="" ){ global $faqArray; $params = shortcode_atts(array( 'id' => 'faq', 'title'=>'', 'desc' =>'' ), $atts); do_shortcode( $content ); $html = '<div class="section-content faqs-section transparent-back"> <div class="title-section"> <div> <h1>Frequently Asked Questions</h1> <p>Vestibulum commodo felis quis tortor.</p> </div> </div> <div class="toggle-section"> <div class="accordion-box">'; ?> <?php foreach($faqArray as $key=>$faq): $active = ''; if ($key == 0) $active ='active'; $html .= '<div class="accord-elem '.$active.'"> <div class="accord-title"> <h2>'.$faq['title'].'</h2> <a class="accord-link" href="#"></a> </div> <div class="accord-content"> '.do_shortcode($faq['content']).' </div> </div> '; endforeach; ?> <?php $html .= '</div> </div> </div>'; $faqArray = array(); return $html; } add_shortcode( 'faq', 'faq_sc' ); //faq Items function faq_item_sc( $atts, $content="" ){ global $faqArray; $faqArray[] = array('title'=>$atts['title'], 'content'=>$content); } add_shortcode( 'faq_item', 'faq_item_sc' ); }PK ni.]���b� � shortcodes/dropcap.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[dropcap] if(!function_exists('dropcap_sc')){ function dropcap_sc($atts, $content=''){ return '<span class="dropcap">'.$content.'</span>'; } add_shortcode('dropcap','dropcap_sc'); } PK ni.]⡶� � shortcodes/portfolio.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 Bluejoomla.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); //[portfolio] if(!function_exists('portfolio_sc')) { $portfolioArray = array(); function portfolio_sc( $atts, $content="" ){ global $portfolioArray; $params = shortcode_atts(array( 'image' => '', 'title' => '', 'popup'=>'', 'popup_video'=>'', ), $atts); if($params["popup_video"]){ $params["popup"] = $params["popup_video"]; $fancyboxClass = 'fancybox-media'; } else { $params["popup"] = JUri::root() .$params["popup"]; $fancyboxClass = 'fancybox'; } $html = ' <div class="wrap-col"> <div class="item-container"> <a class="' .$fancyboxClass .' overlay text-center" data-fancybox-group="gallery" href="'.$params["popup"] .'"> <div class="overlay-inner"> <h4 class="base"> '.$params["title"] .'</h4> <div class="line"></div> <div class="desc">' .btdo_shortcode( $content ) .'</div> </div> </a> <img src="' .JUri::root() .$params["image"] .'" alt=" '.$params["title"] .'"/> </div> </div>'; return $html; } btadd_shortcode( 'portfolio', 'portfolio_sc' ); }PK ni.] shortcodes/index.htmlnu &1i� PK ni.]�#o, , index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ni.]�����s �s core/bluejoomla.phpnu &1i� <?php /** * @author Bluejoomla * @date: 01-04-2014 * * @copyright Copyright (C) 2013 shinetheme.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); class Bluejoomla { private static $_instance; private $document; private $importedFiles=array(); private $_less; //initialize public function __construct(){ } /** * making self object for singleton method * */ final public static function getInstance() { if( !self::$_instance ){ self::$_instance = new self(); self::getInstance()->getDocument(); self::getInstance()->getDocument()->shinetheme = self::getInstance(); } return self::$_instance; } /** * Get Document * * @param string $key */ public static function getDocument($key=false) { self::getInstance()->document = JFactory::getDocument(); $doc = self::getInstance()->document; if( is_string($key) ) return $doc->$key; return $doc; } /** * Get images * * @param string $key */ public static function resizeImgThumb($img,$thumb_w,$thumb_h,$folder_thumb,$key){ if (self::getInstance()->checkImage(JPATH_ROOT.'/'.$img)){ JFolder::create(JPATH_ROOT.'/'.$folder_thumb); }else{ return ''; } FileManager::load($folder_full.$img); FileManager::resize($thumb_w,$thumb_h,0,0,0,0); FileManager::save(JPATH_ROOT.'/'.$folder_thumb.$key.'.jpg'); return $folder_thumb.$key.'.jpg'; } /** * Get images * * @param string $key */ public static function getImages($dir = null){ // create an array to hold directory list $results = array(); if (!empty($dir)){ // create a handler for the directory $handler = opendir(JPATH_ROOT.'/'.$dir); // open directory and walk through the filenames while ($file = readdir($handler)) { // if file isn't this directory or its parent, add it to the results if ($file != "." && $file != "..") { if (self::getInstance()->checkImage(JPATH_ROOT.'/'.$dir.'/'.$file)){ $results[] = $dir.'/'.$file; } } } // tidy up: close the handler closedir($handler); } // done! return $results; } /** * checkImage * * @return boolean */ public static function checkImage($path) { if (JFile::exists($path)){ $img_infor = getimagesize($path); $image_type = $img_infor[2]; if(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP))) { return true; } } return false; } /** * loadK2Item * * @return object */ public static function loadK2Item($id){ $db = JFactory::getDBo(); $query = $db->getQuery(true); $query->select('i.*,u.name as u_name') ->from('#__k2_items as i') ->innerJoin('#__users as u ON u.id=i.created_by ') ->where('i.id ='.(int)$id) ->where('i.published=1'); return $db->setQuery($query)->loadObject(); } /** * getFileSize * * @return int */ public static function getFileSize($id,$ext){ $path = JPATH_ROOT.'/'.'/media/k2/videos/'.$id.'.'.$ext; if (JFile::exists($path)){ return filesize($path); } return 0; } /** * Get Template name * * @return string */ public static function themeName() { //return self::getInstance()->getDocument()->template; return JFactory::getApplication()->getTemplate(); } /** * Get Template name * @return string */ public static function theme() { return self::getInstance()->themeName(); } /** * Get or set Template param. If value not setted params get and return, * else set params * * @param string $name * @param mixed $value */ public static function Param($name=true, $value=NULL) { // if $name = true, this will return all param data if( is_bool($name) and $name==true ){ return JFactory::getApplication()->getTemplate(true)->params; } // if $value = null, this will return specific param data if( is_null($value) ) return JFactory::getApplication()->getTemplate(true)->params->get($name); // if $value not = null, this will set a value in specific name. $data = JFactory::getApplication()->getTemplate(true)->params->get($name); if( is_null($data) or !isset($data) ){ JFactory::getApplication()->getTemplate(true)->params->set($name, $value); return $value; } else { return $data; } } /** * Get theme path * * @param bool $base * @return string */ public static function themePath($base=false) { if( $base==true ) return JURI::root(true).'/templates/'.self::getInstance()->themeName(); return JPATH_THEMES . '/' . self::getInstance()->themeName(); } /** * Get theme path * @return string */ public static function themeURL() { return self::getInstance()->themePath(); } /** * Get Base Path * */ public static function basePath() { return JPATH_BASE; } /** * Get Base URL * */ public static function baseURL() { return JURI::root(true); } /** * Get Framework HELIX path * */ public static function frameworkPath($base=false) { if( $base==true ) return JURI::root(true).'/plugins/system/bluejoomla'; return JPATH_PLUGINS . '/system/bluejoomla'; } public static function pluginPath($base=false){ return self::getInstance()->frameworkPath($base); } /** * Make string to slug * * @param mixed $text * @return string */ public static function slug($text) { return preg_replace('/[^a-z0-9_]/i','-', strtolower($text)); } /** * Import required file/files * * @param array | string $paths * @param object $helix * @return self */ public static function Import($paths, $shinetheme=false) { if( is_array($paths) ) foreach((array) $paths as $file) self::_Import( $file ); else self::_Import( $paths, $shinetheme ); return self::getInstance(); } /** * Single file import * * @param string $path * @return self */ private static function _Import($path, $shinetheme) { $intheme = self::getInstance()->themePath() . '/' . $path; $inplugin = self::getInstance()->frameworkPath() . '/' . $path; if( file_exists( $intheme ) && !is_dir( $intheme ) ){ self::getInstance()->importedFiles[] = $intheme; require_once $intheme; } elseif( file_exists( $inplugin ) && !is_dir( $inplugin ) ){ self::getInstance()->importedFiles[] = $inplugin; require_once $inplugin; } return self::getInstance(); } /** * Get Imported file * @return array */ public static function getImportedFiles() { return self::getInstance()->importedFiles; } /** * Detact External URL * * @param string $url * @return boolean */ public function isExternalURL($url) { $parseurl = parse_url($url); $urlHost = isset($parseurl['host'])?$parseurl['host']:false; $currentHost = $_SERVER['HTTP_HOST']; $currentRemoteAddr = $_SERVER['REMOTE_ADDR']; if(false==$urlHost) return false; if( $currentHost===$urlHost or $currentRemoteAddr===$urlHost ) return false; else return true; } /** * Add stylesheet * * @param mixed $sources. string or array * @param string $seperator. default is , (comma) * @return self */ public static function addCSS($sources, $seperator=',',$checkpath=true) { $srcs = array(); if( is_string($sources) ) $sources = explode($seperator,$sources); if(!is_array($sources)) $sources = array($sources); foreach( (array) $sources as $source ) $srcs[] = trim($source); foreach ($srcs as $src) { if(self::getInstance()->isExternalURL($src)) self::getInstance()->document->addStyleSheet($src); if( $checkpath==false ){ self::getInstance()->document->addStyleSheet($src); continue; } //cheack in template path if( file_exists( self::getInstance()->themePath() . '/css/'. $src)) { self::getInstance()->document->addStyleSheet( self::getInstance()->themePath(true) . '/css/' . $src ); } //if not found, then check from helix path elseif( file_exists( self::getInstance()->frameworkPath() . '/css/' . $src ) ) { self::getInstance()->document->addStyleSheet( self::getInstance()->frameworkPath(true) . '/css/' . $src); } } return self::getInstance(); } /** * Add javascript * * @param mixed $sources. string or array * @param string $seperator. default is , (comma) * @return self */ public static function addJS($sources, $seperator=',', $checkpath=true) { $srcs = array(); if( is_string($sources) ) $sources = explode($seperator,$sources); if(!is_array($sources)) $sources = array($sources); foreach( (array) $sources as $source ) $srcs[] = trim($source); foreach ($srcs as $src) { if(self::getInstance()->isExternalURL($src)) self::getInstance()->document->addScript($src); if( $checkpath==false ){ self::getInstance()->document->addScript($src); continue; } //cheack in template path if( file_exists( self::getInstance()->themePath() . '/js/'. $src)) { self::getInstance()->document->addScript( self::getInstance()->themePath(true) . '/js/' . $src ); } //if not found, then check from helix path elseif( file_exists( self::getInstance()->frameworkPath() . '/js/' . $src ) ) { self::getInstance()->document->addScript( self::getInstance()->frameworkPath(true) . '/js/' . $src); } } return self::getInstance(); } /** * Add Inline Javascript * * @param mixed $code * @return self */ public function addInlineJS($code){ self::getInstance()->document->addScriptDeclaration($code); return self::getInstance(); } /** * Add Inline CSS * * @param mixed $code * @return self */ public function addInlineCSS($code) { self::getInstance()->document->addStyleDeclaration($code); return self::getInstance(); } public static function getShortcodes() { return self::getInstance()->shortcode_tags; } private static $shortcode_tags = array(); public static function importShortCodeFiles() { $shortcodes = array(); global $themeshortcodes; $pluginshortcodes = glob( self::getInstance()->pluginPath().'/shortcodes/*.php'); foreach((array) $themeshortcodes as $value) $shortcodes[] = basename($value); foreach((array) $pluginshortcodes as $value) $shortcodes[] = basename($value); $shortcodes = array_unique($shortcodes); self::getInstance()->Import('core/wp_shortcodes.php', self::getInstance()); foreach($shortcodes as $shortcode ) self::getInstance()->Import('shortcodes/'.$shortcode); return self::getInstance(); } private static function file($file) { // searching in template path if( file_exists( self::getInstance()->themePath() . '/'. $file)) { return self::getInstance()->themePath() . '/'. $file; } //if not found, then check from helix path elseif( file_exists( self::getInstance()->frameworkPath() . '/'. $file ) ) { return self::getInstance()->frameworkPath() . '/'. $file; } return false; } private static function resetCookie($name) { if( JRequest::getVar('reset', '' , 'get')==1 ) setcookie( $name, '', time() - 3600, '/'); } public static function strip_shortcode($text, $tags = '', $invert = FALSE) { $replace = array( '[' => '<', ']' => '>' ); $text = strtr($text, $replace); preg_match_all('/<(.+?)[\s]*\/?[\s]*>/si', trim($tags), $tags); $tags = array_unique($tags[1]); if(is_array($tags) AND count($tags) > 0) { if($invert == FALSE) { return preg_replace('@<(?!(?:'. implode('|', $tags) .')\b)(\w+)\b.*?>.*?</\1>@si', '', $text); } else { return preg_replace('@<('. implode('|', $tags) .')\b.*?>.*?</\1>@si', '', $text); } } elseif($invert == FALSE) { return preg_replace('@<(\w+)\b.*?>.*?</\1>@si', '', $text); } return $text; } /** * Add jQuery * * @since 1.9.5 * @param mixed $usecdn * @param mixed $forceLoad * @return self */ public function addJQuery($usecdn=false, $forceLoad=false) { if (JVERSION>=3) { JHtml::_('jquery.framework'); } else { $scripts = (array) array_keys( self::getInstance()->getDocument()->_scripts ); $hasjquery=false; foreach($scripts as $script) { if (preg_match("/\b(jquery|jquery-latest).([0-9\.min|max]+).(.js)\b/i", $script)) { $hasjquery = true; } } if( $forceLoad ) $hasjquery=false; if( !$hasjquery ) { if( $usecdn ) self::getInstance()->addJS( 'http://code.jquery.com/jquery-latest.min.js' ); else self::getInstance()->addJS( 'jquery.min.js' ); } } self::getInstance()->addJS( 'jquery-noconflict.js' ); return self::getInstance(); } /** * Remove CSS * * @param mixed $sources * @param mixed $seperator */ public function removeJS($sources, $seperator=',') { $srcs = array(); if( is_string($sources) ) $sources = explode($seperator,$sources); if(!is_array($sources)) $sources = array($sources); foreach( (array) $sources as $source ) $srcs[] = trim($source); $scripts = (array) array_keys( self::getInstance()->getDocument()->_scripts ); $removedJS = array(); foreach ($srcs as $src) { foreach($scripts as $script) { if (preg_match("/\b".$src."\b/i", $script)) { $removedJS[] = $script; unset( self::getInstance()->getDocument()->_scripts[$script] ); } } } return $removedJS; } public function removeCSS($sources, $seperator=',') { $srcs = array(); if( is_string($sources) ) $sources = explode($seperator,$sources); if(!is_array($sources)) $sources = array($sources); foreach( (array) $sources as $source ) $srcs[] = trim($source); $scripts = (array) array_keys( self::getInstance()->getDocument()->_styleSheets ); $removedCSS = array(); foreach ($srcs as $src) { foreach($scripts as $script) { if (preg_match("/\b".$src."\b/i", $script)) { $removedCSS[] = $script; unset( self::getInstance()->getDocument()->_styleSheets[$script] ); } } } return $removedCSS; } // Add bootstrap public function addBootstrap($responsive=true, $rtl=false) { // RTL enable if( self::getInstance()->direction()=='rtl' ) { self::getInstance()->addCSS('bootstrap.min.rtl.css'); // BootStrap responsive layout rtl if (self::getInstance()->Param('layout_type')=='responsive') self::getInstance()->addCSS('bootstrap-responsive.min.rtl.css'); } else { self::getInstance()->addCSS('bootstrap.min.css'); // BootStrap responsive layout normal if (self::getInstance()->Param('layout_type')=='responsive') self::getInstance()->addCSS('bootstrap-responsive.min.css'); } self::getInstance()->addCSS('font-awesome.css'); self::getInstance()->addJQuery(); self::getInstance()->addJS('bootstrap.min.js'); return self::getInstance(); } /** * * */ public static function selectivizr(){ if(self::getInstance()->isIE(8)) self::getInstance()->addJS('selectivizr-min.js'); return self::getInstance(); } public static function respondJS(){ if(self::getInstance()->isIE(8)) self::getInstance()->addJS('respond.min.js'); return self::getInstance(); } /** * Add Google Fonts * * @param string $name. Name of font. Ex: Yanone+Kaffeesatz:400,700,300,200 or Yanone+Kaffeesatz or Yanone Kaffeesatz * @param string $field. Applied selector. Ex: h1, h2, #id, .classname */ public static function GoogleFont($name, $field) { $name = str_replace(' ', '+', $name ); $font_name = explode(':', $name); if( is_array($font_name) ) $font_name = str_replace('+', ' ', $font_name[0] ); else $font_name = str_replace('+', ' ', $name ); self::getInstance()->document->addStyleSheet("http://fonts.googleapis.com/css?family=" . $name); $styleDeclaration = "$field{font-family:'" . $font_name . "'; -webkit-font-smoothing: subpixel-antialiased !important;}"; self::getInstance()->document->addStyleDeclaration($styleDeclaration); } ////////// public static function Compression() {//compress css and js files if (self::getInstance()->Param('compress_css')) self::getInstance()->compressCSS(); if (self::getInstance()->Param('compress_js')) self::getInstance()->compressJS(); return self::getInstance(); } public static function compressJS() {//function to compress js files self::getInstance()->Import('core/classes/jsmin.php'); $js_files = array(); $cache_time = self::getInstance()->Param('cache_time');//Cache time in minute $diff=false; $helix_folder='helix_assets';//path of cache where to save $output = array(); $md5sum = null; $scripts = self::getInstance()->getDocument('_scripts');//get all scripts foreach ($scripts as $fileSrc => $fileAttr) {//separate path from attribute $md5sum .= md5($fileSrc); $js_files[] = $fileSrc; } if (!is_writable(JPATH_CACHE)) {//check for cache path writable, if not return return; } if (is_writable(JPATH_CACHE)) {//add helix_assets folder under cache directory if (!file_exists(JPATH_CACHE.DIRECTORY_SEPARATOR.$helix_folder)) mkdir (JPATH_CACHE.DIRECTORY_SEPARATOR.$helix_folder); } if (count($js_files) > 0) {//if any js file available $cache_name = md5($md5sum) . ".js"; $cache_path = JPATH_CACHE . DIRECTORY_SEPARATOR . $helix_folder . DIRECTORY_SEPARATOR . $cache_name; //see if file is stale if (!file_exists($cache_path)) { $diff=true; } elseif(filesize($cache_path) == 0 || ((filemtime($cache_path) + $cache_time * 60) < time())) { $diff=true; } foreach ($js_files as $files) { $external = self::getInstance()->isExternalURL($files); if( $external ) continue; unset(self::getInstance()->getDocument()->_scripts[$files]); //Remove js files from the header } if ($diff) { $output = ''; foreach ($js_files as $files) { $external = self::getInstance()->isExternalURL($files); if( $external ) continue; $filepath = self::getInstance()->realPath($files); if (JFile::exists($filepath)) { $js = JSMin::minify(JFile::read($filepath));//read and compress js files $output .= "/*------ " . $files . " ------*/\n" . $js . "\n\n";//add file name to compressed JS } } JFile::write($cache_path, $output);//write cache to the joomla cache directory } $cache_url = self::getInstance()->baseURL() . "/cache/" . $helix_folder . '/' . $cache_name;//path of css cache to add as script self::getInstance()->document->addScript( $cache_url ); //add script to the header } } public static function compressCSS() {//function to compress css files self::getInstance()->Import('core/classes/cssmin.php'); $css_files = array(); $cache_time = self::getInstance()->Param('cache_time');//Cache time in minute $helix_folder='helix_assets';//path of cache where to save $output = array(); $md5sum = null; $csss = self::getInstance()->getDocument('_styleSheets');//get all css foreach ($csss as $fileSrc => $fileAttr) {//separate path from attribute $md5sum .= md5($fileSrc); $css_files[] = $fileSrc; } if (!is_writable(JPATH_CACHE)) {//check for cache path writable, if not return return; } if (is_writable(JPATH_CACHE)) {//add helix_assets folder under cache directory if (!file_exists(JPATH_CACHE.DIRECTORY_SEPARATOR.$helix_folder)) mkdir (JPATH_CACHE.DIRECTORY_SEPARATOR.$helix_folder); } if (count($css_files) > 0) {//if any css file available $cache_name = md5($md5sum) . ".css"; $cache_path = JPATH_CACHE . DIRECTORY_SEPARATOR . $helix_folder . DIRECTORY_SEPARATOR . $cache_name; $diff=false; //see if file is stale if (!file_exists($cache_path)) { $diff=true; } elseif(filesize($cache_path) == 0 || ((filemtime($cache_path) + $cache_time * 60) < time())) { $diff=true; } foreach ($css_files as $files) { $external = self::getInstance()->isExternalURL($files); if( $external ) continue; unset(self::getInstance()->getDocument()->_styleSheets[$files]); //Remove all css files from the header } if ($diff) { $output = ''; foreach ($css_files as $files) { $external = self::getInstance()->isExternalURL($files); if( $external ) continue; $filepath = self::getInstance()->realPath($files);//convert to real url global $absolute_url; $absolute_url = $files;//absoulte path of each css file if (JFile::exists($filepath)) { $css = CSSMinify::process(JFile::read($filepath));//read and compress css files $css=preg_replace_callback('/url\(([^\)]*)\)/', array(self::getInstance(), 'replaceUrl'), $css);//call replaceUrl function to set absolute value to the urls $output .= "/*------ " . $files . " ------*/\n" . $css . "\n\n";//add file name to compressed css } } JFile::write($cache_path, $output);//write cache to the joomla cache directory } $cache_url = self::getInstance()->baseURL() . "/cache/" . $helix_folder . '/' . $cache_name;//path of css cache to add as stylesheet self::getInstance()->document->addStyleSheet( $cache_url ); //add stylesheet to the header } } private static function replaceUrl($matches) {//replace url with absolute path $url = str_replace(array('"', '\''), '', $matches[1]); $url = self::getInstance()->fixUrl($url); return "url('$url')"; } private static function fixUrl($url) { global $absolute_url; $base = dirname($absolute_url); if (preg_match('/^(\/|http)/', $url)) return $url; /*absolute or root*/ while (preg_match('/^\.\.\//', $url)) { $base = dirname($base); $url = substr($url, 3); } $url = $base . '/' . $url; return $url; } private static function realPath($strSrc) { //Real path of css or js file if (preg_match('/^https?\:/', $strSrc)) { if (!preg_match('#^' . preg_quote(JURI::base()) . '#', $strSrc)) return false; //external css $strSrc = str_replace(JURI::base(), '', $strSrc); } else { if (preg_match('/^\//', $strSrc)) { if (!preg_match('#^' . preg_quote(JURI::base(true)) . '#', $strSrc)) return false; //same server, but outsite website $strSrc = preg_replace('#^' . preg_quote(JURI::base(true)) . '#', '', $strSrc); } } $strSrc = str_replace('//', '/', $strSrc); $strSrc = preg_replace('/^\//', '', $strSrc); return $strSrc; } /** * Detect IE Version * * @since 1.0 */ public static function isIE($version = false) { $agent=$_SERVER['HTTP_USER_AGENT']; $found = strpos($agent,'MSIE '); if ($found) { if ($version) { $ieversion = substr(substr($agent,$found+5),0,1); if ($ieversion == $version) return true; else return false; } else { return true; } } else { return false; } if (stristr($agent, 'msie'.$ieversion)) return true; return false; } } ?>PK ni.]�ð�6 �6 core/wp_shortcodes.phpnu &1i� <?php /** * WordPress API for creating bbcode like tags or what WordPress calls * "shortcodes." The tag and attribute parsing or regular expression code is * based on the Textpattern tag parser. * * A few examples are below: * * [shortcode /] * [shortcode foo="bar" baz="bing" /] * [shortcode foo="bar"]content[/shortcode] * * Shortcode tags support attributes and enclosed content, but does not entirely * support inline shortcodes in other shortcodes. You will have to call the * shortcode parser in your function to account for that. * * {@internal * Please be aware that the above note was made during the beta of WordPress 2.6 * and in the future may not be accurate. Please update the note when it is no * longer the case.}} * * To apply shortcode tags to content: * * <code> * $out = do_shortcode($content); * </code> * * @link http://codex.wordpress.org/Shortcode_API * * @package WordPress * @subpackage Shortcodes * @since 2.5 */ /** * Container for storing shortcode tags and their hook to call for the shortcode * * @since 2.5 * @name $shinetheme->shortcode_tags * @var array * @global array $shinetheme->shortcode_tags */ //$shinetheme->shortcode_tags = array(); /** * Add hook for shortcode tag. * * There can only be one hook for each shortcode. Which means that if another * plugin has a similar shortcode, it will override yours or yours will override * theirs depending on which order the plugins are included and/or ran. * * Simplest example of a shortcode tag using the API: * * <code> * // [footag foo="bar"] * function footag_func($atts) { * return "foo = {$atts[foo]}"; * } * add_shortcode('footag', 'footag_func'); * </code> * * Example with nice attribute defaults: * * <code> * // [bartag foo="bar"] * function bartag_func($atts) { * extract(shortcode_atts(array( * 'foo' => 'no foo', * 'baz' => 'default baz', * ), $atts)); * * return "foo = {$foo}"; * } * add_shortcode('bartag', 'bartag_func'); * </code> * * Example with enclosed content: * * <code> * // [baztag]content[/baztag] * function baztag_func($atts, $content='') { * return "content = $content"; * } * add_shortcode('baztag', 'baztag_func'); * </code> * * @since 2.5 * @uses $shinetheme->shortcode_tags * * @param string $tag Shortcode tag to be searched in post content. * @param callable $func Hook to run when shortcode is found. */ function btadd_shortcode($tag, $func) { global $shinetheme; if ( is_callable($func) ) $shinetheme->btshortcode_tags[$tag] = $func; } /** * Removes hook for shortcode. * * @since 2.5 * @uses $shinetheme->shortcode_tags * * @param string $tag shortcode tag to remove hook for. */ function btremove_shortcode($tag) { global $shinetheme; unset($shinetheme->btshortcode_tags[$tag]); } /** * Clear all shortcodes. * * This function is simple, it clears all of the shortcode tags by replacing the * shortcodes global by a empty array. This is actually a very efficient method * for removing all shortcodes. * * @since 2.5 * @uses $shinetheme->shortcode_tags */ function btremove_all_shortcodes() { global $shinetheme; $shinetheme->btshortcode_tags = array(); } /** * Search content for shortcodes and filter shortcodes through their hooks. * * If there are no shortcode tags defined, then the content will be returned * without any filtering. This might cause issues when plugins are disabled but * the shortcode will still show up in the post or content. * * @since 2.5 * @uses $shinetheme->shortcode_tags * @uses get_shortcode_regex() Gets the search pattern for searching shortcodes. * * @param string $content Content to search for shortcodes * @return string Content with shortcodes filtered out. */ function btdo_shortcode($content) { global $shinetheme; if (empty($shinetheme->btshortcode_tags) || !is_array($shinetheme->btshortcode_tags)) return $content; $pattern = btget_shortcode_regex(); return preg_replace_callback( "/$pattern/s", 'btdo_shortcode_tag', $content ); } /** * Retrieve the shortcode regular expression for searching. * * The regular expression combines the shortcode tags in the regular expression * in a regex class. * * The regular expression contains 6 different sub matches to help with parsing. * * 1 - An extra [ to allow for escaping shortcodes with double [[]] * 2 - The shortcode name * 3 - The shortcode argument list * 4 - The self closing / * 5 - The content of a shortcode when it wraps some content. * 6 - An extra ] to allow for escaping shortcodes with double [[]] * * @since 2.5 * @uses $shinetheme->shortcode_tags * * @return string The shortcode search regular expression */ function btget_shortcode_regex() { global $shinetheme; $tagnames = array_keys($shinetheme->btshortcode_tags); $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag() // Also, see shortcode_unautop() and shortcode.js. return '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . "($tagregexp)" // 2: Shortcode name . '(?![\\w-])' // Not followed by word character or hyphen . '(' // 3: Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')*?' . ')' . '(?:' . '(\\/)' // 4: Self closing tag ... . '\\]' // ... and closing bracket . '|' . '\\]' // Closing bracket . '(?:' . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags . '[^\\[]*+' // Not an opening bracket . '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag . '[^\\[]*+' // Not an opening bracket . ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] } /** * Regular Expression callable for do_shortcode() for calling shortcode hook. * @see get_shortcode_regex for details of the match array contents. * * @since 2.5 * @access private * @uses $shinetheme->shortcode_tags * * @param array $m Regular expression match array * @return mixed False on failure. */ function btdo_shortcode_tag( $m ) { global $shinetheme; // allow [[foo]] syntax for escaping a tag if ( $m[1] == '[' && $m[6] == ']' ) { return substr($m[0], 1, -1); } $tag = $m[2]; $attr = btshortcode_parse_atts( $m[3] ); if ( isset( $m[5] ) ) { // enclosing tag - extra parameter return $m[1] . call_user_func( $shinetheme->btshortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6]; } else { // self-closing tag return $m[1] . call_user_func( $shinetheme->btshortcode_tags[$tag], $attr, null, $tag ) . $m[6]; } } /** * Retrieve all attributes from the shortcodes tag. * * The attributes list has the attribute name as the key and the value of the * attribute as the value in the key/value pair. This allows for easier * retrieval of the attributes, since all attributes have to be known. * * @since 2.5 * * @param string $text * @return array List of attributes and their value. */ function btshortcode_parse_atts($text) { $atts = array(); $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { foreach ($match as $m) { if (!empty($m[1])) $atts[strtolower($m[1])] = stripcslashes($m[2]); elseif (!empty($m[3])) $atts[strtolower($m[3])] = stripcslashes($m[4]); elseif (!empty($m[5])) $atts[strtolower($m[5])] = stripcslashes($m[6]); elseif (isset($m[7]) and strlen($m[7])) $atts[] = stripcslashes($m[7]); elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } } else { $atts = ltrim($text); } return $atts; } /** * Combine user attributes with known attributes and fill in defaults when needed. * * The pairs should be considered to be all of the attributes which are * supported by the caller and given as a list. The returned attributes will * only contain the attributes in the $pairs list. * * If the $atts list has unsupported attributes, then they will be ignored and * removed from the final returned list. * * @since 2.5 * * @param array $pairs Entire list of supported attributes and their defaults. * @param array $atts User defined attributes in shortcode tag. * @return array Combined and filtered attribute list. */ function btshortcode_atts($pairs, $atts) { $atts = (array)$atts; $out = array(); foreach($pairs as $name => $default) { if ( array_key_exists($name, $atts) ) $out[$name] = $atts[$name]; else $out[$name] = $default; } return $out; } /** * Remove all shortcode tags from the given content. * * @since 2.5 * @uses $shinetheme->shortcode_tags * * @param string $content Content to remove shortcode tags. * @return string Content without shortcode tags. */ function btstrip_shortcodes( $content ) { global $shinetheme; if (empty($shinetheme->btshortcode_tags) || !is_array($shinetheme->btshortcode_tags)) return $content; $pattern = btget_shortcode_regex(); return preg_replace_callback( "/$pattern/s", 'btstrip_shortcode_tag', $content ); } function btstrip_shortcode_tag( $m ) { // allow [[foo]] syntax for escaping a tag if ( $m[1] == '[' && $m[6] == ']' ) { return substr($m[0], 1, -1); } return $m[1] . $m[6]; } /** * Don't auto-p wrap shortcodes that stand alone * * Ensures that shortcodes are not wrapped in <<p>>...<</p>>. * * @since 2.9.0 * * @param string $pee The content. * @return string The filtered content. */ function btshortcode_unautop( $pee ) { global $shinetheme; if ( empty( $shinetheme->btshortcode_tags ) || !is_array( $shinetheme->btshortcode_tags ) ) { return $pee; } $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shinetheme->btshortcode_tags ) ) ); $pattern = '/' . '<p>' // Opening paragraph . '\\s*+' // Optional leading whitespace . '(' // 1: The shortcode . '\\[' // Opening bracket . "($tagregexp)" // 2: Shortcode name . '(?![\\w-])' // Not followed by word character or hyphen // Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')*?' . '(?:' . '\\/\\]' // Self closing tag and closing bracket . '|' . '\\]' // Closing bracket . '(?:' // Unroll the loop: Optionally, anything between the opening and closing shortcode tags . '[^\\[]*+' // Not an opening bracket . '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag . '[^\\[]*+' // Not an opening bracket . ')*+' . '\\[\\/\\2\\]' // Closing shortcode tag . ')?' . ')' . ')' . '\\s*+' // optional trailing whitespace . '<\\/p>' // closing paragraph . '/s'; return preg_replace( $pattern, '$1', $pee ); } PK ni.]�#o, , core/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ni.]��Ag&J &J $ core/classes/joomla30/viewlegacy.phpnu &1i� <?php /** * @package Joomla.Legacy * @subpackage View * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla View * * Class holding methods for displaying presentation data. * * @package Joomla.Legacy * @subpackage View * @since 12.2 */ class JViewLegacy extends JObject { /** * The name of the view * * @var array */ protected $_name = null; /** * Registered models * * @var array */ protected $_models = array(); /** * The base path of the view * * @var string */ protected $_basePath = null; /** * The default model * * @var string */ protected $_defaultModel = null; /** * Layout name * * @var string */ protected $_layout = 'default'; /** * Layout extension * * @var string */ protected $_layoutExt = 'php'; /** * Layout template * * @var string */ protected $_layoutTemplate = '_'; /** * The set of search directories for resources (templates) * * @var array */ protected $_path = array('template' => array(), 'helper' => array()); /** * The name of the default template source file. * * @var string */ protected $_template = null; /** * The output of the template script. * * @var string */ protected $_output = null; /** * Callback for escaping. * * @var string * @deprecated 13.3 */ protected $_escape = 'htmlspecialchars'; /** * Charset to use in escaping mechanisms; defaults to urf8 (UTF-8) * * @var string */ protected $_charset = 'UTF-8'; /** * Constructor * * @param array $config A named configuration array for object construction.<br/> * name: the name (optional) of the view (defaults to the view class name suffix).<br/> * charset: the character set to use for display<br/> * escape: the name (optional) of the function to use for escaping strings<br/> * base_path: the parent path (optional) of the views directory (defaults to the component folder)<br/> * template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name<br/> * helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)<br/> * layout: the layout (optional) to use to display the view<br/> * * @since 12.2 */ public function __construct($config = array()) { // Set the view name if (empty($this->_name)) { if (array_key_exists('name', $config)) { $this->_name = $config['name']; } else { $this->_name = $this->getName(); } } // Set the charset (used by the variable escaping functions) if (array_key_exists('charset', $config)) { JLog::add('Setting a custom charset for escaping is deprecated. Override JViewLegacy::escape() instead.', JLog::WARNING, 'deprecated'); $this->_charset = $config['charset']; } // User-defined escaping callback if (array_key_exists('escape', $config)) { $this->setEscape($config['escape']); } // Set a base path for use by the view if (array_key_exists('base_path', $config)) { $this->_basePath = $config['base_path']; } else { $this->_basePath = JPATH_COMPONENT; } // Set the default template search path if (array_key_exists('template_path', $config)) { // User-defined dirs $this->_setPath('template', $config['template_path']); } else { $this->_setPath('template', $this->_basePath . '/views/' . $this->getName() . '/tmpl'); } // Set the default helper search path if (array_key_exists('helper_path', $config)) { // User-defined dirs $this->_setPath('helper', $config['helper_path']); } else { $this->_setPath('helper', $this->_basePath . '/helpers'); } // Set the layout if (array_key_exists('layout', $config)) { $this->setLayout($config['layout']); } else { $this->setLayout('default'); } $this->baseurl = JURI::base(true); } /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @see fetch() * @since 12.2 */ public function display($tpl = null) { $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { return $result; } echo $result; } /** * Assigns variables to the view script via differing strategies. * * This method is overloaded; you can assign all the properties of * an object, an associative array, or a single value by name. * * You are not allowed to set variables that begin with an underscore; * these are either private properties for JView or private variables * within the template script itself. * * <code> * $view = new JView; * * // Assign directly * $view->var1 = 'something'; * $view->var2 = 'else'; * * // Assign by name and value * $view->assign('var1', 'something'); * $view->assign('var2', 'else'); * * // Assign by assoc-array * $ary = array('var1' => 'something', 'var2' => 'else'); * $view->assign($obj); * * // Assign by object * $obj = new stdClass; * $obj->var1 = 'something'; * $obj->var2 = 'else'; * $view->assign($obj); * * </code> * * @return boolean True on success, false on failure. * * @deprecated 13.3 Use native PHP syntax. */ public function assign() { JLog::add(__METHOD__ . ' is deprecated. Use native PHP syntax.', JLog::WARNING, 'deprecated'); // Get the arguments; there may be 1 or 2. $arg0 = @func_get_arg(0); $arg1 = @func_get_arg(1); // Assign by object if (is_object($arg0)) { // Assign public properties foreach (get_object_vars($arg0) as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by associative array if (is_array($arg0)) { foreach ($arg0 as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by string name and mixed value. // We use array_key_exists() instead of isset() because isset() // fails if the value is set to null. if (is_string($arg0) && substr($arg0, 0, 1) != '_' && func_num_args() > 1) { $this->$arg0 = $arg1; return true; } // $arg0 was not object, array, or string. return false; } /** * Assign variable for the view (by reference). * * You are not allowed to set variables that begin with an underscore; * these are either private properties for JView or private variables * within the template script itself. * * <code> * $view = new JView; * * // Assign by name and value * $view->assignRef('var1', $ref); * * // Assign directly * $view->ref = &$var1; * </code> * * @param string $key The name for the reference in the view. * @param mixed &$val The referenced variable. * * @return boolean True on success, false on failure. * * @since 12.2 * @deprecated 13.3 Use native PHP syntax. */ public function assignRef($key, &$val) { JLog::add(__METHOD__ . ' is deprecated. Use native PHP syntax.', JLog::WARNING, 'deprecated'); if (is_string($key) && substr($key, 0, 1) != '_') { $this->$key = &$val; return true; } return false; } /** * Escapes a value for output in a view script. * * If escaping mechanism is either htmlspecialchars or htmlentities, uses * {@link $_encoding} setting. * * @param mixed $var The output to escape. * * @return mixed The escaped value. * * @since 12.2 */ public function escape($var) { if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) { return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_charset); } return call_user_func($this->_escape, $var); } /** * Method to get data from a registered model or a property of the view * * @param string $property The name of the method to call on the model or the property to get * @param string $default The name of the model to reference or the default value [optional] * * @return mixed The return value of the method * * @since 12.2 */ public function get($property, $default = null) { // If $model is null we use the default model if (is_null($default)) { $model = $this->_defaultModel; } else { $model = strtolower($default); } // First check to make sure the model requested exists if (isset($this->_models[$model])) { // Model exists, let's build the method name $method = 'get' . ucfirst($property); // Does the method exist? if (method_exists($this->_models[$model], $method)) { // The method exists, let's call it and return what we get $result = $this->_models[$model]->$method(); return $result; } } // Degrade to JObject::get $result = parent::get($property, $default); return $result; } /** * Method to get the model object * * @param string $name The name of the model (optional) * * @return mixed JModelLegacy object * * @since 12.2 */ public function getModel($name = null) { if ($name === null) { $name = $this->_defaultModel; } return $this->_models[strtolower($name)]; } /** * Get the layout. * * @return string The layout name */ public function getLayout() { return $this->_layout; } /** * Get the layout template. * * @return string The layout template name */ public function getLayoutTemplate() { return $this->_layoutTemplate; } /** * Method to get the view name * * The model name by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @since 12.2 * @throws Exception */ public function getName() { if (empty($this->_name)) { $classname = get_class($this); $viewpos = strpos($classname, 'View'); if ($viewpos === false) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500); } $this->_name = strtolower(substr($classname, $viewpos + 4)); } return $this->_name; } /** * Method to add a model to the view. We support a multiple model single * view system by which models are referenced by classname. A caveat to the * classname referencing is that any classname prepended by JModel will be * referenced by the name without JModel, eg. JModelCategory is just * Category. * * @param JModelLegacy $model The model to add to the view. * @param boolean $default Is this the default model? * * @return object The added model. * * @since 12.2 */ public function setModel($model, $default = false) { $name = strtolower($model->getName()); $this->_models[$name] = $model; if ($default) { $this->_defaultModel = $name; } return $model; } /** * Sets the layout name to use * * @param string $layout The layout name or a string in format <template>:<layout file> * * @return string Previous value. * * @since 12.2 */ public function setLayout($layout) { $previous = $this->_layout; if (strpos($layout, ':') === false) { $this->_layout = $layout; } else { // Convert parameter to array based on : $temp = explode(':', $layout); $this->_layout = $temp[1]; // Set layout template $this->_layoutTemplate = $temp[0]; } return $previous; } /** * Allows a different extension for the layout files to be used * * @param string $value The extension. * * @return string Previous value * * @since 12.2 */ public function setLayoutExt($value) { $previous = $this->_layoutExt; if ($value = preg_replace('#[^A-Za-z0-9]#', '', trim($value))) { $this->_layoutExt = $value; } return $previous; } /** * Sets the _escape() callback. * * @param mixed $spec The callback for _escape() to use. * * @return void * * @since 12.2 * @deprecated 13.3 Override JViewLegacy::escape() instead. */ public function setEscape($spec) { JLog::add(__METHOD__ . ' is deprecated. Override JViewLegacy::escape() instead.', JLog::WARNING, 'deprecated'); $this->_escape = $spec; } /** * Adds to the stack of view script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void * * @since 12.2 */ public function addTemplatePath($path) { $this->_addPath('template', $path); } /** * Adds to the stack of helper script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void * * @since 12.2 */ public function addHelperPath($path) { $this->_addPath('helper', $path); } /** * Load a template file -- first look in the templates folder for an override * * @param string $tpl The name of the template source file; automatically searches the template paths and compiles as needed. * * @return string The output of the the template script. * * @since 12.2 * @throws Exception */ public function loadTemplate($tpl = null) { // Clear prior output $this->_output = null; $template = JFactory::getApplication()->getTemplate(); $layout = $this->getLayout(); $layoutTemplate = $this->getLayoutTemplate(); // Create the template file name based on the layout $file = isset($tpl) ? $layout . '_' . $tpl : $layout; // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file); $tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl) : $tpl; // Load the language file for the template $lang = JFactory::getLanguage(); $lang->load('tpl_' . $template, JPATH_BASE, null, false, false) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, false) || $lang->load('tpl_' . $template, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", $lang->getDefault(), false, false); // Change the template folder if alternative layout is in different template if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) { $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']); } // Load the template script jimport('joomla.filesystem.path'); $filetofind = $this->_createFileName('template', array('name' => $file)); $this->_template = JPath::find($this->_path['template'], $filetofind); // If alternate layout can't be found, fall back to default layout if ($this->_template == false) { $filetofind = $this->_createFileName('', array('name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($this->_path['template'], $filetofind); } if ($this->_template != false) { // Unset so as not to introduce into template scope unset($tpl); unset($file); // Never allow a 'this' property if (isset($this->this)) { unset($this->this); } // Start capturing output into a buffer ob_start(); // Include the requested template filename in the local scope // (this will execute the view logic). include $this->_template; // Done with the requested template; get the buffer and // clear it. $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500); } } /** * Load a helper file * * @param string $hlp The name of the helper source file automatically searches the helper paths and compiles as needed. * * @return void * * @since 12.2 */ public function loadHelper($hlp = null) { // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $hlp); // Load the template script jimport('joomla.filesystem.path'); $helper = JPath::find($this->_path['helper'], $this->_createFileName('helper', array('name' => $file))); if ($helper != false) { // Include the requested template filename in the local scope include_once $helper; } } /** * Sets an entire array of search paths for templates or resources. * * @param string $type The type of path to set, typically 'template'. * @param mixed $path The new search path, or an array of search paths. If null or false, resets to the current directory only. * * @return void * * @since 12.2 */ protected function _setPath($type, $path) { $component = JApplicationHelper::getComponentName(); $app = JFactory::getApplication(); // Clear out the prior search dirs $this->_path[$type] = array(); // Actually add the user-specified directories $this->_addPath($type, $path); // Always add the fallback directories as last resort switch (strtolower($type)) { case 'template': // Set the alternative template search dir if (isset($app)) { $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $component); $fallback = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName(); $this->_addPath('template', Helix::frameworkPath().'/html/' . $component . '/' . $this->getName()); $this->_addPath('template', $fallback); } break; } } /** * Adds to the search path for templates and resources. * * @param string $type The type of path to add. * @param mixed $path The directory or stream, or an array of either, to search. * * @return void * * @since 12.2 */ protected function _addPath($type, $path) { // Just force to array settype($path, 'array'); // Loop through the path directories foreach ($path as $dir) { // No surrounding spaces allowed! $dir = trim($dir); // Add trailing separators as needed if (substr($dir, -1) != DIRECTORY_SEPARATOR) { // Directory $dir .= DIRECTORY_SEPARATOR; } // Add to the top of the search dirs array_unshift($this->_path[$type], $dir); } } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for * @param array $parts An associative array of filename information * * @return string The filename * * @since 12.2 */ protected function _createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'template': $filename = strtolower($parts['name']) . '.' . $this->_layoutExt; break; default: $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } } PK ni.]I3|UM UM # core/classes/joomla30/bootstrap.phpnu &1i� <?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for Bootstrap elements. * * @package Joomla.Libraries * @subpackage HTML * @since 3.0 */ abstract class JHtmlBootstrap { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * Add javascript support for Bootstrap alerts * * @param string $selector Common class for the alerts * * @return void * * @since 3.0 */ public static function alert($selector = 'alert') { // Only load once if (isset(self::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework self::framework(); // Attach the alerts to the document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').alert(); })(jQuery);" ); self::$loaded[__METHOD__][$selector] = true; return; } /** * Add javascript support for Bootstrap carousels * * @param string $selector Common class for the carousels. * @param array $params An array of options for the modal. * Options for the modal can be: * - interval number The amount of time to delay between automatically cycling an item. * If false, carousel will not automatically cycle. * - pause string Pauses the cycling of the carousel on mouseenter and resumes the cycling * of the carousel on mouseleave. * * @return void * * @since 3.0 */ public static function carousel($selector = 'carousel', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(self::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['interval'] = (isset($params['interval']) && ($params['interval'])) ? (int) $params['interval'] : 5000; $opt['pause'] = (isset($params['pause']) && ($params['pause'])) ? $params['pause'] : 'hover'; $options = self::_getJSObject($opt); // Attach the carousel to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').carousel($options); })(jQuery);" ); // Set static array self::$loaded[__METHOD__][$sig] = true; } return; } /** * Add javascript support for Bootstrap dropdowns * * @param string $selector Common class for the dropdowns * * @return void * * @since 3.0 */ public static function dropdown($selector = 'dropdown-toggle') { // Only load once if (isset(self::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework self::framework(); // Attach the dropdown to the document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').dropdown(); })(jQuery);" ); self::$loaded[__METHOD__][$selector] = true; return; } /** * Method to load the Bootstrap JavaScript framework into the document head * * If debugging mode is on an uncompressed version of Bootstrap is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function framework($debug = null) { return; } /** * Add javascript support for Bootstrap modals * * @param string $selector The ID selector for the modal. * @param array $params An array of options for the modal. * Options for the modal can be: * - backdrop boolean Includes a modal-backdrop element. * - keyboard boolean Closes the modal when escape key is pressed. * - show boolean Shows the modal when initialized. * - remote string An optional remote URL to load * * @return void * * @since 3.0 */ public static function modal($selector = 'modal', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(self::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['backdrop'] = (isset($params['backdrop']) && ($params['backdrop'])) ? (boolean) $params['backdrop'] : true; $opt['keyboard'] = (isset($params['keyboard']) && ($params['keyboard'])) ? (boolean) $params['keyboard'] : true; $opt['show'] = (isset($params['show']) && ($params['show'])) ? (boolean) $params['show'] : true; $opt['remote'] = (isset($params['remote']) && ($params['remote'])) ? (boolean) $params['remote'] : ''; $options = self::__getJSObject($opt); // Attach the modal to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').modal($options); })(jQuery);" ); // Set static array self::$loaded[__METHOD__][$sig] = true; } return; } /** * Method to render a Bootstrap modal * * @param string $selector The ID selector for the modal. * @param array $params An array of options for the modal. * @param string $footer Optional markup for the modal footer * * @return string HTML markup for a modal * * @since 3.0 */ public static function renderModal($selector = 'modal', $params = array(), $footer = '') { // Ensure the behavior is loaded self::modal($selector, $params); $html = "<div class=\"modal hide fade\" id=\"" . $selector . "\">\n"; $html .= "<div class=\"modal-header\">\n"; $html .= "<button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n"; $html .= "<h3>" . $params['title'] . "</h3>\n"; $html .= "</div>\n"; $html .= "<div id=\"" . $selector . "-container\">\n"; $html .= "</div>\n"; $html .= "</div>\n"; $html .= "<script>"; $html .= "jQuery('#" . $selector . "').on('show', function () {\n"; $html .= "document.getElementById('" . $selector . "-container').innerHTML = '<div class=\"modal-body\"><iframe class=\"iframe\" src=\"" . $params['url'] . "\" height=\"" . $params['height'] . "\" width=\"" . $params['width'] . "\"></iframe></div>" . $footer . "';\n"; $html .= "});\n"; $html .= "</script>"; return $html; } /** * Add javascript support for Bootstrap popovers * * Use element's Title as popover content * * @param string $selector Selector for the tooltip * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * animation boolean apply a css fade transition to the tooltip * html boolean Insert HTML into the tooltip. If false, jQuery's text method will be used to insert * content into the dom. * placement string|function how to position the tooltip - top | bottom | left | right * selector string If a selector is provided, tooltip objects will be delegated to the specified targets. * title string|function default title value if `title` tag isn't present * trigger string how tooltip is triggered - hover | focus | manual * content string|function default content value if `data-content` attribute isn't present * delay number|object delay showing and hiding the tooltip (ms) - does not apply to manual trigger type * If a number is supplied, delay is applied to both hide/show * Object structure is: delay: { show: 500, hide: 100 } * * @return void * * @since 3.0 */ public static function popover($selector = '.hasPopover', $params = array()) { // Only load once if (isset(self::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework self::framework(); $opt['animation'] = isset($params['animation']) ? $params['animation'] : null; $opt['html'] = isset($params['html']) ? $params['html'] : null; $opt['placement'] = isset($params['placement']) ? $params['placement'] : null; $opt['selector'] = isset($params['selector']) ? $params['selector'] : null; $opt['title'] = isset($params['title']) ? $params['title'] : null; $opt['trigger'] = isset($params['trigger']) ? $params['trigger'] : 'hover'; $opt['content'] = isset($params['content']) ? $params['content'] : null; $opt['delay'] = isset($params['delay']) ? $params['delay'] : null; $options = self::__getJSObject($opt); // Attach the popover to the document JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function() { jQuery('" . $selector . "').popover(" . $options . "); });" ); self::$loaded[__METHOD__][$selector] = true; return; } /** * Add javascript support for Bootstrap ScrollSpy * * @param string $selector The ID selector for the ScrollSpy element. * @param array $params An array of options for the ScrollSpy. * Options for the modal can be: * - offset number Pixels to offset from top when calculating position of scroll. * * @return void * * @since 3.0 */ public static function scrollspy($selector = 'navbar', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(self::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['offset'] = (isset($params['offset']) && ($params['offset'])) ? (int) $params['offset'] : 10; $options = self::__getJSObject($opt); // Attach ScrollSpy to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').scrollspy($options); })(jQuery);" ); // Set static array self::$loaded[__METHOD__][$sig] = true; } return; } /** * Add javascript support for Bootstrap tooltips * * Add a title attribute to any element in the form * title="title::text" * * @param string $selector The ID selector for the tooltip. * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * - animation boolean Apply a CSS fade transition to the tooltip * - html boolean Insert HTML into the tooltip. If false, jQuery's text method will be used to insert * content into the dom. * - placement string|function How to position the tooltip - top | bottom | left | right * - selector string If a selector is provided, tooltip objects will be delegated to the specified targets. * - title string|function Default title value if `title` tag isn't present * - trigger string How tooltip is triggered - hover | focus | manual * - delay number Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type * If a number is supplied, delay is applied to both hide/show * Object structure is: delay: { show: 500, hide: 100 } * * @return void * * @since 3.0 */ public static function tooltip($selector = '.hasTooltip', $params = array()) { if (!isset(self::$loaded[__METHOD__][$selector])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['animation'] = (isset($params['animation']) && ($params['animation'])) ? (boolean) $params['animation'] : null; $opt['html'] = (isset($params['html']) && ($params['html'])) ? (boolean) $params['html'] : null; $opt['placement'] = (isset($params['placement']) && ($params['placement'])) ? (string) $params['placement'] : null; $opt['selector'] = (isset($params['selector']) && ($params['selector'])) ? (string) $params['selector'] : null; $opt['title'] = (isset($params['title']) && ($params['title'])) ? (string) $params['title'] : null; $opt['trigger'] = (isset($params['trigger']) && ($params['trigger'])) ? (string) $params['trigger'] : null; $opt['delay'] = (isset($params['delay']) && ($params['delay'])) ? (int) $params['delay'] : null; $options = self::__getJSObject($opt); // Attach tooltips to document JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function() { jQuery('" . $selector . "').tooltip(" . $options . "); });" ); // Set static array self::$loaded[__METHOD__][$selector] = true; } return; } /** * Add javascript support for Bootstrap accordians and insert the accordian * * @param string $selector The ID selector for the tooltip. * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * - parent selector If selector then all collapsible elements under the specified parent will be closed when this * collapsible item is shown. (similar to traditional accordion behavior) * - toggle boolean Toggles the collapsible element on invocation * - active string Sets the active slide during load * * @return string HTML for the accordian * * @since 3.0 */ public static function startAccordion($selector = 'myAccordian', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(self::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['parent'] = (isset($params['parent']) && ($params['parent'])) ? (boolean) $params['parent'] : false; $opt['toggle'] = (isset($params['toggle']) && ($params['toggle'])) ? (boolean) $params['toggle'] : true; $opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : ''; $options = self::__getJSObject($opt); // Attach accordion to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').collapse($options); })(jQuery);" ); // Set static array self::$loaded[__METHOD__][$sig] = true; self::$loaded[__METHOD__]['active'] = $opt['active']; } return '<div id="' . $selector . '" class="accordion">'; } /** * Close the current accordion * * @return string HTML to close the accordian * * @since 3.0 */ public static function endAccordion() { return '</div>'; } /** * Begins the display of a new accordion slide. * * @param string $selector Identifier of the accordion group. * @param string $text Text to display. * @param string $id Identifier of the slide. * * @return string HTML to add the slide * * @since 3.0 */ public static function addSlide($selector, $text, $id) { $in = (self::$loaded['JHtmlBootstrap::startAccordion']['active'] == $id) ? ' in' : ''; $html = '<div class="accordion-group">' . '<div class="accordion-heading">' . '<strong><a href="#' . $id . '" data-parent="#' . $selector . '" data-toggle="collapse" class="accordion-toggle">' . $text . '</a></strong>' . '</div>' . '<div class="accordion-body collapse' . $in . '" id="' . $id . '">' . '<div class="accordion-inner">'; return $html; } /** * Close the current slide * * @return string HTML to close the slide * * @since 3.0 */ public static function endSlide() { return '</div></div></div>'; } /** * Creates a tab pane * * @param string $selector The pane identifier. * @param array $params The parameters for the pane * * @return string * * @since 3.0 */ public static function startPane($selector = 'myTab', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(self::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework self::framework(); // Setup options object $opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : ''; $options = self::__getJSObject($opt); // Attach tooltips to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector a').click(function (e) { e.preventDefault(); $(this).tab('show'); }); })(jQuery);" ); // Set static array self::$loaded[__METHOD__][$sig] = true; self::$loaded[__METHOD__][$selector]['active'] = $opt['active']; } return '<div class="tab-content" id="' . $selector . 'Content">'; } /** * Close the current tab pane * * @return string HTML to close the pane * * @since 3.0 */ public static function endPane() { return '</div>'; } /** * Begins the display of a new tab content panel. * * @param string $selector Identifier of the panel. * @param string $id The ID of the div element * * @return string HTML to start a new panel * * @since 3.0 */ public static function addPanel($selector, $id) { $active = (self::$loaded['JHtmlBootstrap::startPane'][$selector]['active'] == $id) ? ' active' : ''; return '<div id="' . $id . '" class="tab-pane' . $active . '">'; } /** * Close the current tab content panel * * @return string HTML to close the pane * * @since 3.0 */ public static function endPanel() { return '</div>'; } /** * Loads CSS files needed by Bootstrap * * @param boolean $includeMainCss If true, main bootstrap.css files are loaded * @param string $direction rtl or ltr direction. If empty, ltr is assumed * @param array $attribs Optional array of attributes to be passed to JHtml::_('stylesheet') * * @return void * * @since 3.0 */ public static function loadCss($includeMainCss = true, $direction = 'ltr', $attribs = array()) { return; } //From JHtml /** * Internal method to get a JavaScript object notation string from an array * * @param array $array The array to convert to JavaScript object notation * * @return string JavaScript object notation representation of the array * * @since 12.2 */ public static function __getJSObject(array $array = array()) { $object = '{'; // Iterate over array to build objects foreach ((array) $array as $k => $v) { if (is_null($v)) { continue; } if (is_bool($v)) { $object .= ' ' . $k . ': '; $object .= ($v) ? 'true' : 'false'; $object .= ','; } elseif (!is_array($v) && !is_object($v)) { $object .= ' ' . $k . ': '; $object .= (is_numeric($v) || strpos($v, '\\') === 0) ? (is_numeric($v)) ? $v : substr($v, 1) : "'" . str_replace("'", "\\'", trim($v, "'")) . "'"; $object .= ','; } else { $object .= ' ' . $k . ': ' . self::getJSObject($v) . ','; } } if (substr($object, -1) == ',') { $object = substr($object, 0, -1); } $object .= '}'; return $object; } } PK ni.]�#o, , core/classes/joomla30/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ni.] ! core/classes/joomla30/adminer.phpnu �[��� PK ni.]�#o, , core/classes/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ni.]?�\ � � core/classes/cssmin.phpnu &1i� <?php /** * Class CSSMinify * @package Minify */ /** * Compress CSS * * This is a heavy regex-based removal of whitespace, unnecessary * comments and tokens, and some CSS value minimization, where practical. * Many steps have been taken to avoid breaking comment-based hacks, * including the ie5/mac filter (and its inversion), but expect tricky * hacks involving comment tokens in 'content' value strings to break * minimization badly. A test suite is available. * * @package Minify * @author Stephen Clay <steve@mrclay.org> * @author http://code.google.com/u/1stvamp/ (Issue 64 patch) */ class CSSMinify { /** * Minify a CSS string * * @param string $css * * @param array $options (currently ignored) * * @return string */ public static function process($css, $options = array()) { $obj = new CSSMinify($options); return $obj->_process($css); } /** * @var array options */ protected $_options = null; /** * @var bool Are we "in" a hack? * * I.e. are some browsers targetted until the next comment? */ protected $_inHack = false; /** * Constructor * * @param array $options (currently ignored) * * @return null */ private function __construct($options) { $this->_options = $options; } /** * Minify a CSS string * * @param string $css * * @return string */ protected function _process($css) { $css = str_replace("\r\n", "\n", $css); // preserve empty comment after '>' // http://www.webdevout.net/css-hacks#in_css-selectors $css = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $css); // preserve empty comment between property and value // http://css-discuss.incutio.com/?page=BoxModelHack $css = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $css); $css = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $css); // apply callback to all valid comments (and strip out surrounding ws $css = preg_replace_callback('@\\s*/\\*([\\s\\S]*?)\\*/\\s*@' ,array($this, '_commentCB'), $css); // remove ws around { } and last semicolon in declaration block $css = preg_replace('/\\s*{\\s*/', '{', $css); $css = preg_replace('/;?\\s*}\\s*/', '}', $css); // remove ws surrounding semicolons $css = preg_replace('/\\s*;\\s*/', ';', $css); // remove ws around urls $css = preg_replace('/ url\\( # url( \\s* ([^\\)]+?) # 1 = the URL (really just a bunch of non right parenthesis) \\s* \\) # ) /x', 'url($1)', $css); // remove ws between rules and colons $css = preg_replace('/ \\s* ([{;]) # 1 = beginning of block or rule separator \\s* ([\\*_]?[\\w\\-]+) # 2 = property (and maybe IE filter) \\s* : \\s* (\\b|[#\'"]) # 3 = first character of a value /x', '$1$2:$3', $css); // remove ws in selectors $css = preg_replace_callback('/ (?: # non-capture \\s* [^~>+,\\s]+ # selector part \\s* [,>+~] # combinators )+ \\s* [^~>+,\\s]+ # selector part { # open declaration block /x' ,array($this, '_selectorsCB'), $css); // minimize hex colors $css = preg_replace('/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i' , '$1#$2$3$4$5', $css); // remove spaces between font families $css = preg_replace_callback('/font-family:([^;}]+)([;}])/' ,array($this, '_fontFamilyCB'), $css); $css = preg_replace('/@import\\s+url/', '@import url', $css); // replace any ws involving newlines with a single newline $css = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $css); // separate common descendent selectors w/ newlines (to limit line lengths) $css = preg_replace('/([\\w#\\.\\*]+)\\s+([\\w#\\.\\*]+){/', "$1\n$2{", $css); // Use newline after 1st numeric value (to limit line lengths). $css = preg_replace('/ ((?:padding|margin|border|outline):\\d+(?:px|em)?) # 1 = prop : 1st numeric value \\s+ /x' ,"$1\n", $css); // prevent triggering IE6 bug: http://www.crankygeek.com/ie6pebug/ $css = preg_replace('/:first-l(etter|ine)\\{/', ':first-l$1 {', $css); return trim($css); } /** * Replace what looks like a set of selectors * * @param array $m regex matches * * @return string */ protected function _selectorsCB($m) { // remove ws around the combinators return preg_replace('/\\s*([,>+~])\\s*/', '$1', $m[0]); } /** * Process a comment and return a replacement * * @param array $m regex matches * * @return string */ protected function _commentCB($m) { $hasSurroundingWs = (trim($m[0]) !== $m[1]); $m = $m[1]; // $m is the comment content w/o the surrounding tokens, // but the return value will replace the entire comment. if ($m === 'keep') { return '/**/'; } if ($m === '" "') { // component of http://tantek.com/CSS/Examples/midpass.html return '/*" "*/'; } if (preg_match('@";\\}\\s*\\}/\\*\\s+@', $m)) { // component of http://tantek.com/CSS/Examples/midpass.html return '/*";}}/* */'; } if ($this->_inHack) { // inversion: feeding only to one browser if (preg_match('@ ^/ # comment started like /*/ \\s* (\\S[\\s\\S]+?) # has at least some non-ws content \\s* /\\* # ends like /*/ or /**/ @x', $m, $n)) { // end hack mode after this comment, but preserve the hack and comment content $this->_inHack = false; return "/*/{$n[1]}/**/"; } } if (substr($m, -1) === '\\') { // comment ends like \*/ // begin hack mode and preserve hack $this->_inHack = true; return '/*\\*/'; } if ($m !== '' && $m[0] === '/') { // comment looks like /*/ foo */ // begin hack mode and preserve hack $this->_inHack = true; return '/*/*/'; } if ($this->_inHack) { // a regular comment ends hack mode but should be preserved $this->_inHack = false; return '/**/'; } // Issue 107: if there's any surrounding whitespace, it may be important, so // replace the comment with a single space return $hasSurroundingWs // remove all other comments ? ' ' : ''; } /** * Process a font-family listing and return a replacement * * @param array $m regex matches * * @return string */ protected function _fontFamilyCB($m) { $m[1] = preg_replace('/ \\s* ( "[^"]+" # 1 = family in double qutoes |\'[^\']+\' # or 1 = family in single quotes |[\\w\\-]+ # or 1 = unquoted family ) \\s* /x', '$1', $m[1]); return 'font-family:' . $m[1] . $m[2]; } } PK ni.]Qt�� � core/classes/jsmin.phpnu &1i� <?php /** * jsmin.php - PHP implementation of Douglas Crockford's JSMin. * * This is pretty much a direct port of jsmin.c to PHP with just a few * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and * outputs to stdout, this library accepts a string as input and returns another * string as output. * * PHP 5 or higher is required. * * Permission is hereby granted to use this version of the library under the * same terms as jsmin.c, which has the following license: * * -- * Copyright (c) 2002 Douglas Crockford (www.crockford.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * The Software shall be used for Good, not Evil. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * -- * * @package JSMin * @author Ryan Grove <ryan@wonko.com> * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c) * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port) * @license http://opensource.org/licenses/mit-license.php MIT License * @version 1.1.1 (2008-03-02) * @link http://code.google.com/p/jsmin-php/ */ class JSMin { const ORD_LF = 10; const ORD_SPACE = 32; protected $a = ''; protected $b = ''; protected $input = ''; protected $inputIndex = 0; protected $inputLength = 0; protected $lookAhead = null; protected $output = ''; // -- Public Static Methods -------------------------------------------------- public static function minify($js) { $jsmin = new JSMin($js); return $jsmin->min(); } // -- Public Instance Methods ------------------------------------------------ public function __construct($input) { $this->input = str_replace("\r\n", "\n", $input); $this->inputLength = strlen($this->input); } // -- Protected Instance Methods --------------------------------------------- protected function action($d) { switch($d) { case 1: $this->output .= $this->a; case 2: $this->a = $this->b; if ($this->a === "'" || $this->a === '"') { for (;;) { $this->output .= $this->a; $this->a = $this->get(); if ($this->a === $this->b) { break; } if (ord($this->a) <= self::ORD_LF) { throw new JSMinException('Unterminated string literal.'); } if ($this->a === '\\') { $this->output .= $this->a; $this->a = $this->get(); } } } case 3: $this->b = $this->next(); if ($this->b === '/' && ( $this->a === '(' || $this->a === ',' || $this->a === '=' || $this->a === ':' || $this->a === '[' || $this->a === '!' || $this->a === '&' || $this->a === '|' || $this->a === '?')) { $this->output .= $this->a . $this->b; for (;;) { $this->a = $this->get(); if ($this->a === '/') { break; } elseif ($this->a === '\\') { $this->output .= $this->a; $this->a = $this->get(); } elseif (ord($this->a) <= self::ORD_LF) { throw new JSMinException('Unterminated regular expression '. 'literal.'); } $this->output .= $this->a; } $this->b = $this->next(); } } } protected function get() { $c = $this->lookAhead; $this->lookAhead = null; if ($c === null) { if ($this->inputIndex < $this->inputLength) { $c = substr($this->input, $this->inputIndex, 1); $this->inputIndex += 1; } else { $c = null; } } if ($c === "\r") { return "\n"; } if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) { return $c; } return ' '; } protected function isAlphaNum($c) { return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1; } protected function min() { $this->a = "\n"; $this->action(3); while ($this->a !== null) { switch ($this->a) { case ' ': if ($this->isAlphaNum($this->b)) { $this->action(1); } else { $this->action(2); } break; case "\n": switch ($this->b) { case '{': case '[': case '(': case '+': case '-': $this->action(1); break; case ' ': $this->action(3); break; default: if ($this->isAlphaNum($this->b)) { $this->action(1); } else { $this->action(2); } } break; default: switch ($this->b) { case ' ': if ($this->isAlphaNum($this->a)) { $this->action(1); break; } $this->action(3); break; case "\n": switch ($this->a) { case '}': case ']': case ')': case '+': case '-': case '"': case "'": $this->action(1); break; default: if ($this->isAlphaNum($this->a)) { $this->action(1); } else { $this->action(3); } } break; default: $this->action(1); break; } } } return $this->output; } protected function next() { $c = $this->get(); if ($c === '/') { switch($this->peek()) { case '/': for (;;) { $c = $this->get(); if (ord($c) <= self::ORD_LF) { return $c; } } case '*': $this->get(); for (;;) { switch($this->get()) { case '*': if ($this->peek() === '/') { $this->get(); return ' '; } break; case null: throw new JSMinException('Unterminated comment.'); } } default: return $c; } } return $c; } protected function peek() { $this->lookAhead = $this->get(); return $this->lookAhead; } } // -- Exceptions --------------------------------------------------------------- class JSMinException extends Exception {} PK ni.]�V� core/classes/joomla25/index.htmlnu &1i� <!DOCTYPE html><title></title> PK ni.]�P�T�K �K core/classes/joomla25/helper.phpnu &1i� <?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.application.component.helper'); /** * Module helper class * * @package Joomla.Platform * @subpackage Application * @since 11.1 */ abstract class JModuleHelper { /** * Get module by name (real, eg 'Breadcrumbs' or folder, eg 'mod_breadcrumbs') * * @param string $name The name of the module * @param string $title The title of the module, optional * * @return object The Module object * * @since 11.1 */ public static function &getModule($name, $title = null) { $result = null; $modules =& JModuleHelper::_load(); $total = count($modules); for ($i = 0; $i < $total; $i++) { // Match the name of the module if ($modules[$i]->name == $name || $modules[$i]->module == $name) { // Match the title if we're looking for a specific instance of the module if (!$title || $modules[$i]->title == $title) { // Found it $result = &$modules[$i]; break; // Found it } } } // If we didn't find it, and the name is mod_something, create a dummy object if (is_null($result) && substr($name, 0, 4) == 'mod_') { $result = new stdClass; $result->id = 0; $result->title = ''; $result->module = $name; $result->position = ''; $result->content = ''; $result->showtitle = 0; $result->control = ''; $result->params = ''; $result->user = 0; } return $result; } /** * Get modules by position * * @param string $position The position of the module * * @return array An array of module objects * * @since 11.1 */ public static function &getModules($position) { $position = strtolower($position); $result = array(); $modules =& JModuleHelper::_load(); $total = count($modules); for ($i = 0; $i < $total; $i++) { if ($modules[$i]->position == $position) { $result[] = &$modules[$i]; } } if (count($result) == 0) { if (JRequest::getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) { $result[0] = JModuleHelper::getModule('mod_' . $position); $result[0]->title = $position; $result[0]->content = $position; $result[0]->position = $position; } } return $result; } /** * Checks if a module is enabled * * @param string $module The module name * * @return boolean * * @since 11.1 */ public static function isEnabled($module) { $result = JModuleHelper::getModule($module); return !is_null($result); } /** * Render the module. * * @param object $module A module object. * @param array $attribs An array of attributes for the module (probably from the XML). * * @return string The HTML content of the module output. * * @since 11.1 */ public static function renderModule($module, $attribs = array()) { static $chrome; if (constant('JDEBUG')) { JProfiler::getInstance('Application')->mark('beforeRenderModule ' . $module->module . ' (' . $module->title . ')'); } $app = JFactory::getApplication(); // Record the scope. $scope = $app->scope; // Set scope to component name $app->scope = $module->module; // Get module parameters $params = new JRegistry; $params->loadString($module->params); // Get module path $module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module); $path = JPATH_BASE . '/modules/' . $module->module . '/' . $module->module . '.php'; // Load the module // $module->user is a check for 1.0 custom modules and is deprecated refactoring if (empty($module->user) && file_exists($path)) { $lang = JFactory::getLanguage(); // 1.5 or Core then 1.6 3PD $lang->load($module->module, JPATH_BASE, null, false, false) || $lang->load($module->module, dirname($path), null, false, false) || $lang->load($module->module, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($module->module, dirname($path), $lang->getDefault(), false, false); $content = ''; ob_start(); include $path; $module->content = ob_get_contents() . $content; ob_end_clean(); } // Load the module chrome functions if (!$chrome) { $chrome = array(); } include_once JPATH_THEMES . '/system/html/modules.php'; $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/modules.php'; if (!isset($chrome[$chromePath])) { if (file_exists($chromePath)) { include_once $chromePath; } $chrome[$chromePath] = true; } // Make sure a style is set if (!isset($attribs['style'])) { $attribs['style'] = 'none'; } // Dynamically add outline style if (JRequest::getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) { $attribs['style'] .= ' outline'; } foreach (explode(' ', $attribs['style']) as $style) { $chromeMethod = 'modChrome_' . $style; // Apply chrome and render module if (function_exists($chromeMethod)) { $module->style = $attribs['style']; ob_start(); $chromeMethod($module, $params, $attribs); $module->content = ob_get_contents(); ob_end_clean(); } } //revert the scope $app->scope = $scope; if (constant('JDEBUG')) { JProfiler::getInstance('Application')->mark('afterRenderModule ' . $module->module . ' (' . $module->title . ')'); } return $module->content; } /** * Get the path to a layout for a module * * @param string $module The name of the module * @param string $layout The name of the module layout. If alternative layout, in the form template:filename. * * @return string The path to the module layout * * @since 11.1 */ public static function getLayoutPath($module, $layout = 'default') { $template = JFactory::getApplication()->getTemplate(); $defaultLayout = $layout; if (strpos($layout, ':') !== false) { // Get the template and file name from the string $temp = explode(':', $layout); $template = ($temp[0] == '_') ? $template : $temp[0]; $layout = $temp[1]; $defaultLayout = ($temp[1]) ? $temp[1] : 'default'; } // Build the template and base path for the layout $hPath = Helix::pluginPath() . '/html/' . $module . '/' . $layout . '.php'; // from helix $tPath = JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php'; $bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php'; $dPath = JPATH_BASE . '/modules/' . $module . '/tmpl/default.php'; // If the template has a layout override use it if (file_exists($tPath)) { return $tPath; } elseif (file_exists($hPath)) { return $hPath; } elseif (file_exists($bPath)) { return $bPath; } else { return $dPath; } } /** * Load published modules. * * @return array * * @since 11.1 */ protected static function &_load() { static $clean; if (isset($clean)) { return $clean; } $Itemid = JRequest::getInt('Itemid'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $lang = JFactory::getLanguage()->getTag(); $clientId = (int) $app->getClientId(); $cache = JFactory::getCache('com_modules', ''); $cacheid = md5(serialize(array($Itemid, $groups, $clientId, $lang))); if (!($clean = $cache->get($cacheid))) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid'); $query->from('#__modules AS m'); $query->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = m.id'); $query->where('m.published = 1'); $query->join('LEFT', '#__extensions AS e ON e.element = m.module AND e.client_id = m.client_id'); $query->where('e.enabled = 1'); $date = JFactory::getDate(); $now = $date->toSql(); $nullDate = $db->getNullDate(); $query->where('(m.publish_up = ' . $db->Quote($nullDate) . ' OR m.publish_up <= ' . $db->Quote($now) . ')'); $query->where('(m.publish_down = ' . $db->Quote($nullDate) . ' OR m.publish_down >= ' . $db->Quote($now) . ')'); $query->where('m.access IN (' . $groups . ')'); $query->where('m.client_id = ' . $clientId); $query->where('(mm.menuid = ' . (int) $Itemid . ' OR mm.menuid <= 0)'); // Filter by language if ($app->isSite() && $app->getLanguageFilter()) { $query->where('m.language IN (' . $db->Quote($lang) . ',' . $db->Quote('*') . ')'); } $query->order('m.position, m.ordering'); // Set the query $db->setQuery($query); $modules = $db->loadObjectList(); $clean = array(); if ($db->getErrorNum()) { JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg())); return $clean; } // Apply negative selections and eliminate duplicates $negId = $Itemid ? -(int) $Itemid : false; $dupes = array(); for ($i = 0, $n = count($modules); $i < $n; $i++) { $module = &$modules[$i]; // The module is excluded if there is an explicit prohibition $negHit = ($negId === (int) $module->menuid); if (isset($dupes[$module->id])) { // If this item has been excluded, keep the duplicate flag set, // but remove any item from the cleaned array. if ($negHit) { unset($clean[$module->id]); } continue; } $dupes[$module->id] = true; // Only accept modules without explicit exclusions. if (!$negHit) { // Determine if this is a 1.0 style custom module (no mod_ prefix) // This should be eliminated when the class is refactored. // $module->user is deprecated. $file = $module->module; $custom = substr($file, 0, 4) == 'mod_' ? 0 : 1; $module->user = $custom; // 1.0 style custom module name is given by the title field, otherwise strip off "mod_" $module->name = $custom ? $module->module : substr($file, 4); $module->style = null; $module->position = strtolower($module->position); $clean[$module->id] = $module; } } unset($dupes); // Return to simple indexing that matches the query order. $clean = array_values($clean); $cache->store($clean, $cacheid); } return $clean; } /** * Module cache helper * * Caching modes: * To be set in XML: * 'static' One cache file for all pages with the same module parameters * 'oldstatic' 1.5 definition of module caching, one cache file for all pages * with the same module id and user aid, * 'itemid' Changes on itemid change, to be called from inside the module: * 'safeuri' Id created from $cacheparams->modeparams array, * 'id' Module sets own cache id's * * @param object $module Module object * @param object $moduleparams Module parameters * @param object $cacheparams Module cache parameters - id or url parameters, depending on the module cache mode * * @return string * * @since 11.1 * * @link JFilterInput::clean() */ public static function moduleCache($module, $moduleparams, $cacheparams) { if (!isset($cacheparams->modeparams)) { $cacheparams->modeparams = null; } if (!isset($cacheparams->cachegroup)) { $cacheparams->cachegroup = $module->module; } $user = JFactory::getUser(); $cache = JFactory::getCache($cacheparams->cachegroup, 'callback'); $conf = JFactory::getConfig(); // Turn cache off for internal callers if parameters are set to off and for all logged in users if ($moduleparams->get('owncache', null) === '0' || $conf->get('caching') == 0 || $user->get('id')) { $cache->setCaching(false); } // module cache is set in seconds, global cache in minutes, setLifeTime works in minutes $cache->setLifeTime($moduleparams->get('cache_time', $conf->get('cachetime') * 60) / 60); $wrkaroundoptions = array('nopathway' => 1, 'nohead' => 0, 'nomodules' => 1, 'modulemode' => 1, 'mergehead' => 1); $wrkarounds = true; $view_levels = md5(serialize($user->getAuthorisedViewLevels())); switch ($cacheparams->cachemode) { case 'id': $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $cacheparams->modeparams, $wrkarounds, $wrkaroundoptions ); break; case 'safeuri': $secureid = null; if (is_array($cacheparams->modeparams)) { $uri = JRequest::get(); $safeuri = new stdClass; foreach ($cacheparams->modeparams as $key => $value) { // Use int filter for id/catid to clean out spamy slugs if (isset($uri[$key])) { $safeuri->$key = JRequest::_cleanVar($uri[$key], 0, $value); } } } $secureid = md5(serialize(array($safeuri, $cacheparams->method, $moduleparams))); $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels . $secureid, $wrkarounds, $wrkaroundoptions ); break; case 'static': $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->module . md5(serialize($cacheparams->methodparams)), $wrkarounds, $wrkaroundoptions ); break; case 'oldstatic': // provided for backward compatibility, not really usefull $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels, $wrkarounds, $wrkaroundoptions ); break; case 'itemid': default: $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels . JRequest::getVar('Itemid', null, 'default', 'INT'), $wrkarounds, $wrkaroundoptions ); break; } return $ret; } } PK ni.]��i� � ! core/classes/joomla25/message.phpnu &1i� <?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocument system message renderer * * @package Joomla.Platform * @subpackage Document * @since 11.1 */ class JDocumentRendererMessage extends JDocumentRenderer { /** * Renders the error stack and returns the results as a string * * @param string $name Not used. * @param array $params Associative array of values * @param string $content Not used. * * @return string The output of the script * * @since 11.1 */ public function render($name, $params = array (), $content = null) { $msgList = $this->getData(); $buffer = null; $app = JFactory::getApplication(); $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php'; $itemOverride = false; if (file_exists($chromePath)) { include_once $chromePath; if (function_exists('renderMessage')) { $itemOverride = true; } } $buffer = ($itemOverride) ? renderMessage($msgList) : $this->renderDefaultMessage($msgList); return $buffer; } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 12.2 */ private function getData() { // Initialise variables. $lists = array(); // Get the message queue $messages = JFactory::getApplication()->getMessageQueue(); // Build the sorted message list if (is_array($messages) && !empty($messages)) { foreach ($messages as $msg) { if (isset($msg['type']) && isset($msg['message'])) { $lists[$msg['type']][] = $msg['message']; } } } return $lists; } /** * Render the system message if no message template file found * * @param array $msgList An array contains system message * * @return string System message markup * * @since 12.2 */ private function renderDefaultMessage($msgList) { // Build the return string $buffer = ''; $buffer .= "\n<div id=\"system-message-container\">"; // If messages exist render them if (is_array($msgList)) { $buffer .= "\n<div id=\"system-message\">"; foreach ($msgList as $type => $msgs) { $buffer .= "\n<div class=\"alert alert-" . $type . "\">"; // This requires JS so we should add it trough JS. Progressive enhancement and stuff. $buffer .= "<a class=\"close\" data-dismiss=\"alert\">×</a>"; if (count($msgs)) { $buffer .= "\n<h4 class=\"alert-heading\">" . JText::_($type) . "</h4>"; $buffer .= "\n<div>"; foreach ($msgs as $msg) { $buffer .= "\n\t\t<p>" . $msg . "</p>"; } $buffer .= "\n</div>"; } $buffer .= "\n</div>"; } $buffer .= "\n</div>"; } $buffer .= "\n</div>"; return $buffer; } }PK ni.]�=���{ �{ "