0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: modules.php.tar
home/academiac/www/templates/ideas/html/modules.php 0000604 00000005365 15137144347 0016435 0 ustar 00 <?php defined('_JEXEC') or die; if (!defined('_ARTX_FUNCTIONS')) require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php'); function modChrome_artstyle($module, &$params, &$attribs) { $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'awp-nostyle'; $styles = array( 'awp-nostyle' => 'modChrome_artnostyle', 'awp-block' => 'modChrome_artblock', 'awp-article' => 'modChrome_artarticle', 'awp-vmenu' => 'modChrome_artvmenu' ); // moduleclass_sfx support: // '' or 'suffix' - use default style, suffix will not be added to the module tag // but will be added to the module elements. // ' suffix' - adds suffix to the module root tag as well as to the module elements. // 'awp-...' - overwrites module style. // 'awp-... suffix' - overwrites style and adds suffix to the module root tag and // to the module elements, does not add awp-... to the module elements. $classes = ''; $sfx = $params->get('moduleclass_sfx'); if (strlen($sfx) != 0) { if (' ' == $sfx[0]) $classes = $sfx; else { $parts = explode(' ', $sfx, 2); if (in_array($parts[0], array_keys($styles))) { $style = $parts[0]; if (count($parts) > 1) $classes = ' ' . $parts[1]; $params->set('moduleclass_sfx', $classes); } } } $params->set('artx-module-classes', $classes); call_user_func($styles[$style], $module, $params, $attribs); } function modChrome_artnostyle($module, &$params, &$attribs) { if (!empty ($module->content)) : ?> <div class="awp-nostyle<?php echo $params->get('artx-module-classes'); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> <?php endif; } function modChrome_artblock($module, &$params, &$attribs) { if (!empty ($module->content)) echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } function modChrome_artvmenu($module, &$params, &$attribs) { if (!empty ($module->content)) { if (function_exists('artxVMenuBlock')) echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); else echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } } function modChrome_artarticle($module, &$params, &$attribs) { if (!empty ($module->content)) { $data = array('classes' => $params->get('artx-module-classes'), 'content' => $module->content); if ($module->showtitle != 0) $data['header-text'] = $module->title; echo artxPost($data); } } home/academiac/www/administrator/templates/hathor/html/modules.php 0000644 00000002371 15137177524 0021516 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage Templates.hathor * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @since 1.6 */ // no direct access defined('_JEXEC') or die; /** * This is a file to add template specific chrome to module rendering. To use it you would * set the style attribute for the given module(s) include in your template to use the style * for each given modChrome function. * * eg. To render a module mod_test in the submenu style, you would use the following include: * <jdoc:include type="module" name="test" style="submenu" /> * * This gives template designers ultimate control over how modules are rendered. * * NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE} and take the same * two arguments. */ /* * Module chrome for rendering the module in a submenu */ function modChrome_xhtmlid($module, &$params, &$attribs) { if ($module->content) { ?> <div id="<?php echo (int)$attribs['id'] ?>"> <?php echo $module->content; ?> <div class="clr"></div> </div> <?php } elseif ($attribs['id'] == "submenu-box") { ?> <div id="no-submenu"></div> <?php } } ?> home/academiac/www/administrator/templates/system/html/modules.php 0000644 00000003763 15137204570 0021553 0 ustar 00 <?php /** * @package Joomla.Administrator * @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; /* * none (output raw module content) */ function modChrome_none($module, &$params, &$attribs) { echo $module->content; } /* * xhtml (divs and font header tags) */ function modChrome_xhtml($module, &$params, &$attribs) { $content = trim($module->content); if (!empty ($content)) : ?> <div class="module<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $content; ?> </div> <?php endif; } /* * allows sliders */ function modChrome_sliders($module, &$params, &$attribs) { $content = trim($module->content); if (!empty($content)) { if ($params->get('automatic_title', '0')=='0') { echo JHtml::_('sliders.panel', $module->title, 'module'.$module->id); } elseif (method_exists('mod'.$module->name.'Helper', 'getTitle')) { echo JHtml::_('sliders.panel', call_user_func_array(array('mod'.$module->name.'Helper','getTitle'), array($params, $module)), 'module'.$module->id); } else { echo JHtml::_('sliders.panel', JText::_('MOD_'.$module->name.'_TITLE'), 'module'.$module->id); } echo $content; } } /* * allows tabs */ function modChrome_tabs($module, &$params, &$attribs) { $content = trim($module->content); if (!empty($content)) { if ($params->get('automatic_title', '0')=='0') { echo JHtml::_('tabs.panel', $module->title, 'module'.$module->id); } elseif (method_exists('mod'.$module->name.'Helper', 'getTitle')) { echo JHtml::_('tabs.panel', call_user_func_array(array('mod'.$module->name.'Helper', 'getTitle'), array($params)), 'module'.$module->id); } else { echo JHtml::_('tabs.panel', JText::_('MOD_'.$module->name.'_TITLE'), 'module'.$module->id); } echo $content; } } home/academiac/www/templates/mw_business/html/modules.php 0000604 00000005365 15137246057 0017707 0 ustar 00 <?php defined('_JEXEC') or die; if (!defined('_ARTX_FUNCTIONS')) require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php'); function modChrome_artstyle($module, &$params, &$attribs) { $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle'; $styles = array( 'art-nostyle' => 'modChrome_artnostyle', 'art-block' => 'modChrome_artblock', 'art-article' => 'modChrome_artarticle', 'art-vmenu' => 'modChrome_artvmenu' ); // moduleclass_sfx support: // '' or 'suffix' - use default style, suffix will not be added to the module tag // but will be added to the module elements. // ' suffix' - adds suffix to the module root tag as well as to the module elements. // 'art-...' - overwrites module style. // 'art-... suffix' - overwrites style and adds suffix to the module root tag and // to the module elements, does not add art-... to the module elements. $classes = ''; $sfx = $params->get('moduleclass_sfx'); if (strlen($sfx) != 0) { if (' ' == $sfx[0]) $classes = $sfx; else { $parts = explode(' ', $sfx, 2); if (in_array($parts[0], array_keys($styles))) { $style = $parts[0]; if (count($parts) > 1) $classes = ' ' . $parts[1]; $params->set('moduleclass_sfx', $classes); } } } $params->set('artx-module-classes', $classes); call_user_func($styles[$style], $module, $params, $attribs); } function modChrome_artnostyle($module, &$params, &$attribs) { if (!empty ($module->content)) : ?> <div class="art-nostyle<?php echo $params->get('artx-module-classes'); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> <?php endif; } function modChrome_artblock($module, &$params, &$attribs) { if (!empty ($module->content)) echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } function modChrome_artvmenu($module, &$params, &$attribs) { if (!empty ($module->content)) { if (function_exists('artxVMenuBlock')) echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); else echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } } function modChrome_artarticle($module, &$params, &$attribs) { if (!empty ($module->content)) { $data = array('classes' => $params->get('artx-module-classes'), 'content' => $module->content); if ($module->showtitle != 0) $data['header-text'] = $module->title; echo artxPost($data); } } home/academiac/www/administrator/templates/bluestork/html/modules.php 0000644 00000002252 15137250241 0022225 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage Templates.bluestork * @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; /** * This is a file to add template specific chrome to module rendering. To use it you would * set the style attribute for the given module(s) include in your template to use the style * for each given modChrome function. * * eg. To render a module mod_test in the submenu style, you would use the following include: * <jdoc:include type="module" name="test" style="submenu" /> * * This gives template designers ultimate control over how modules are rendered. * * NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE} and take the same * two arguments. */ /* * Module chrome for rendering the module in a submenu */ function modChrome_rounded($module, &$params, &$attribs) { if ($module->content) { ?> <div id="<?php echo $attribs['id'] ?>"> <div class="m"> <?php echo $module->content; ?> <div class="clr"></div> </div> </div> <?php } } ?> home/academiac/www/administrator/components/com_modules/modules.php 0000644 00000001052 15137252040 0021740 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_modules * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Access check. if (!JFactory::getUser()->authorise('core.manage', 'com_modules')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } $controller = JControllerLegacy::getInstance('Modules'); $controller->execute(JRequest::getCmd('task')); $controller->redirect(); home/academiac/www/administrator/components/com_modules/helpers/modules.php 0000644 00000011653 15137252221 0023413 0 ustar 00 <?php /** * @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; /** * Modules component helper. * * @package Joomla.Administrator * @subpackage com_modules * @since 1.6 */ abstract class ModulesHelper { /** * Configure the Linkbar. * * @param string The name of the active view. */ public static function addSubmenu($vName) { // Not used in this component. } /** * Gets a list of the actions that can be performed. * * @return JObject */ public static function getActions() { $user = JFactory::getUser(); $result = new JObject; $actions = JAccess::getActions('com_modules'); foreach ($actions as $action) { $result->set($action->name, $user->authorise($action->name, 'com_modules')); } return $result; } /** * Get a list of filter options for the state of a module. * * @return array An array of JHtmlOption elements. */ public static function getStateOptions() { // Build the filter options. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED')); $options[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED')); $options[] = JHtml::_('select.option', '-2', JText::_('JTRASHED')); return $options; } /** * Get a list of filter options for the application clients. * * @return array An array of JHtmlOption elements. */ public static function getClientOptions() { // Build the filter options. $options = array(); $options[] = JHtml::_('select.option', '0', JText::_('JSITE')); $options[] = JHtml::_('select.option', '1', JText::_('JADMINISTRATOR')); return $options; } static function getPositions($clientId) { jimport('joomla.filesystem.folder'); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('DISTINCT(position)'); $query->from('#__modules'); $query->where($db->quoteName('client_id').' = '.(int) $clientId); $query->order('position'); $db->setQuery($query); $positions = $db->loadColumn(); $positions = (is_array($positions)) ? $positions : array(); if ($error = $db->getErrorMsg()) { JError::raiseWarning(500, $error); return; } // Build the list $options = array(); foreach ($positions as $position) { if (!$position) { $options[] = JHtml::_('select.option', 'none', ':: '.JText::_('JNONE').' ::'); } else { $options[] = JHtml::_('select.option', $position, $position); } } return $options; } public static function getTemplates($clientId = 0, $state = '', $template='') { $db = JFactory::getDbo(); // Get the database object and a new query object. $query = $db->getQuery(true); // Build the query. $query->select('element, name, enabled'); $query->from('#__extensions'); $query->where('client_id = '.(int) $clientId); $query->where('type = '.$db->quote('template')); if ($state!='') { $query->where('enabled = '.$db->quote($state)); } if ($template!='') { $query->where('element = '.$db->quote($template)); } // Set the query and load the templates. $db->setQuery($query); $templates = $db->loadObjectList('element'); return $templates; } /** * Get a list of the unique modules installed in the client application. * * @param int The client id. * * @return array */ public static function getModules($clientId) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('element AS value, name AS text'); $query->from('#__extensions as e'); $query->where('e.client_id = '.(int)$clientId); $query->where('type = '.$db->quote('module')); $query->leftJoin('#__modules as m ON m.module=e.element AND m.client_id=e.client_id'); $query->where('m.module IS NOT NULL'); $query->group('element,name'); $db->setQuery($query); $modules = $db->loadObjectList(); $lang = JFactory::getLanguage(); foreach ($modules as $i=>$module) { $extension = $module->value; $path = $clientId ? JPATH_ADMINISTRATOR : JPATH_SITE; $source = $path . "/modules/$extension"; $lang->load("$extension.sys", $path, null, false, true) || $lang->load("$extension.sys", $source, null, false, true); $modules[$i]->text = JText::_($module->text); } JArrayHelper::sortObjects($modules, 'text', 1, true, $lang->getLocale()); return $modules; } /** * Get a list of the assignment options for modules to menus. * * @param int The client id. * * @return array */ public static function getAssignmentOptions($clientId) { $options = array(); $options[] = JHtml::_('select.option', '0', 'COM_MODULES_OPTION_MENU_ALL'); $options[] = JHtml::_('select.option', '-', 'COM_MODULES_OPTION_MENU_NONE'); if ($clientId == 0) { $options[] = JHtml::_('select.option', '1', 'COM_MODULES_OPTION_MENU_INCLUDE'); $options[] = JHtml::_('select.option', '-1', 'COM_MODULES_OPTION_MENU_EXCLUDE'); } return $options; } } home/academiac/www/administrator/components/com_modules/models/modules.php 0000644 00000022357 15137362357 0023253 0 ustar 00 <?php /** * @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; jimport('joomla.application.component.modellist'); /** * Modules Component Module Model * * @package Joomla.Administrator * @subpackage com_modules * @since 1.5 */ class ModulesModelModules extends JModelList { /** * Constructor. * * @param array An optional associative array of configuration settings. * @see JController * @since 1.6 */ public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'id', 'a.id', 'title', 'a.title', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', 'published', 'a.published', 'access', 'a.access', 'access_level', 'ordering', 'a.ordering', 'module', 'a.module', 'language', 'a.language', 'language_title', 'publish_up', 'a.publish_up', 'publish_down', 'a.publish_down', 'client_id', 'a.client_id', 'position', 'a.position', 'pages', 'name', 'e.name', ); } parent::__construct($config); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { // Initialise variables. $app = JFactory::getApplication('administrator'); // Load the filter state. $search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $this->setState('filter.search', $search); $accessId = $this->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', null, 'int'); $this->setState('filter.access', $accessId); $state = $this->getUserStateFromRequest($this->context.'.filter.state', 'filter_state', '', 'string'); $this->setState('filter.state', $state); $position = $this->getUserStateFromRequest($this->context.'.filter.position', 'filter_position', '', 'string'); $this->setState('filter.position', $position); $module = $this->getUserStateFromRequest($this->context.'.filter.module', 'filter_module', '', 'string'); $this->setState('filter.module', $module); $clientId = $this->getUserStateFromRequest($this->context.'.filter.client_id', 'filter_client_id', 0, 'int', false); $previousId = $app->getUserState($this->context.'.filter.client_id_previous', null); if($previousId != $clientId || $previousId === null){ $this->getUserStateFromRequest($this->context.'.filter.client_id_previous', 'filter_client_id_previous', 0, 'int', true); $app->setUserState($this->context.'.filter.client_id_previous', $clientId); } $this->setState('filter.client_id', $clientId); $language = $this->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', ''); $this->setState('filter.language', $language); // Load the parameters. $params = JComponentHelper::getParams('com_modules'); $this->setState('params', $params); // List state information. parent::populateState('position', 'asc'); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.search'); $id .= ':'.$this->getState('filter.access'); $id .= ':'.$this->getState('filter.state'); $id .= ':'.$this->getState('filter.position'); $id .= ':'.$this->getState('filter.module'); $id .= ':'.$this->getState('filter.client_id'); $id .= ':'.$this->getState('filter.language'); return parent::getStoreId($id); } /** * Returns an object list * * @param string The query * @param int Offset * @param int The number of records * @return array */ protected function _getList($query, $limitstart=0, $limit=0) { $ordering = $this->getState('list.ordering', 'ordering'); if (in_array($ordering, array('pages', 'name'))) { $this->_db->setQuery($query); $result = $this->_db->loadObjectList(); $this->translate($result); $lang = JFactory::getLanguage(); JArrayHelper::sortObjects($result, $ordering, $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale()); $total = count($result); $this->cache[$this->getStoreId('getTotal')] = $total; if ($total < $limitstart) { $limitstart = 0; $this->setState('list.start', 0); } return array_slice($result, $limitstart, $limit ? $limit : null); } else { if ($ordering == 'ordering') { $query->order('a.position ASC'); $ordering = 'a.ordering'; } if ($ordering == 'language_title') { $ordering = 'l.title'; } $query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction')); if ($ordering == 'position') { $query->order('a.ordering ASC'); } $result = parent::_getList($query, $limitstart, $limit); $this->translate($result); return $result; } } /** * Translate a list of objects * * @param array The array of objects * @return array The array of translated objects */ protected function translate(&$items) { $lang = JFactory::getLanguage(); $client = $this->getState('filter.client_id') ? 'administrator' : 'site'; foreach($items as $item) { $extension = $item->module; $source = constant('JPATH_' . strtoupper($client)) . "/modules/$extension"; $lang->load("$extension.sys", constant('JPATH_' . strtoupper($client)), null, false, true) || $lang->load("$extension.sys", $source, null, false, true); $item->name = JText::_($item->name); if (is_null($item->pages)) { $item->pages = JText::_('JNONE'); } elseif ($item->pages < 0) { $item->pages = JText::_('COM_MODULES_ASSIGNED_VARIES_EXCEPT'); } elseif ($item->pages > 0) { $item->pages = JText::_('COM_MODULES_ASSIGNED_VARIES_ONLY'); } else { $item->pages = JText::_('JALL'); } } } /** * Build an SQL query to load the list data. * * @return JDatabaseQuery */ protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.id, a.title, a.note, a.position, a.module, a.language,' . 'a.checked_out, a.checked_out_time, a.published+2*(e.enabled-1) as published, a.access, a.ordering, a.publish_up, a.publish_down' ) ); $query->from($db->quoteName('#__modules').' AS a'); // Join over the language $query->select('l.title AS language_title'); $query->join('LEFT', $db->quoteName('#__languages').' AS l ON l.lang_code = a.language'); // Join over the users for the checked out user. $query->select('uc.name AS editor'); $query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out'); // Join over the asset groups. $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Join over the module menus $query->select('MIN(mm.menuid) AS pages'); $query->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = a.id'); // Join over the extensions $query->select('e.name AS name'); $query->join('LEFT', '#__extensions AS e ON e.element = a.module'); $query->group('a.id, a.title, a.note, a.position, a.module, a.language,a.checked_out,'. 'a.checked_out_time, a.published, a.access, a.ordering,l.title, uc.name, ag.title, e.name,'. 'l.lang_code, uc.id, ag.id, mm.moduleid, e.element, a.publish_up, a.publish_down,e.enabled'); // Filter by access level. if ($access = $this->getState('filter.access')) { $query->where('a.access = '.(int) $access); } // Filter by published state $state = $this->getState('filter.state'); if (is_numeric($state)) { $query->where('a.published = '.(int) $state); } elseif ($state === '') { $query->where('(a.published IN (0, 1))'); } // Filter by position $position = $this->getState('filter.position'); if ($position && $position != 'none') { $query->where('a.position = '.$db->Quote($position)); } elseif ($position == 'none') { $query->where('a.position = '.$db->Quote('')); } // Filter by module $module = $this->getState('filter.module'); if ($module) { $query->where('a.module = '.$db->Quote($module)); } // Filter by client. $clientId = $this->getState('filter.client_id'); if (is_numeric($clientId)) { $query->where('a.client_id = ' . (int) $clientId . ' AND e.client_id ='. (int) $clientId); } // Filter by search in title $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('('.'a.title LIKE '.$search.' OR a.note LIKE '.$search.')'); } } // Filter on the language. if ($language = $this->getState('filter.language')) { $query->where('a.language = ' . $db->quote($language)); } //echo nl2br(str_replace('#__','jos_',$query)); return $query; } } home/academiac/www/administrator/components/com_modules/helpers/html/modules.php 0000644 00000011424 15137370624 0024363 0 ustar 00 <?php /** * @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; /** * @package Joomla.Administrator * @subpackage com_modules * @since 1.6 */ abstract class JHtmlModules { /** * @param int $clientId The client id * @param string $state The state of the template */ static public function templates($clientId = 0, $state = '') { $templates = ModulesHelper::getTemplates($clientId, $state); foreach ($templates as $template) { $options[] = JHtml::_('select.option', $template->element, $template->name); } return $options; } /** */ static public function types() { $options = array(); $options[] = JHtml::_('select.option', 'user', 'COM_MODULES_OPTION_POSITION_USER_DEFINED'); $options[] = JHtml::_('select.option', 'template', 'COM_MODULES_OPTION_POSITION_TEMPLATE_DEFINED'); return $options; } /** */ static public function templateStates() { $options = array(); $options[] = JHtml::_('select.option', '1', 'JENABLED'); $options[] = JHtml::_('select.option', '0', 'JDISABLED'); return $options; } /** * Returns a published state on a grid * * @param integer $value The state value. * @param integer $i The row index * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string The Html code * * @see JHtmlJGrid::state * * @since 1.7.1 */ public static function state($value, $i, $enabled = true, $checkbox = 'cb') { $states = array( 1 => array( 'unpublish', 'COM_MODULES_EXTENSION_PUBLISHED_ENABLED', 'COM_MODULES_HTML_UNPUBLISH_ENABLED', 'COM_MODULES_EXTENSION_PUBLISHED_ENABLED', true, 'publish', 'publish' ), 0 => array( 'publish', 'COM_MODULES_EXTENSION_UNPUBLISHED_ENABLED', 'COM_MODULES_HTML_PUBLISH_ENABLED', 'COM_MODULES_EXTENSION_UNPUBLISHED_ENABLED', true, 'unpublish', 'unpublish' ), -1 => array( 'unpublish', 'COM_MODULES_EXTENSION_PUBLISHED_DISABLED', 'COM_MODULES_HTML_UNPUBLISH_DISABLED', 'COM_MODULES_EXTENSION_PUBLISHED_DISABLED', true, 'warning', 'warning' ), -2 => array( 'publish', 'COM_MODULES_EXTENSION_UNPUBLISHED_DISABLED', 'COM_MODULES_HTML_PUBLISH_DISABLED', 'COM_MODULES_EXTENSION_UNPUBLISHED_DISABLED', true, 'unpublish', 'unpublish' ), ); return JHtml::_('jgrid.state', $states, $value, $i, 'modules.', $enabled, true, $checkbox); } /** * Display a batch widget for the module position selector. * * @param integer $clientId The client ID * * @return string The necessary HTML for the widget. * * @since 2.5 */ public static function positions($clientId) { // Create the copy/move options. $options = array( JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')), JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE')) ); // Create the batch selector to change select the category by which to move or copy. $lines = array( '<label id="batch-choose-action-lbl" for="batch-choose-action">', JText::_('COM_MODULES_BATCH_POSITION_LABEL'), '</label>', '<fieldset id="batch-choose-action" class="combo">', '<select name="batch[position_id]" class="inputbox" id="batch-position-id">', '<option value="">' . JText::_('JSELECT') . '</option>', '<option value="nochange">' . JText::_('COM_MODULES_BATCH_POSITION_NOCHANGE') . '</option>', '<option value="noposition">' . JText::_('COM_MODULES_BATCH_POSITION_NOPOSITION') . '</option>', JHtml::_('select.options', self::positionList($clientId)), '</select>', JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'), '</fieldset>' ); return implode("\n", $lines); } /** * Method to get the field options. * * @param integer $clientId The client ID * * @return array The field option objects. * * @since 2.5 */ public static function positionList($clientId = 0) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('DISTINCT(position) as value'); $query->select('position as text'); $query->from($db->quoteName('#__modules')); $query->where($db->quoteName('client_id') . ' = ' . (int) $clientId); $query->order('position'); // Get the options. $db->setQuery($query); $options = $db->loadObjectList(); // Check for a database error. if ($db->getErrorNum()) { JError::raiseWarning(500, $db->getErrorMsg()); } // Pop the first item off the array if it's blank if (strlen($options[0]->text) < 1) { array_shift($options); } return $options; } } home/academiac/www/templates/beez_20/html/modules.php 0000644 00000007121 15137433620 0016565 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage Templates.beez_20 * @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; /** * beezDivision chrome. * * @since 1.6 */ function modChrome_beezDivision($module, &$params, &$attribs) { $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3; if (!empty ($module->content)) { ?> <div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>"> <?php if ($module->showtitle) { ?> <h<?php echo $headerLevel; ?>><span class="backh"><span class="backh2"><span class="backh3"><?php echo $module->title; ?></span></span></span></h<?php echo $headerLevel; ?>> <?php }; ?> <?php echo $module->content; ?></div> <?php }; } /** * beezHide chrome. * * @since 1.6 */ function modChrome_beezHide($module, &$params, &$attribs) { $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3; $state=isset($attribs['state']) ? (int) $attribs['state'] :0; if (!empty ($module->content)) { ?> <div class="moduletable_js <?php echo htmlspecialchars($params->get('moduleclass_sfx'));?>"><?php if ($module->showtitle) : ?> <h<?php echo $headerLevel; ?> class="js_heading"><span class="backh"> <span class="backh1"><?php echo $module->title; ?> <a href="#" title="<?php echo JText::_('TPL_BEEZ2_CLICK'); ?>" onclick="auf('module_<?php echo $module->id; ?>'); return false" class="opencloselink" id="link_<?php echo $module->id?>"> <span class="no"><img src="templates/beez_20/images/plus.png" alt="<?php if ($state == 1) { echo JText::_('TPL_BEEZ2_ALTOPEN');} else {echo JText::_('TPL_BEEZ2_ALTCLOSE');} ?>" /> </span></a></span></span></h<?php echo $headerLevel; ?>> <?php endif; ?> <div class="module_content <?php if ($state==1){echo "open";} ?>" id="module_<?php echo $module->id; ?>" tabindex="-1"><?php echo $module->content; ?></div> </div> <?php } } /** * beezTabs chrome. * * @since 1.6 */ function modChrome_beezTabs($module, $params, $attribs) { $area = isset($attribs['id']) ? (int) $attribs['id'] :'1'; $area = 'area-'.$area; static $modulecount; static $modules; if ($modulecount < 1) { $modulecount = count(JModuleHelper::getModules($module->position)); $modules = array(); } if ($modulecount == 1) { $temp = new stdClass(); $temp->content = $module->content; $temp->title = $module->title; $temp->params = $module->params; $temp->id=$module->id; $modules[] = $temp; // list of moduletitles // list of moduletitles echo '<div id="'. $area.'" class="tabouter"><ul class="tabs">'; foreach($modules as $rendermodule) { echo '<li class="tab"><a href="#" id="link_'.$rendermodule->id.'" class="linkopen" onclick="tabshow(\'module_'. $rendermodule->id.'\');return false">'.$rendermodule->title.'</a></li>'; } echo '</ul>'; $counter=0; // modulecontent foreach($modules as $rendermodule) { $counter ++; echo '<div tabindex="-1" class="tabcontent tabopen" id="module_'.$rendermodule->id.'">'; echo $rendermodule->content; if ($counter!= count($modules)) { echo '<a href="#" class="unseen" onclick="nexttab(\'module_'. $rendermodule->id.'\');return false;" id="next_'.$rendermodule->id.'">'.JText::_('TPL_BEEZ2_NEXTTAB').'</a>'; } echo '</div>'; } $modulecount--; echo '</div>'; } else { $temp = new stdClass(); $temp->content = $module->content; $temp->params = $module->params; $temp->title = $module->title; $temp->id = $module->id; $modules[] = $temp; $modulecount--; } } home/academiac/www/administrator/components/com_modules/controllers/modules.php 0000644 00000003233 15137445442 0024323 0 ustar 00 <?php /** * @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; jimport('joomla.application.component.controlleradmin'); /** * Modules list controller class. * * @package Joomla.Administrator * @subpackage com_modules * @since 1.6 */ class ModulesControllerModules extends JControllerAdmin { /** * Method to clone an existing module. * @since 1.6 */ public function duplicate() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $pks = JRequest::getVar('cid', array(), 'post', 'array'); JArrayHelper::toInteger($pks); try { if (empty($pks)) { throw new Exception(JText::_('COM_MODULES_ERROR_NO_MODULES_SELECTED')); } $model = $this->getModel(); $model->duplicate($pks); $this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks))); } catch (Exception $e) { JError::raiseWarning(500, $e->getMessage()); } $this->setRedirect('index.php?option=com_modules&view=modules'); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 1.6 */ public function getModel($name = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } home/academiac/www/libraries/joomla/document/html/renderer/modules.php 0000644 00000002063 15137561524 0022227 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocument Modules renderer * * @package Joomla.Platform * @subpackage Document * @since 11.1 */ class JDocumentRendererModules extends JDocumentRenderer { /** * Renders multiple modules script and returns the results as a string * * @param string $position The position of the modules to render * @param array $params Associative array of values * @param string $content Module content * * @return string The output of the script * * @since 11.1 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; foreach (JModuleHelper::getModules($position) as $mod) { $buffer .= $renderer->render($mod, $params, $content); } return $buffer; } } home/academiac/www/templates/puntopc/html/modules.php 0000604 00000005506 15140417202 0017020 0 ustar 00 <?php defined('_JEXEC') or die; if (!defined('_ARTX_FUNCTIONS')) require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php'); function modChrome_artstyle($module, &$params, &$attribs) { $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle'; $styles = array( 'art-nostyle' => 'modChrome_artnostyle', 'art-block' => 'modChrome_artblock', 'art-article' => 'modChrome_artarticle', 'art-vmenu' => 'modChrome_artvmenu' ); // moduleclass_sfx support: // '' or 'suffix' - use default style, suffix will not be added to the module tag // but will be added to the module elements. // ' suffix' - adds suffix to the module root tag as well as to the module elements. // 'art-...' - overwrites module style. // 'art-... suffix' - overwrites style and adds suffix to the module root tag and // to the module elements, does not add art-... to the module elements. $classes = ''; $sfx = $params->get('moduleclass_sfx'); if (strlen($sfx) != 0) { if (' ' == $sfx[0]) $classes = $sfx; else { $parts = explode(' ', $sfx, 2); if (in_array($parts[0], array_keys($styles))) { $style = $parts[0]; if (count($parts) > 1) $classes = ' ' . $parts[1]; $params->set('moduleclass_sfx', $classes); } } } $params->set('artx-module-classes', $classes); call_user_func($styles[$style], $module, $params, $attribs); } function modChrome_artnostyle($module, &$params, &$attribs) { if (!empty ($module->content)) : ?> <div class="art-nostyle<?php echo $params->get('artx-module-classes'); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> <?php endif; } function modChrome_artblock($module, &$params, &$attribs) { if (!empty ($module->content)) echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } function modChrome_artvmenu($module, &$params, &$attribs) { if (!empty ($module->content)) { if (function_exists('artxVMenuBlock')) echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); else echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } } function modChrome_artarticle($module, &$params, &$attribs) { if (!empty ($module->content)) { $data = array('classes' => $params->get('artx-module-classes'), 'content' => $module->content); if ($module->showtitle != 0) $data['header-text'] = $module->title; echo artxPost($data); } } home/academiac/www/templates/nicelya/html/modules.php 0000604 00000005365 15140612154 0016762 0 ustar 00 <?php defined('_JEXEC') or die; if (!defined('_ARTX_FUNCTIONS')) require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php'); function modChrome_artstyle($module, &$params, &$attribs) { $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'awp-nostyle'; $styles = array( 'awp-nostyle' => 'modChrome_artnostyle', 'awp-block' => 'modChrome_artblock', 'awp-article' => 'modChrome_artarticle', 'awp-vmenu' => 'modChrome_artvmenu' ); // moduleclass_sfx support: // '' or 'suffix' - use default style, suffix will not be added to the module tag // but will be added to the module elements. // ' suffix' - adds suffix to the module root tag as well as to the module elements. // 'awp-...' - overwrites module style. // 'awp-... suffix' - overwrites style and adds suffix to the module root tag and // to the module elements, does not add awp-... to the module elements. $classes = ''; $sfx = $params->get('moduleclass_sfx'); if (strlen($sfx) != 0) { if (' ' == $sfx[0]) $classes = $sfx; else { $parts = explode(' ', $sfx, 2); if (in_array($parts[0], array_keys($styles))) { $style = $parts[0]; if (count($parts) > 1) $classes = ' ' . $parts[1]; $params->set('moduleclass_sfx', $classes); } } } $params->set('artx-module-classes', $classes); call_user_func($styles[$style], $module, $params, $attribs); } function modChrome_artnostyle($module, &$params, &$attribs) { if (!empty ($module->content)) : ?> <div class="awp-nostyle<?php echo $params->get('artx-module-classes'); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> <?php endif; } function modChrome_artblock($module, &$params, &$attribs) { if (!empty ($module->content)) echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } function modChrome_artvmenu($module, &$params, &$attribs) { if (!empty ($module->content)) { if (function_exists('artxVMenuBlock')) echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); else echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, $params->get('artx-module-classes')); } } function modChrome_artarticle($module, &$params, &$attribs) { if (!empty ($module->content)) { $data = array('classes' => $params->get('artx-module-classes'), 'content' => $module->content); if ($module->showtitle != 0) $data['header-text'] = $module->title; echo artxPost($data); } }
©
2018.