0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: sitemaps.php.tar
home/academiac/www/administrator/components/com_xmap/controllers/sitemaps.php 0000604 00000004110 15145256104 0023756 0 ustar 00 <?php /** * @version $Id$ * @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Guillermo Vargas (guille@vargas.co.cr) */ // no direct access defined('_JEXEC') or die; jimport('joomla.application.component.controlleradmin'); /** * @package Xmap * @subpackage com_xmap * @since 2.0 */ class XmapControllerSitemaps extends JControllerAdmin { protected $text_prefix = 'COM_XMAP_SITEMAPS'; /** * Constructor */ public function __construct($config = array()) { parent::__construct($config); $this->registerTask('unpublish', 'publish'); $this->registerTask('trash', 'publish'); $this->registerTask('unfeatured', 'featured'); } /** * Method to toggle the default sitemap. * * @return void * @since 2.0 */ function setDefault() { // Check for request forgeries JRequest::checkToken() or die('Invalid Token'); // Get items to publish from the request. $cid = JRequest::getVar('cid', 0, '', 'array'); $id = @$cid[0]; if (!$id) { JError::raiseWarning(500, JText::_('Select an item to set as default')); } else { // Get the model. $model = $this->getModel(); // Publish the items. if (!$model->setDefault($id)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_xmap&view=sitemaps'); } /** * Proxy for getModel. * * @param string $name The name of the model. * @param string $prefix The prefix for the PHP class name. * * @return JModel * @since 2.0 */ public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } } home/academiac/www/administrator/components/com_xmap/models/sitemaps.php 0000604 00000013570 15145263260 0022706 0 ustar 00 <?php /** * @version $Id$ * @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Guillermo Vargas (guille@vargas.co.cr) */ // no direct access defined('_JEXEC') or die; jimport('joomla.application.component.modellist'); jimport('joomla.database.query'); /** * Sitemaps Model Class * * @package Xmap * @subpackage com_xmap * @since 2.0 */ class XmapModelSitemaps 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', 'alias', 'a.alias', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', 'catid', 'a.catid', 'category_title', 'state', 'a.state', 'access', 'a.access', 'access_level', 'created', 'a.created', 'created_by', 'a.created_by', 'ordering', 'a.ordering', 'featured', 'a.featured', 'language', 'a.language', 'hits', 'a.hits', 'publish_up', 'a.publish_up', 'publish_down', 'a.publish_down', ); } parent::__construct($config); } /** * Method to auto-populate the model state. * * @since 2.0 */ protected function populateState($ordering = null, $direction = null) { // Adjust the context to support modal layouts. if ($layout = JRequest::getVar('layout')) { $this->context .= '.'.$layout; } $access = $this->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', 0, 'int'); $this->setState('filter.access', $access); $published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); $search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $this->setState('filter.search', $search); // List state information. parent::populateState('a.title', '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 $id 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.published'); return parent::getStoreId($id); } /** * @param boolean True to join selected foreign information * * @return string */ protected function getListQuery($resolveFKs = true) { $db = $this->getDbo(); // Create a new query object. $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*') ); $query->from('#__xmap_sitemap AS a'); // Join over the asset groups. $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. if ($access = $this->getState('filter.access')) { $query->where('a.access = ' . (int) $access); } // Filter by published state $published = $this->getState('filter.published'); if (is_numeric($published)) { $query->where('a.state = ' . (int) $published); } else if ($published === '') { $query->where('(a.state = 0 OR a.state = 1)'); } // 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.alias LIKE '.$search.')'); } } // Add the list ordering clause. $query->order($db->escape($this->state->get('list.ordering', 'a.title')) . ' ' . $db->escape($this->state->get('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; } public function getExtensionsMessage() { $db = $this->getDbo(); $query = $db->getQuery(true); $query->select('e.*'); $query->from($db->quoteName('#__extensions'). 'AS e'); $query->join('INNER', '#__extensions AS p ON e.element=p.element and p.enabled=0 and p.type=\'plugin\' and p.folder=\'xmap\''); $query->where('e.type=\'component\' and e.enabled=1'); $db->setQuery($query); $extensions = $db->loadObjectList(); if ( count($extensions) ) { $sep = $extensionsNameList = ''; foreach ($extensions as $extension) { $extensionsNameList .= "$sep$extension->element"; $sep = ', '; } return JText::sprintf('XMAP_MESSAGE_EXTENSIONS_DISABLED',$extensionsNameList); } else { return ""; } } } home/academiac/www/administrator/components/com_xmap/models/fields/modal/sitemaps.php 0000604 00000006102 15147560504 0025244 0 ustar 00 <?php /** * @version $Id$ * @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Guillermo Vargas (guille@vargas.co.cr) */ defined('_JEXEC') or die; jimport('joomla.form.field'); /** * Supports a modal sitemap picker. * * @package Xmap * @subpackage com_xmap * @since 2.0 */ class JFormFieldModal_Sitemaps extends JFormField { /** * The field type. * * @var string */ protected $type = 'Modal_Sitemaps'; /** * Method to get a list of options for a sitemaps list input. * * @return array An array of JHtml options. */ protected function getInput() { // Initialise variables. $db = JFactory::getDBO(); $doc = JFactory::getDocument(); // Load the modal behavior. JHtml::_('behavior.modal', 'a.modal'); // Get the title of the linked chart if ($this->value) { $db->setQuery( 'SELECT title' . ' FROM #__xmap_sitemap' . ' WHERE id = ' . (int) $this->value ); $title = $db->loadResult(); if ($error = $db->getErrorMsg()) { JError::raiseWarning(500, $error); } } else { $title = ''; } if (empty($title)) { $title = JText::_('COM_XMAP_SELECT_AN_SITEMAP'); } $doc->addScriptDeclaration( "function jSelectSitemap_" . $this->id . "(id, title, object) { $('" . $this->id . "_id').value = id; $('" . $this->id . "_name').value = title; SqueezeBox.close(); }" ); $link = 'index.php?option=com_xmap&view=sitemaps&layout=modal&tmpl=component&function=jSelectSitemap_' . $this->id; JHTML::_('behavior.modal', 'a.modal'); $html = '<span class="input-append">'; $html .= "\n" . '<input class="input-medium" type="text" id="' . $this->id . '_name" value="' . htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '" disabled="disabled" />'; if(version_compare(JVERSION,'3.0.0','ge')) $html .= '<a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a>' . "\n"; else $html .= '<div class="button2-left"><div class="blank"><a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a></div></div>' . "\n"; $html .= '</span>'; $html .= "\n" . '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />'; return $html; } }
©
2018.