0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: loadmodule.tar
loadmodule.xml 0000666 00000002675 15137301131 0007424 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="2.5" type="plugin" group="content"> <name>plg_content_loadmodule</name> <author>Joomla! Project</author> <creationDate>November 2005</creationDate> <copyright>Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>2.5.0</version> <description>PLG_LOADMODULE_XML_DESCRIPTION</description> <files> <filename plugin="loadmodule">loadmodule.php</filename> <filename>index.html</filename> </files> <languages> <language tag="en-GB">en-GB.plg_content_loadmodule.ini</language> <language tag="en-GB">en-GB.plg_content_loadmodule.sys.ini</language> </languages> <config> <fields name="params"> <fieldset name="basic"> <field name="style" type="list" default="table" description="PLG_LOADMODULE_FIELD_STYLE_DESC" label="PLG_LOADMODULE_FIELD_STYLE_LABEL"> <option value="table">PLG_LOADMODULE_FIELD_VALUE_TABLE</option> <option value="horz">PLG_LOADMODULE_FIELD_VALUE_HORIZONTAL</option> <option value="xhtml">PLG_LOADMODULE_FIELD_VALUE_DIVS</option> <option value="rounded">PLG_LOADMODULE_FIELD_VALUE_MULTIPLEDIVS</option> <option value="none">PLG_LOADMODULE_FIELD_VALUE_RAW</option> </field> </fieldset> </fields> </config> </extension> loadmodule.php 0000666 00000011220 15137301131 0007375 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Content.loadmodule * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; class plgContentLoadmodule extends JPlugin { protected static $modules = array(); protected static $mods = array(); /** * Plugin that loads module positions within content * * @param string The context of the content being passed to the plugin. * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number */ public function onContentPrepare($context, &$article, &$params, $page = 0) { // Don't run this plugin when the content is being indexed if ($context == 'com_finder.indexer') { return true; } // simple performance check to determine whether bot should process further if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false) { return true; } // expression to search for (positions) $regex = '/{loadposition\s+(.*?)}/i'; $style = $this->params->def('style', 'none'); // expression to search for(modules) $regexmod = '/{loadmodule\s+(.*?)}/i'; $title = null; $stylemod = $this->params->def('style', 'none'); // Find all instances of plugin and put in $matches for loadposition // $matches[0] is full pattern match, $matches[1] is the position preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER); // No matches, skip this if ($matches) { foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); // We may not have a module style so fall back to the plugin default. if (!array_key_exists(1, $matcheslist)) { $matcheslist[1] = $style; } $position = trim($matcheslist[0]); $style = trim($matcheslist[1]); $output = $this->_load($position, $style); // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: $article->text = preg_replace("|$match[0]|", addcslashes($output, '\\$'), $article->text, 1); } } // Find all instances of plugin and put in $matchesmod for loadmodule preg_match_all($regexmod, $article->text, $matchesmod, PREG_SET_ORDER); // If no matches, skip this if ($matchesmod){ foreach ($matchesmod as $matchmod) { $matchesmodlist = explode(',', $matchmod[1]); //We may not have a specific module so set to null if (!array_key_exists(1, $matchesmodlist)) { $matchesmodlist[1] = null; } // We may not have a module style so fall back to the plugin default. if (!array_key_exists(2, $matchesmodlist)) { $matchesmodlist[2] = $stylemod; } $module = trim($matchesmodlist[0]); $name = htmlspecialchars_decode(trim($matchesmodlist[1])); $style = trim($matchesmodlist[2]); // $match[0] is full pattern match, $match[1] is the module,$match[2] is the title $output = $this->_loadmod($module, $name, $style); // We should replace only first occurrence in order to allow positions with the same name to regenerate their content: $article->text = preg_replace("|$matchmod[0]|", addcslashes($output, '\\$'), $article->text, 1); } } } protected function _load($position, $style = 'none') { if (!isset(self::$modules[$position])) { self::$modules[$position] = ''; $document = JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $modules = JModuleHelper::getModules($position); $params = array('style' => $style); ob_start(); foreach ($modules as $module) { echo $renderer->render($module, $params); } self::$modules[$position] = ob_get_clean(); } return self::$modules[$position]; } // This is always going to get the first instance of the module type unless // there is a title. protected function _loadmod($module, $title, $style = 'none') { $moduleinstance = $module . JStringNormalise::toCamelCase($title); if (!isset(self::$mods[$moduleinstance])) { self::$mods[$moduleinstance] = ''; $document = JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $mod = JModuleHelper::getModule($module, $title); // If the module without the mod_ isn't found, try it with mod_. // This allows people to enter it either way in the content if (!isset($mod)){ $name = 'mod_'.$module; $mod = JModuleHelper::getModule($name, $title); } $params = array('style' => $style); ob_start(); echo $renderer->render($mod, $params); self::$mods[$moduleinstance] = ob_get_clean(); } return self::$mods[$moduleinstance]; } } index.html 0000666 00000000037 15137301131 0006540 0 ustar 00 <!DOCTYPE html><title></title> .htaccess 0000666 00000000177 15137301131 0006346 0 ustar 00 <FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>