joomla/0000777000000000000000000000000011277747611013243 5ustar adminadministratorsjoomla/inc/0000777000000000000000000000000011266547357014017 5ustar adminadministratorsjoomla/inc/cfg-joomla.php0000766000000000000000000000141711267130303016526 0ustar adminadministrators
  • "._NPKG_LINK." ("._NPKG_MYSQL_REQUIRED.")
  • "; ?>joomla/joomla/0000777000000000000000000000000011311737620014510 5ustar adminadministratorsjoomla/joomla/components/0000777000000000000000000000000011266551250016677 5ustar adminadministratorsjoomla/joomla/components/com_user/0000777000000000000000000000000011266551225020515 5ustar adminadministratorsjoomla/joomla/components/com_user/user.xml0000766000000000000000000000100111234314116022175 0ustar adminadministrators User Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 User Self-Management joomla/joomla/components/com_user/router.php0000766000000000000000000000224411234314116022540 0ustar adminadministratorsgetItem( $query['Itemid'] ); if(!isset($menuItem->query['view']) || $menuItem->query['view'] != $query['view']) { $segments[] = $query['view']; } } unset($query['view']); } return $segments; } function UserParseRoute($segments) { $vars = array(); $count = count($segments); if(!empty($count)) { $vars['view'] = $segments[0]; } if($count > 1) { $vars['id'] = $segments[$count - 1]; } return $vars; } joomla/joomla/components/com_user/views/0000777000000000000000000000000011266551224021651 5ustar adminadministratorsjoomla/joomla/components/com_user/views/login/0000777000000000000000000000000011266551224022761 5ustar adminadministratorsjoomla/joomla/components/com_user/views/login/tmpl/0000777000000000000000000000000011266551225023736 5ustar adminadministratorsjoomla/joomla/components/com_user/views/login/tmpl/default.xml0000766000000000000000000000623511234314120026075 0ustar adminadministrators Default Login Layout DEFAULT LOGIN LAYOUT DESC joomla/joomla/components/com_user/views/login/tmpl/default.php0000766000000000000000000000053211234314120026056 0ustar adminadministrators params->get( 'show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    loadTemplate($this->type); ?> joomla/joomla/components/com_user/views/login/tmpl/metadata.xml0000766000000000000000000000025011234314120026220 0ustar adminadministrators joomla/joomla/components/com_user/views/login/tmpl/default_login.php0000766000000000000000000000606211234314120027252 0ustar adminadministrators load( 'plg_authentication_openid', JPATH_ADMINISTRATOR ); $langScript = 'var JLanguage = {};'. ' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'. ' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'. ' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'. ' var comlogin = 1;'; $document = &JFactory::getDocument(); $document->addScriptDeclaration( $langScript ); JHTML::_('script', 'openid.js'); endif; ?>
    params->get( 'show_login_title' ) ) : ?>
    params->get( 'header_login' ); ?>
    image; ?> params->get( 'description_login' ) ) : ?> params->get( 'description_login_text' ); ?>



    joomla/joomla/components/com_user/views/login/tmpl/default_logout.php0000766000000000000000000000230311234314120027445 0ustar adminadministrators
    params->get( 'show_logout_title' ) ) : ?>
    escape($this->params->get( 'header_logout' )); ?>
    image; ?> params->get('description_logout')) : echo $this->escape($this->params->get('description_logout_text')); endif; ?>


    joomla/joomla/components/com_user/views/login/tmpl/index.html0000766000000000000000000000005411234314120025715 0ustar adminadministratorsjoomla/joomla/components/com_user/views/login/metadata.xml0000766000000000000000000000022011234314120025241 0ustar adminadministrators joomla/joomla/components/com_user/views/login/view.html.php0000766000000000000000000000627711234314120025407 0ustar adminadministratorsgetPathway(); $image = ''; $menu =& JSite::getMenu(); $item = $menu->getActive(); if($item) $params =& $menu->getParams($item->id); else $params =& $menu->getParams(null); $type = (!$user->get('guest')) ? 'logout' : 'login'; // Set some default page parameters if not set $params->def( 'show_page_title', 1 ); if (!$params->get( 'page_title')) { $params->set('page_title', JText::_( 'Login' )); } if(!$item) { $params->def( 'header_login', '' ); $params->def( 'header_logout', '' ); } $params->def( 'pageclass_sfx', '' ); $params->def( 'login', 'index.php' ); $params->def( 'logout', 'index.php' ); $params->def( 'description_login', 1 ); $params->def( 'description_logout', 1 ); $params->def( 'description_login_text', JText::_( 'LOGIN_DESCRIPTION' ) ); $params->def( 'description_logout_text', JText::_( 'LOGOUT_DESCRIPTION' ) ); $params->def( 'image_login', 'key.jpg' ); $params->def( 'image_logout', 'key.jpg' ); $params->def( 'image_login_align', 'right' ); $params->def( 'image_logout_align', 'right' ); $usersConfig = &JComponentHelper::getParams( 'com_users' ); $params->def( 'registration', $usersConfig->get( 'allowUserRegistration' ) ); if ( !$user->get('guest') ) { $title = JText::_( 'Logout'); // pathway item $pathway->addItem($title, '' ); // Set page title $document->setTitle( $title ); } else { $title = JText::_( 'Login'); // pathway item $pathway->addItem($title, '' ); // Set page title $document->setTitle( $title ); } // Build login image if enabled if ( $params->get( 'image_'.$type ) != -1 ) { $image = 'images/stories/'.$params->get( 'image_'.$type ); $image = ''; } // Get the return URL if (!$url = JRequest::getVar('return', '', 'method', 'base64')) { $url = base64_encode($params->get($type)); } $errors =& JError::getErrors(); $this->assign('image' , $image); $this->assign('type' , $type); $this->assign('return', $url); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_user/views/login/index.html0000766000000000000000000000005411234314120024741 0ustar adminadministratorsjoomla/joomla/components/com_user/views/reset/0000777000000000000000000000000011266551221022770 5ustar adminadministratorsjoomla/joomla/components/com_user/views/reset/tmpl/0000777000000000000000000000000011266551222023745 5ustar adminadministratorsjoomla/joomla/components/com_user/views/reset/tmpl/default.xml0000766000000000000000000000045211234314120026102 0ustar adminadministrators DEFAULT RESET LAYOUT DEFAULT RESET LAYOUT DESC joomla/joomla/components/com_user/views/reset/tmpl/default.php0000766000000000000000000000215211234314120026070 0ustar adminadministrators params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>

    joomla/joomla/components/com_user/views/reset/tmpl/confirm.php0000766000000000000000000000167511234314120026112 0ustar adminadministrators

    joomla/joomla/components/com_user/views/reset/tmpl/confirm.xml0000766000000000000000000000013211234314120026106 0ustar adminadministrators joomla/joomla/components/com_user/views/reset/tmpl/index.html0000766000000000000000000000005411234314120025727 0ustar adminadministratorsjoomla/joomla/components/com_user/views/reset/tmpl/complete.xml0000766000000000000000000000013211234314120026261 0ustar adminadministrators joomla/joomla/components/com_user/views/reset/tmpl/complete.php0000766000000000000000000000254011234314120026255 0ustar adminadministrators

    joomla/joomla/components/com_user/views/reset/metadata.xml0000766000000000000000000000022011234314120025253 0ustar adminadministrators joomla/joomla/components/com_user/views/reset/view.html.php0000766000000000000000000000425511234314120025413 0ustar adminadministratorsgetLayout(); if ($layout == 'complete') { $id = $mainframe->getUserState($this->_namespace.'id'); $token = $mainframe->getUserState($this->_namespace.'token'); if (is_null($id) || is_null($token)) { $mainframe->redirect('index.php?option=com_user&view=reset'); } } // Get the page/component configuration $params = &$mainframe->getParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'FORGOT_YOUR_PASSWORD' )); } } else { $params->set('page_title', JText::_( 'FORGOT_YOUR_PASSWORD' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_user/views/reset/index.html0000766000000000000000000000005411234314120024753 0ustar adminadministratorsjoomla/joomla/components/com_user/views/remind/0000777000000000000000000000000011266551223023126 5ustar adminadministratorsjoomla/joomla/components/com_user/views/remind/tmpl/0000777000000000000000000000000011266551223024102 5ustar adminadministratorsjoomla/joomla/components/com_user/views/remind/tmpl/default.xml0000766000000000000000000000045611234314120026242 0ustar adminadministrators DEFAULT REMIND LAYOUT DEFAULT REMIND LAYOUT DESC joomla/joomla/components/com_user/views/remind/tmpl/default.php0000766000000000000000000000214711234314120026230 0ustar adminadministrators params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>

    joomla/joomla/components/com_user/views/remind/tmpl/index.html0000766000000000000000000000005411234314120026063 0ustar adminadministratorsjoomla/joomla/components/com_user/views/remind/metadata.xml0000766000000000000000000000022211234314120025411 0ustar adminadministrators joomla/joomla/components/com_user/views/remind/view.html.php0000766000000000000000000000357011234314120025546 0ustar adminadministratorsgetParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'FORGOT_YOUR_USERNAME' )); } } else { $params->set('page_title', JText::_( 'FORGOT_YOUR_USERNAME' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); // Load the form validation behavior JHTML::_('behavior.formvalidation'); // Add the tooltip behavior JHTML::_('behavior.tooltip'); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_user/views/remind/index.html0000766000000000000000000000005411234314120025107 0ustar adminadministratorsjoomla/joomla/components/com_user/views/register/0000777000000000000000000000000011266551223023474 5ustar adminadministratorsjoomla/joomla/components/com_user/views/register/tmpl/0000777000000000000000000000000011266551224024451 5ustar adminadministratorsjoomla/joomla/components/com_user/views/register/tmpl/default_message.php0000766000000000000000000000037311234314120030301 0ustar adminadministrators
    escape($this->message->title) ; ?>
    escape($this->message->text) ; ?>
    joomla/joomla/components/com_user/views/register/tmpl/default.xml0000766000000000000000000000046611234314120026611 0ustar adminadministrators DEFAULT REGISTER LAYOUT DEFAULT REGISTER LAYOUT DESC joomla/joomla/components/com_user/views/register/tmpl/default.php0000766000000000000000000000523711234314120026601 0ustar adminadministrators message)){ $this->display('message'); } ?>
    params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    *
    *
    *
    *
    *
    joomla/joomla/components/com_user/views/register/tmpl/index.html0000766000000000000000000000005411234314120026431 0ustar adminadministratorsjoomla/joomla/components/com_user/views/register/metadata.xml0000766000000000000000000000022611234314120025763 0ustar adminadministrators joomla/joomla/components/com_user/views/register/view.html.php0000766000000000000000000000400711234314120026110 0ustar adminadministratorsget( 'allowUserRegistration' )) { JError::raiseError( 403, JText::_( 'Access Forbidden' )); return; } $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $params = &$mainframe->getParams(); // Page Title $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Registration' )); } } else { $params->set('page_title', JText::_( 'Registration' )); } $document->setTitle( $params->get( 'page_title' ) ); $pathway->addItem( JText::_( 'New' )); // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_user/views/register/index.html0000766000000000000000000000005411234314120025455 0ustar adminadministratorsjoomla/joomla/components/com_user/views/index.html0000766000000000000000000000005411234314116023636 0ustar adminadministratorsjoomla/joomla/components/com_user/views/user/0000777000000000000000000000000011266551220022623 5ustar adminadministratorsjoomla/joomla/components/com_user/views/user/tmpl/0000777000000000000000000000000011266551221023600 5ustar adminadministratorsjoomla/joomla/components/com_user/views/user/tmpl/default.xml0000766000000000000000000000067711234314116025754 0ustar adminadministrators DEFAULT USER LAYOUT DEFAULT USER LAYOUT DESC joomla/joomla/components/com_user/views/user/tmpl/default.php0000766000000000000000000000101311234314116025724 0ustar adminadministrators params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    escape($this->params->get('welcome_desc', JText::_( 'WELCOME_DESC' )))); ?>
    joomla/joomla/components/com_user/views/user/tmpl/form.php0000766000000000000000000000503611234314116025254 0ustar adminadministrators
    params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    user->get('password')) : ?>
    user->get('username');?>
    params)) : echo $this->params->render( 'params' ); endif; ?>
    joomla/joomla/components/com_user/views/user/tmpl/form.xml0000766000000000000000000000043211234314116025260 0ustar adminadministrators USER FORM LAYOUT USER FORM LAYOUT DESC joomla/joomla/components/com_user/views/user/tmpl/index.html0000766000000000000000000000005411234314116025570 0ustar adminadministratorsjoomla/joomla/components/com_user/views/user/metadata.xml0000766000000000000000000000021611234314116025121 0ustar adminadministrators joomla/joomla/components/com_user/views/user/view.html.php0000766000000000000000000000606011234314116025250 0ustar adminadministratorsgetLayout(); if( $layout == 'form') { $this->_displayForm($tpl); return; } if ( $layout == 'login' ) { parent::display($tpl); return; } $user =& JFactory::getUser(); // Get the page/component configuration $params = &$mainframe->getParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Registered Area' )); } } else { $params->set('page_title', JText::_( 'Registered Area' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); // Set pathway information $this->assignRef('user' , $user); $this->assignRef('params', $params); parent::display($tpl); } function _displayForm($tpl = null) { global $mainframe; // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $params = &$mainframe->getParams(); // check to see if Frontend User Params have been enabled $usersConfig = &JComponentHelper::getParams( 'com_users' ); $check = $usersConfig->get('frontend_userparams'); if ($check == '1' || $check == 1 || $check == NULL) { if($user->authorize( 'com_user', 'edit' )) { $params = $user->getParameters(true); } } $params->merge( $params ); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Edit Your Details' )); } } else { $params->set('page_title', JText::_( 'Edit Your Details' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); $this->assignRef('user' , $user); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_user/views/user/index.html0000766000000000000000000000005411234314116024614 0ustar adminadministratorsjoomla/joomla/components/com_user/controller.php0000766000000000000000000003516611234314116023414 0ustar adminadministratorsget('guest')) { JError::raiseError( 403, JText::_('Access Forbidden') ); return; } JRequest::setVar('layout', 'form'); parent::display(); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $user =& JFactory::getUser(); $userid = JRequest::getVar( 'id', 0, 'post', 'int' ); // preform security checks if ($user->get('id') == 0 || $userid == 0 || $userid <> $user->get('id')) { JError::raiseError( 403, JText::_('Access Forbidden') ); return; } //clean request $post = JRequest::get( 'post' ); $post['username'] = JRequest::getVar('username', '', 'post', 'username'); $post['password'] = JRequest::getVar('password', '', 'post', 'string', JREQUEST_ALLOWRAW); $post['password2'] = JRequest::getVar('password2', '', 'post', 'string', JREQUEST_ALLOWRAW); // get the redirect $return = JURI::base(); // do a password safety check if(strlen($post['password']) || strlen($post['password2'])) { // so that "0" can be used as password e.g. if($post['password'] != $post['password2']) { $msg = JText::_('PASSWORDS_DO_NOT_MATCH'); // something is wrong. we are redirecting back to edit form. // TODO: HTTP_REFERER should be replaced with a base64 encoded form field in a later release $return = str_replace(array('"', '<', '>', "'"), '', @$_SERVER['HTTP_REFERER']); if (empty($return) || !JURI::isInternal($return)) { $return = JURI::base(); } $this->setRedirect($return, $msg, 'error'); return false; } } // we don't want users to edit certain fields so we will unset them unset($post['gid']); unset($post['block']); unset($post['usertype']); unset($post['registerDate']); unset($post['activation']); // store data $model = $this->getModel('user'); if ($model->store($post)) { $msg = JText::_( 'Your settings have been saved.' ); } else { //$msg = JText::_( 'Error saving your settings.' ); $msg = $model->getError(); } $this->setRedirect( $return, $msg ); } function cancel() { $this->setRedirect( 'index.php' ); } function login() { // Check for request forgeries JRequest::checkToken('request') or jexit( 'Invalid Token' ); global $mainframe; if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $return = base64_decode($return); if (!JURI::isInternal($return)) { $return = ''; } } $options = array(); $options['remember'] = JRequest::getBool('remember', false); $options['return'] = $return; $credentials = array(); $credentials['username'] = JRequest::getVar('username', '', 'method', 'username'); $credentials['password'] = JRequest::getString('passwd', '', 'post', JREQUEST_ALLOWRAW); //preform the login action $error = $mainframe->login($credentials, $options); if(!JError::isError($error)) { // Redirect if the return url is not registration or login if ( ! $return ) { $return = 'index.php?option=com_user'; } $mainframe->redirect( $return ); } else { // Facilitate third party login forms if ( ! $return ) { $return = 'index.php?option=com_user&view=login'; } // Redirect to a login form $mainframe->redirect( $return ); } } function logout() { global $mainframe; //preform the logout action $error = $mainframe->logout(); if(!JError::isError($error)) { if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $return = base64_decode($return); if (!JURI::isInternal($return)) { $return = ''; } } // Redirect if the return url is not registration or login if ( $return && !( strpos( $return, 'com_user' )) ) { $mainframe->redirect( $return ); } } else { parent::display(); } } /** * Prepares the registration form * @return void */ function register() { $usersConfig = &JComponentHelper::getParams( 'com_users' ); if (!$usersConfig->get( 'allowUserRegistration' )) { JError::raiseError( 403, JText::_( 'Access Forbidden' )); return; } $user =& JFactory::getUser(); if ( $user->get('guest')) { JRequest::setVar('view', 'register'); } else { $this->setredirect('index.php?option=com_user&task=edit',JText::_('You are already registered.')); } parent::display(); } /** * Save user registration and notify users and admins if required * @return void */ function register_save() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get required system objects $user = clone(JFactory::getUser()); $pathway =& $mainframe->getPathway(); $config =& JFactory::getConfig(); $authorize =& JFactory::getACL(); $document =& JFactory::getDocument(); // If user registration is not allowed, show 403 not authorized. $usersConfig = &JComponentHelper::getParams( 'com_users' ); if ($usersConfig->get('allowUserRegistration') == '0') { JError::raiseError( 403, JText::_( 'Access Forbidden' )); return; } // Initialize new usertype setting $newUsertype = $usersConfig->get( 'new_usertype' ); if (!$newUsertype) { $newUsertype = 'Registered'; } // Bind the post array to the user object if (!$user->bind( JRequest::get('post'), 'usertype' )) { JError::raiseError( 500, $user->getError()); } // Set some initial user values $user->set('id', 0); $user->set('usertype', $newUsertype); $user->set('gid', $authorize->get_group_id( '', $newUsertype, 'ARO' )); $date =& JFactory::getDate(); $user->set('registerDate', $date->toMySQL()); // If user activation is turned on, we need to set the activation information $useractivation = $usersConfig->get( 'useractivation' ); if ($useractivation == '1') { jimport('joomla.user.helper'); $user->set('activation', JUtility::getHash( JUserHelper::genRandomPassword()) ); $user->set('block', '1'); } // If there was an error with registration, set the message and display form if ( !$user->save() ) { JError::raiseWarning('', JText::_( $user->getError())); $this->register(); return false; } // Send registration confirmation mail $password = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW); $password = preg_replace('/[\x00-\x1F\x7F]/', '', $password); //Disallow control chars in the email UserController::_sendMail($user, $password); // Everything went fine, set relevant message depending upon user activation state and display message if ( $useractivation == 1 ) { $message = JText::_( 'REG_COMPLETE_ACTIVATE' ); } else { $message = JText::_( 'REG_COMPLETE' ); } $this->setRedirect('index.php', $message); } function activate() { global $mainframe; // Initialize some variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $document =& JFactory::getDocument(); $pathway =& $mainframe->getPathWay(); $usersConfig = &JComponentHelper::getParams( 'com_users' ); $userActivation = $usersConfig->get('useractivation'); $allowUserRegistration = $usersConfig->get('allowUserRegistration'); // Check to see if they're logged in, because they don't need activating! if ($user->get('id')) { // They're already logged in, so redirect them to the home page $mainframe->redirect( 'index.php' ); } if ($allowUserRegistration == '0' || $userActivation == '0') { JError::raiseError( 403, JText::_( 'Access Forbidden' )); return; } // create the view require_once (JPATH_COMPONENT.DS.'views'.DS.'register'.DS.'view.html.php'); $view = new UserViewRegister(); $message = new stdClass(); // Do we even have an activation string? $activation = JRequest::getVar('activation', '', '', 'alnum' ); $activation = $db->getEscaped( $activation ); if (empty( $activation )) { // Page Title $document->setTitle( JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' ) ); // Breadcrumb $pathway->addItem( JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' )); $message->title = JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' ); $message->text = JText::_( 'REG_ACTIVATE_NOT_FOUND' ); $view->assign('message', $message); $view->display('message'); return; } // Lets activate this user jimport('joomla.user.helper'); if (JUserHelper::activateUser($activation)) { // Page Title $document->setTitle( JText::_( 'REG_ACTIVATE_COMPLETE_TITLE' ) ); // Breadcrumb $pathway->addItem( JText::_( 'REG_ACTIVATE_COMPLETE_TITLE' )); $message->title = JText::_( 'REG_ACTIVATE_COMPLETE_TITLE' ); $message->text = JText::_( 'REG_ACTIVATE_COMPLETE' ); } else { // Page Title $document->setTitle( JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' ) ); // Breadcrumb $pathway->addItem( JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' )); $message->title = JText::_( 'REG_ACTIVATE_NOT_FOUND_TITLE' ); $message->text = JText::_( 'REG_ACTIVATE_NOT_FOUND' ); } $view->assign('message', $message); $view->display('message'); } /** * Password Reset Request Method * * @access public */ function requestreset() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get the input $email = JRequest::getVar('email', null, 'post', 'string'); // Get the model $model = &$this->getModel('Reset'); // Request a reset if ($model->requestReset($email) === false) { $message = JText::sprintf('PASSWORD_RESET_REQUEST_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_user&view=reset', $message); return false; } $this->setRedirect('index.php?option=com_user&view=reset&layout=confirm'); } /** * Password Reset Confirmation Method * * @access public */ function confirmreset() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get the input $token = JRequest::getVar('token', null, 'post', 'alnum'); // Get the model $model = &$this->getModel('Reset'); // Verify the token if ($model->confirmReset($token) === false) { $message = JText::sprintf('PASSWORD_RESET_CONFIRMATION_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_user&view=reset&layout=confirm', $message); return false; } $this->setRedirect('index.php?option=com_user&view=reset&layout=complete'); } /** * Password Reset Completion Method * * @access public */ function completereset() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get the input $password1 = JRequest::getVar('password1', null, 'post', 'string', JREQUEST_ALLOWRAW); $password2 = JRequest::getVar('password2', null, 'post', 'string', JREQUEST_ALLOWRAW); // Get the model $model = &$this->getModel('Reset'); // Reset the password if ($model->completeReset($password1, $password2) === false) { $message = JText::sprintf('PASSWORD_RESET_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_user&view=reset&layout=complete', $message); return false; } $message = JText::_('PASSWORD_RESET_SUCCESS'); $this->setRedirect('index.php?option=com_user&view=login', $message); } /** * Username Reminder Method * * @access public */ function remindusername() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get the input $email = JRequest::getVar('email', null, 'post', 'string'); // Get the model $model = &$this->getModel('Remind'); // Send the reminder if ($model->remindUsername($email) === false) { $message = JText::sprintf('USERNAME_REMINDER_FAILED', $model->getError()); $this->setRedirect('index.php?option=com_user&view=remind', $message); return false; } $message = JText::sprintf('USERNAME_REMINDER_SUCCESS', $email); $this->setRedirect('index.php?option=com_user&view=login', $message); } function _sendMail(&$user, $password) { global $mainframe; $db =& JFactory::getDBO(); $name = $user->get('name'); $email = $user->get('email'); $username = $user->get('username'); $usersConfig = &JComponentHelper::getParams( 'com_users' ); $sitename = $mainframe->getCfg( 'sitename' ); $useractivation = $usersConfig->get( 'useractivation' ); $mailfrom = $mainframe->getCfg( 'mailfrom' ); $fromname = $mainframe->getCfg( 'fromname' ); $siteURL = JURI::base(); $subject = sprintf ( JText::_( 'Account details for' ), $name, $sitename); $subject = html_entity_decode($subject, ENT_QUOTES); if ( $useractivation == 1 ){ $message = sprintf ( JText::_( 'SEND_MSG_ACTIVATE' ), $name, $sitename, $siteURL."index.php?option=com_user&task=activate&activation=".$user->get('activation'), $siteURL, $username, $password); } else { $message = sprintf ( JText::_( 'SEND_MSG' ), $name, $sitename, $siteURL); } $message = html_entity_decode($message, ENT_QUOTES); //get all super administrator $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE LOWER( usertype ) = "super administrator"'; $db->setQuery( $query ); $rows = $db->loadObjectList(); // Send email to user if ( ! $mailfrom || ! $fromname ) { $fromname = $rows[0]->name; $mailfrom = $rows[0]->email; } JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message); // Send notification to all administrators $subject2 = sprintf ( JText::_( 'Account details for' ), $name, $sitename); $subject2 = html_entity_decode($subject2, ENT_QUOTES); // get superadministrators id foreach ( $rows as $row ) { if ($row->sendEmail) { $message2 = sprintf ( JText::_( 'SEND_MSG_ADMIN' ), $row->name, $sitename, $name, $email, $username); $message2 = html_entity_decode($message2, ENT_QUOTES); JUtility::sendMail($mailfrom, $fromname, $row->email, $subject2, $message2); } } } } ?> joomla/joomla/components/com_user/user.php0000766000000000000000000000161411234314116022176 0ustar adminadministratorsexecute( JRequest::getCmd('task')); // Redirect if set by the controller $controller->redirect(); joomla/joomla/components/com_user/index.html0000766000000000000000000000005411234314116022501 0ustar adminadministratorsjoomla/joomla/components/com_user/models/0000777000000000000000000000000011266551225022000 5ustar adminadministratorsjoomla/joomla/components/com_user/models/remind.php0000766000000000000000000000546511234314120023764 0ustar adminadministratorssetError(JText::_('INVALID_EMAIL_ADDRESS')); return false; } $db = &JFactory::getDBO(); $db->setQuery('SELECT username FROM #__users WHERE email = '.$db->Quote($email), 0, 1); // Get the username if (!($username = $db->loadResult())) { $this->setError(JText::_('COULD_NOT_FIND_EMAIL')); return false; } // Push the email address into the session $mainframe->setUserState($this->_namespace.'email', $email); // Send the reminder email if (!$this->_sendReminderMail($email, $username)) { return false; } return true; } /** * Sends a username reminder to the e-mail address * specified containing the specified username. * * @since 1.5 * @param string A user's e-mail address * @param string A user's username * @return bool True on success/false on failure */ function _sendReminderMail($email, $username) { $config = &JFactory::getConfig(); $uri = &JFactory::getURI(); $url = $uri->toString( array('scheme', 'host', 'port')).JRoute::_('index.php?option=com_user&view=login', false); $from = $config->getValue('mailfrom'); $fromname = $config->getValue('fromname'); $subject = JText::sprintf('USERNAME_REMINDER_EMAIL_TITLE', $config->getValue('sitename')); $body = JText::sprintf('USERNAME_REMINDER_EMAIL_TEXT', $config->getValue('sitename'), $username, $url); if (!JUtility::sendMail($from, $fromname, $email, $subject, $body)) { $this->setError('ERROR_SENDING_REMINDER_EMAIL'); return false; } return true; } }joomla/joomla/components/com_user/models/user.php0000766000000000000000000000520011234314120023447 0ustar adminadministratorssetId($id); } /** * Method to set the weblink identifier * * @access public * @param int Weblink identifier */ function setId($id) { // Set weblink id and wipe data $this->_id = $id; $this->_data = null; } /** * Method to get a user * * @since 1.5 */ function &getData() { // Load the weblink data if ($this->_loadData()) { //do nothing } return $this->_data; } /** * Method to store the user data * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { $user = JFactory::getUser(); $username = $user->get('username'); // Bind the form fields to the user table if (!$user->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } // Store the web link table to the database if (!$user->save()) { $this->setError( $user->getError() ); return false; } $session =& JFactory::getSession(); $session->set('user', $user); // check if username has been changed if ( $username != $user->get('username') ) { $table = $this->getTable('session', 'JTable'); $table->load($session->getId()); $table->username = $user->get('username'); $table->store(); } return true; } /** * Method to load user data * * @access private * @return boolean True on success * @since 1.5 */ function _loadData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $this->_data =& JFactory::getUser(); return (boolean) $this->_data; } return true; } } ?> joomla/joomla/components/com_user/models/index.html0000766000000000000000000000005411234314120023757 0ustar adminadministratorsjoomla/joomla/components/com_user/models/reset.php0000766000000000000000000001441311234314120023621 0ustar adminadministratorssetError(JText::_('INVALID_EMAIL_ADDRESS')); return false; } // Build a query to find the user $query = 'SELECT id FROM #__users' . ' WHERE email = '.$db->Quote($email) . ' AND block = 0'; $db->setQuery($query); // Check the results if (!($id = $db->loadResult())) { $this->setError(JText::_('COULD_NOT_FIND_USER')); return false; } // Generate a new token $token = JUtility::getHash(JUserHelper::genRandomPassword()); $query = 'UPDATE #__users' . ' SET activation = '.$db->Quote($token) . ' WHERE id = '.(int) $id . ' AND block = 0'; $db->setQuery($query); // Save the token if (!$db->query()) { $this->setError(JText::_('DATABASE_ERROR')); return false; } // Send the token to the user via e-mail if (!$this->_sendConfirmationMail($email, $token)) { return false; } return true; } /** * Checks a user supplied token for validity * If the token is valid, it pushes the token * and user id into the session for security checks. * * @since 1.5 * @param token An md5 hashed randomly generated string * @return bool True on success/false on failure */ function confirmReset($token) { global $mainframe; if(strlen($token) != 32) { $this->setError(JText::_('INVALID_TOKEN')); return false; } $db = &JFactory::getDBO(); $db->setQuery('SELECT id FROM #__users WHERE block = 0 AND activation = '.$db->Quote($token)); // Verify the token if (!($id = $db->loadResult())) { $this->setError(JText::_('INVALID_TOKEN')); return false; } // Push the token and user id into the session $mainframe->setUserState($this->_namespace.'token', $token); $mainframe->setUserState($this->_namespace.'id', $id); return true; } /** * Takes the new password and saves it to the database. * It will only save the password if the user has the * correct user id and token stored in her session. * * @since 1.5 * @param string New Password * @param string New Password * @return bool True on success/false on failure */ function completeReset($password1, $password2) { jimport('joomla.user.helper'); global $mainframe; // Make sure that we have a pasword if ( ! $password1 ) { $this->setError(JText::_('MUST_SUPPLY_PASSWORD')); return false; } // Verify that the passwords match if ($password1 != $password2) { $this->setError(JText::_('PASSWORDS_DO_NOT_MATCH_LOW')); return false; } // Get the necessary variables $db = &JFactory::getDBO(); $id = $mainframe->getUserState($this->_namespace.'id'); $token = $mainframe->getUserState($this->_namespace.'token'); $salt = JUserHelper::genRandomPassword(32); $crypt = JUserHelper::getCryptedPassword($password1, $salt); $password = $crypt.':'.$salt; // Get the user object $user = new JUser($id); // Fire the onBeforeStoreUser trigger JPluginHelper::importPlugin('user'); $dispatcher =& JDispatcher::getInstance(); $dispatcher->trigger('onBeforeStoreUser', array($user->getProperties(), false)); // Build the query $query = 'UPDATE #__users' . ' SET password = '.$db->Quote($password) . ' , activation = ""' . ' WHERE id = '.(int) $id . ' AND activation = '.$db->Quote($token) . ' AND block = 0'; $db->setQuery($query); // Save the password if (!$result = $db->query()) { $this->setError(JText::_('DATABASE_ERROR')); return false; } // Update the user object with the new values. $user->password = $password; $user->activation = ''; $user->password_clear = $password1; // Fire the onAfterStoreUser trigger $dispatcher->trigger('onAfterStoreUser', array($user->getProperties(), false, $result, $this->getError())); // Flush the variables from the session $mainframe->setUserState($this->_namespace.'id', null); $mainframe->setUserState($this->_namespace.'token', null); return true; } /** * Sends a password reset request confirmation to the * specified e-mail address with the specified token. * * @since 1.5 * @param string An e-mail address * @param string An md5 hashed randomly generated string * @return bool True on success/false on failure */ function _sendConfirmationMail($email, $token) { $config = &JFactory::getConfig(); $uri = &JFactory::getURI(); $url = JURI::base().'index.php?option=com_user&view=reset&layout=confirm'; $sitename = $config->getValue('sitename'); // Set the e-mail parameters $from = $config->getValue('mailfrom'); $fromname = $config->getValue('fromname'); $subject = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TITLE', $sitename); $body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url); // Send the e-mail if (!JUtility::sendMail($from, $fromname, $email, $subject, $body)) { $this->setError('ERROR_SENDING_CONFIRMATION_EMAIL'); return false; } return true; } } joomla/joomla/components/com_wrapper/0000777000000000000000000000000011266551212021213 5ustar adminadministratorsjoomla/joomla/components/com_wrapper/router.php0000766000000000000000000000155711234314124023247 0ustar adminadministrators joomla/joomla/components/com_wrapper/views/0000777000000000000000000000000011266551212022350 5ustar adminadministratorsjoomla/joomla/components/com_wrapper/views/wrapper/0000777000000000000000000000000011266551213024031 5ustar adminadministratorsjoomla/joomla/components/com_wrapper/views/wrapper/tmpl/0000777000000000000000000000000011266551213025005 5ustar adminadministratorsjoomla/joomla/components/com_wrapper/views/wrapper/tmpl/default.xml0000766000000000000000000000254411234314124027152 0ustar adminadministrators Wrapper WRAPPER DESC joomla/joomla/components/com_wrapper/views/wrapper/tmpl/default.php0000766000000000000000000000242311234314124027135 0ustar adminadministrators
    params->get( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get( 'page_title' )); ?>
    joomla/joomla/components/com_wrapper/views/wrapper/tmpl/index.html0000766000000000000000000000005411234314124026773 0ustar adminadministratorsjoomla/joomla/components/com_wrapper/views/wrapper/metadata.xml0000766000000000000000000000022411234314124026323 0ustar adminadministrators joomla/joomla/components/com_wrapper/views/wrapper/view.php0000766000000000000000000000267211234314124025515 0ustar adminadministratorsparams->def( 'height_auto' ) ) { $this->wrapper->load = 'onload="iFrameHeight()"'; } else { $this->wrapper->load = ''; } // Get the page/component configuration $params = &$mainframe->getParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself $document->setTitle( $params->get( 'page_title' ) ); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/components/com_wrapper/views/wrapper/index.html0000766000000000000000000000005411234314124026017 0ustar adminadministratorsjoomla/joomla/components/com_wrapper/views/index.html0000766000000000000000000000005411234314124024337 0ustar adminadministratorsjoomla/joomla/components/com_wrapper/wrapper.php0000766000000000000000000000373311234314124023405 0ustar adminadministratorsgetActive(); // Get the page/component configuration $params = &$mainframe->getParams(); //set page title $document->setTitle($menu->name); $url = $params->def( 'url', '' ); $row = new stdClass(); if ( $params->def( 'add_scheme', 1 ) ) { // adds 'http://' if none is set if ( substr( $url, 0, 1 ) == '/' ) { // relative url in component. use server http_host. $row->url = 'http://'. $_SERVER['HTTP_HOST'] . $url; } elseif ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) { $row->url = 'http://'. $url; } else { $row->url = $url; } } else { $row->url = $url; } require_once (JPATH_COMPONENT.DS.'views'.DS.'wrapper'.DS.'view.php'); $view = new WrapperViewWrapper(); $view->assignRef('params' , $params); $view->assignRef('wrapper' , $row); $view->display(); } } ?>joomla/joomla/components/com_wrapper/index.html0000766000000000000000000000005411234314124023202 0ustar adminadministratorsjoomla/joomla/components/com_wrapper/wrapper.xml0000766000000000000000000000076711234314124023422 0ustar adminadministrators Wrapper Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Wrapper joomla/joomla/components/com_mailto/0000777000000000000000000000000011266551236021026 5ustar adminadministratorsjoomla/joomla/components/com_mailto/mailto.php0000766000000000000000000000160111234314122023005 0ustar adminadministratorsregisterDefaultTask('mailto'); $controller->execute(JRequest::getCmd('task')); //$controller->redirect();joomla/joomla/components/com_mailto/assets/0000777000000000000000000000000011266551236022330 5ustar adminadministratorsjoomla/joomla/components/com_mailto/assets/close-x.png0000766000000000000000000000024211234314120024367 0ustar adminadministratorsPNG  IHDR +t PLTE_o! pHYs  tIME7Z4,IDATxcZ!54ajh4i Sj1 ɁhGIENDB`joomla/joomla/components/com_mailto/assets/index.html0000766000000000000000000000005411234314122024307 0ustar adminadministratorsjoomla/joomla/components/com_mailto/views/0000777000000000000000000000000011266551236022163 5ustar adminadministratorsjoomla/joomla/components/com_mailto/views/mailto/0000777000000000000000000000000011266551236023450 5ustar adminadministratorsjoomla/joomla/components/com_mailto/views/mailto/tmpl/0000777000000000000000000000000011266551236024424 5ustar adminadministratorsjoomla/joomla/components/com_mailto/views/mailto/tmpl/default.php0000766000000000000000000000424011234314122026544 0ustar adminadministrators get('data'); ?>

    :

    :

    :

    :

    joomla/joomla/components/com_mailto/views/mailto/tmpl/index.html0000766000000000000000000000005411234314122026403 0ustar adminadministratorsjoomla/joomla/components/com_mailto/views/mailto/metadata.xml0000766000000000000000000000004511234314122025734 0ustar adminadministrators joomla/joomla/components/com_mailto/views/mailto/view.html.php0000766000000000000000000000332211234314122026061 0ustar adminadministratorsgetData(); if ($data === false) { return false; } $this->set('data' , $data); parent::display($tpl); } function &getData() { $user =& JFactory::getUser(); $data = new stdClass(); $data->link = urldecode( JRequest::getVar( 'link', '', 'method', 'base64' ) ); if ($data->link == '') { JError::raiseError( 403, 'Link is missing' ); $false = false; return $false; } // Load with previous data, if it exists $mailto = JRequest::getString('mailto', '', 'post'); $sender = JRequest::getString('sender', '', 'post'); $from = JRequest::getString('from', '', 'post'); $subject = JRequest::getString('subject', '', 'post'); if ($user->get('id') > 0) { $data->sender = $user->get('name'); $data->from = $user->get('email'); } else { $data->sender = $sender; $data->from = $from; } $data->subject = $subject; $data->mailto = $mailto; return $data; } } joomla/joomla/components/com_mailto/views/mailto/index.html0000766000000000000000000000005411234314122025427 0ustar adminadministratorsjoomla/joomla/components/com_mailto/views/sent/0000777000000000000000000000000011266551235023133 5ustar adminadministratorsjoomla/joomla/components/com_mailto/views/sent/tmpl/0000777000000000000000000000000011266551236024110 5ustar adminadministratorsjoomla/joomla/components/com_mailto/views/sent/tmpl/default.php0000766000000000000000000000066111234314122026233 0ustar adminadministrators
    joomla/joomla/components/com_mailto/views/sent/tmpl/index.html0000766000000000000000000000005411234314122026067 0ustar adminadministratorsjoomla/joomla/components/com_mailto/views/sent/metadata.xml0000766000000000000000000000075111234314122025424 0ustar adminadministrators Mailto Andrew Eddie 13 Mar 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org Generic mail link to friend form joomla/joomla/components/com_mailto/views/sent/view.html.php0000766000000000000000000000146511234314122025553 0ustar adminadministratorsjoomla/joomla/components/com_mailto/views/index.html0000766000000000000000000000005411234314122024142 0ustar adminadministratorsjoomla/joomla/components/com_mailto/controller.php0000766000000000000000000001057511234314120023713 0ustar adminadministratorsset('com_mailto.formtime', time()); JRequest::setVar( 'view', 'mailto' ); $this->display(); } /** * Send the message and display a notice * * @access public * @since 1.5 */ function send() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $session =& JFactory::getSession(); $db =& JFactory::getDBO(); // we return time() instead of 0 (as it previously was), so that the session variable has to be set in order to send the mail $timeout = $session->get('com_mailto.formtime', time()); if($timeout == 0 || time() - $timeout < MAILTO_TIMEOUT) { JError::raiseNotice( 500, JText:: _ ('EMAIL_NOT_SENT' )); return $this->mailto(); } // here we unset the counter right away so that you have to wait again, and you have to visit mailto() first $session->set('com_mailto.formtime', null); jimport( 'joomla.mail.helper' ); $SiteName = $mainframe->getCfg('sitename'); $MailFrom = $mainframe->getCfg('mailfrom'); $FromName = $mainframe->getCfg('fromname'); $link = base64_decode( JRequest::getVar( 'link', '', 'post', 'base64' ) ); // Verify that this is a local link if(!JURI::isInternal($link)) { //Non-local url... JError::raiseNotice( 500, JText:: _ ('EMAIL_NOT_SENT' )); return $this->mailto(); } // An array of e-mail headers we do not want to allow as input $headers = array ( 'Content-Type:', 'MIME-Version:', 'Content-Transfer-Encoding:', 'bcc:', 'cc:'); // An array of the input fields to scan for injected headers $fields = array ('mailto', 'sender', 'from', 'subject', ); /* * Here is the meat and potatoes of the header injection test. We * iterate over the array of form input and check for header strings. * If we find one, send an unauthorized header and die. */ foreach ($fields as $field) { foreach ($headers as $header) { if (strpos($_POST[$field], $header) !== false) { JError::raiseError(403, ''); } } } /* * Free up memory */ unset ($headers, $fields); $email = JRequest::getString('mailto', '', 'post'); $sender = JRequest::getString('sender', '', 'post'); $from = JRequest::getString('from', '', 'post'); $subject_default = JText::sprintf('Item sent by', $sender); $subject = JRequest::getString('subject', $subject_default, 'post'); // Check for a valid to address $error = false; if ( ! $email || ! JMailHelper::isEmailAddress($email) ) { $error = JText::sprintf('EMAIL_INVALID', $email); JError::raiseWarning(0, $error ); } // Check for a valid from address if ( ! $from || ! JMailHelper::isEmailAddress($from) ) { $error = JText::sprintf('EMAIL_INVALID', $from); JError::raiseWarning(0, $error ); } if ( $error ) { return $this->mailto(); } // Build the message to send $msg = JText :: _('EMAIL_MSG'); $body = sprintf( $msg, $SiteName, $sender, $from, $link); // Clean the email data $subject = JMailHelper::cleanSubject($subject); $body = JMailHelper::cleanBody($body); $sender = JMailHelper::cleanAddress($sender); // Send the email if ( JUtility::sendMail($from, $sender, $email, $subject, $body) !== true ) { JError::raiseNotice( 500, JText:: _ ('EMAIL_NOT_SENT' )); return $this->mailto(); } JRequest::setVar( 'view', 'sent' ); $this->display(); } } joomla/joomla/components/com_mailto/mailto.xml0000766000000000000000000000140711234314122023022 0ustar adminadministrators MailTo Joomla! Project April 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 A generic mail to friend component joomla/joomla/components/com_mailto/index.html0000766000000000000000000000005411234314120023003 0ustar adminadministratorsjoomla/joomla/components/com_poll/0000777000000000000000000000000011266551230020501 5ustar adminadministratorsjoomla/joomla/components/com_poll/router.php0000766000000000000000000000650711234314126022537 0ustar adminadministratorsgetItems('componentid', $component->id); } // Search for an appropriate menu item. if (is_array($items)) { // If only the option and itemid are specified in the query, return that item. if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) { $itemid = (int) $query['Itemid']; } // Search for a specific link based on the critera given. if (!$itemid) { foreach ($items as $item) { // Check if this menu item links to this view. if (isset($item->query['view']) && $item->query['view'] == 'poll' && isset($query['view']) && $query['view'] != 'category' && isset($item->query['id']) && $item->query['id'] == $query['id']) { $itemid = $item->id; } } } // If no specific link has been found, search for a general one. if (!$itemid) { foreach ($items as $item) { if (isset($query['view']) && $query['view'] == 'poll' && isset($item->query['view']) && $item->query['view'] == 'poll') { // Check for an undealt with newsfeed id. if (isset($query['id'])) { // This menu item links to the newsfeed view but we need to append the newsfeed id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } } } // Check if the router found an appropriate itemid. if (!$itemid) { // Check if a id was specified. if (isset($query['id'])) { if (isset($query['alias'])) { $query['id'] .= ':'.$query['alias']; } // Push the id onto the stack. $segments[] = $query['id']; unset($query['id']); unset($query['alias']); } unset($query['view']); } else { $query['Itemid'] = $itemid; // Remove the unnecessary URL segments. unset($query['view']); unset($query['id']); unset($query['catid']); unset($query['alias']); } return $segments; } /** * @param array * @return array */ function PollParseRoute( $segments ) { $vars = array(); //Get the active menu item $menu =& JSite::getMenu(); $item =& $menu->getActive(); $count = count( $segments ); //Standard routing for articles if(!isset($item)) { $vars['id'] = $segments[$count - 1]; return $vars; } // Count route segments $vars['id'] = $segments[$count-1]; $vars['view'] = 'poll'; return $vars; }joomla/joomla/components/com_poll/assets/0000777000000000000000000000000011266551231022004 5ustar adminadministratorsjoomla/joomla/components/com_poll/assets/blank.png0000766000000000000000000000025011234314126023572 0ustar adminadministratorsPNG  IHDREMYvtIME ''ڭ3R pHYs  ~gAMA aPLTEtRNS@fIDATx nH@<DIENDB`joomla/joomla/components/com_poll/assets/index.html0000766000000000000000000000005411234314126023774 0ustar adminadministratorsjoomla/joomla/components/com_poll/assets/poll_bars.css0000766000000000000000000000102411234314126024464 0ustar adminadministrators/* polls Bar Colors/Formats - Follow the format to add your own. Then update the maxcolors setting for polls in components/com_poll/poll.php -> $polls_maxcolors */ .polls_color_1{ background-color: #8D1B1B; border: 2px ridge #B22222; } .polls_color_2{ background-color: #6740E1; border: 2px ridge #4169E1; } .polls_color_3{ background-color: #8D8D8D; border: 2px ridge #D2D2D2; } .polls_color_4{ background-color: #CC8500; border: 2px ridge #FFA500; } .polls_color_5{ background-color: #5B781E; border: 2px ridge #6B8E23; } joomla/joomla/components/com_poll/assets/poll.png0000766000000000000000000000121411234314126023452 0ustar adminadministratorsPNG  IHDR ,c tIME  N pHYs  ~wPLTE/BCT œ UKln x ӚaMt vӚ! a Py~*!%Ӛ- a R 50:Ӛ> aV &*E5ARӚ[))aZ4;]DZrӚ""44a`DP~Ӛ++BBagXk$$66SSa$$u$ۃ..CCmma--88XXa@@EEppaZZaaak{tRNS@fIDATxc`**k`Ҳr')!=#3 cOHqSRCB#"cb=<}|ml]\ ML̕-,T54ut$edUxED%YX98yp?fAIENDB`joomla/joomla/components/com_poll/views/0000777000000000000000000000000011266551227021644 5ustar adminadministratorsjoomla/joomla/components/com_poll/views/poll/0000777000000000000000000000000011266551230022604 5ustar adminadministratorsjoomla/joomla/components/com_poll/views/poll/tmpl/0000777000000000000000000000000011266551230023560 5ustar adminadministratorsjoomla/joomla/components/com_poll/views/poll/tmpl/default.xml0000766000000000000000000000070311234314126025723 0ustar adminadministrators Poll Layout STANDARD POLL LAYOUT DESC joomla/joomla/components/com_poll/views/poll/tmpl/default.php0000766000000000000000000000146211234314126025715 0ustar adminadministrators
    params->get( 'show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    loadTemplate('graph'); ?>
    joomla/joomla/components/com_poll/views/poll/tmpl/default_graph.php0000766000000000000000000000332211234314126027073 0ustar adminadministrators
    votes as $vote) : ?>
    escape($this->poll->title); ?>
    text; ?>
    escape($vote->hits); ?>  escape($vote->percent); ?>%

     :  votes[0])) echo $this->votes[0]->voters; ?>
     :  escape($this->first_vote); ?>
     :  escape($this->last_vote); ?>
    joomla/joomla/components/com_poll/views/poll/tmpl/index.html0000766000000000000000000000005411234314126025551 0ustar adminadministratorsjoomla/joomla/components/com_poll/views/poll/metadata.xml0000766000000000000000000000021611234314126025102 0ustar adminadministrators joomla/joomla/components/com_poll/views/poll/view.html.php0000766000000000000000000001172611234314126025236 0ustar adminadministratorsgetPathway(); $poll_id = JRequest::getVar( 'id', 0, '', 'int' ); $poll =& JTable::getInstance('poll', 'Table'); $poll->load( $poll_id ); // if id value is passed and poll not published then exit if ($poll->id > 0 && $poll->published != 1) { JError::raiseError( 403, JText::_('Access Forbidden') ); return; } // Adds parameter handling $params = $mainframe->getParams(); //Set page title information $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $poll->title); } } else { $params->set('page_title', $poll->title); } $document->setTitle( $params->get( 'page_title' ) ); //Set pathway information $pathway->addItem($poll->title, ''); $params->def( 'show_page_title', 1 ); $params->def( 'page_title', $poll->title ); $first_vote = ''; $last_vote = ''; $votes = ''; // Check if there is a poll corresponding to id and if poll is published if ($poll->id > 0) { if (empty( $poll->title )) { $poll->id = 0; $poll->title = JText::_( 'Select Poll from the list' ); } $query = 'SELECT MIN( date ) AS mindate, MAX( date ) AS maxdate' . ' FROM #__poll_date' . ' WHERE poll_id = '. (int) $poll->id; $db->setQuery( $query ); $dates = $db->loadObject(); if (isset( $dates->mindate )) { $first_vote = JHTML::_('date', $dates->mindate, JText::_('DATE_FORMAT_LC2') ); $last_vote = JHTML::_('date', $dates->maxdate, JText::_('DATE_FORMAT_LC2') ); } $query = 'SELECT a.id, a.text, a.hits, b.voters ' . ' FROM #__poll_data AS a' . ' INNER JOIN #__polls AS b ON b.id = a.pollid' . ' WHERE a.pollid = '. (int) $poll->id . ' AND a.text <> ""' . ' ORDER BY a.hits DESC'; $db->setQuery( $query ); $votes = $db->loadObjectList(); } else { $votes = array(); } // list of polls for dropdown selection $query = 'SELECT id, title, alias' . ' FROM #__polls' . ' WHERE published = 1' . ' ORDER BY id' ; $db->setQuery( $query ); $pList = $db->loadObjectList(); foreach ($pList as $k=>$p) { $pList[$k]->url = JRoute::_('index.php?option=com_poll&id='.$p->id.':'.$p->alias); } array_unshift( $pList, JHTML::_('select.option', '', JText::_( 'Select Poll from the list' ), 'url', 'title' )); // dropdown output $lists = array(); $lists['polls'] = JHTML::_('select.genericlist', $pList, 'id', 'class="inputbox" size="1" style="width:200px" onchange="if (this.options[selectedIndex].value != \'\') {document.location.href=this.options[selectedIndex].value}"', 'url', 'title', JRoute::_('index.php?option=com_poll&id='.$poll->id.':'.$poll->alias) ); $graphwidth = 200; $barheight = 4; $maxcolors = 5; $barcolor = 0; $tabcnt = 0; $colorx = 0; $maxval = isset($votes[0]) ? $votes[0]->hits : 0; $sumval = isset($votes[0]) ? $votes[0]->voters : 0; $k = 0; for ($i = 0; $i < count( $votes ); $i++) { $vote =& $votes[$i]; if ($maxval > 0 && $sumval > 0) { $vote->width = ceil( $vote->hits * $graphwidth / $maxval ); $vote->percent = round( 100 * $vote->hits / $sumval, 1 ); } else { $vote->width = 0; $vote->percent = 0; } $vote->class = ''; if ($barcolor == 0) { if ($colorx < $maxcolors) { $colorx = ++$colorx; } else { $colorx = 1; } $vote->class = "polls_color_".$colorx; } else { $vote->class = "polls_color_".$barcolor; } $vote->barheight = $barheight; $vote->odd = $k; $vote->count = $i; $k = 1 - $k; } $this->assign('first_vote', $first_vote); $this->assign('last_vote', $last_vote); $this->assignRef('lists', $lists); $this->assignRef('params', $params); $this->assignRef('poll', $poll); $this->assignRef('votes', $votes); parent::display($tpl); } } ?> joomla/joomla/components/com_poll/views/poll/index.html0000766000000000000000000000005411234314126024575 0ustar adminadministratorsjoomla/joomla/components/com_poll/views/index.html0000766000000000000000000000005411234314126023627 0ustar adminadministratorsjoomla/joomla/components/com_poll/controller.php0000766000000000000000000000474711234314126023406 0ustar adminadministratorsload( $poll_id ) || $poll->published != 1) { JError::raiseWarning( 404, JText::_('ALERTNOTAUTH') ); return; } $cookieName = JUtility::getHash( $mainframe->getName() . 'poll' . $poll_id ); // ToDo - may be adding those information to the session? $voted = JRequest::getVar( $cookieName, '0', 'COOKIE', 'INT'); if ($voted || !$option_id ) { if($voted) { $msg = JText::_('You already voted for this poll today!'); } if(!$option_id){ $msg = JText::_('WARNSELECT'); } } else { setcookie( $cookieName, '1', time() + $poll->lag ); require_once(JPATH_COMPONENT.DS.'models'.DS.'poll.php'); $model = new PollModelPoll(); $model->vote( $poll_id, $option_id ); $msg = JText::_( 'Thanks for your vote!' ); } // set Itemid id for links $menu = &JSite::getMenu(); $items = $menu->getItems('link', 'index.php?option=com_poll&view=poll'); $itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : ''; $this->setRedirect( JRoute::_('index.php?option=com_poll&id='. $poll_id.':'.$poll->alias.$itemid, false), $msg ); } } ?>joomla/joomla/components/com_poll/index.html0000766000000000000000000000005411234314126022472 0ustar adminadministratorsjoomla/joomla/components/com_poll/poll.php0000766000000000000000000000254311234314126022161 0ustar adminadministratorsregisterTask( 'results', 'display' ); // Perform the Request task $controller->execute(JRequest::getCmd('task')); // Redirect if set by the controller $controller->redirect(); joomla/joomla/components/com_poll/models/0000777000000000000000000000000011266551230021764 5ustar adminadministratorsjoomla/joomla/components/com_poll/models/index.html0000766000000000000000000000005411234314126023755 0ustar adminadministratorsjoomla/joomla/components/com_poll/models/poll.php0000766000000000000000000000311011234314126023433 0ustar adminadministratorsgetDBO(); $poll_id = (int) $poll_id; $option_id = (int) $option_id; $query = 'UPDATE #__poll_data' . ' SET hits = hits + 1' . ' WHERE pollid = ' . (int) $poll_id . ' AND id = ' . (int) $option_id ; $db->setQuery( $query ); $db->query(); $query = 'UPDATE #__polls' . ' SET voters = voters + 1' . ' WHERE id = ' . (int) $poll_id ; $db->setQuery( $query ); $db->query(); $date =& JFactory::getDate(); $query = 'INSERT INTO #__poll_date' . ' SET date = ' . $db->Quote($date->toMySQL()) . ', vote_id = ' . (int) $option_id . ', poll_id = ' . (int) $poll_id ; $db->setQuery( $query ); $db->query(); } } joomla/joomla/components/com_banners/0000777000000000000000000000000011266551250021165 5ustar adminadministratorsjoomla/joomla/components/com_banners/router.php0000766000000000000000000000273711234314126023222 0ustar adminadministratorsgetModel( 'Banner' ); $model->click( $bid ); $this->setRedirect( $model->getUrl( $bid ) ); } } }joomla/joomla/components/com_banners/index.html0000766000000000000000000000005411234314126023154 0ustar adminadministratorsjoomla/joomla/components/com_banners/banners.php0000766000000000000000000000174211234314126023325 0ustar adminadministrators 'click') ); // Perform the Request task $controller->execute(JRequest::getVar('task', null, 'default', 'cmd')); // Redirect if set by the controller $controller->redirect();joomla/joomla/components/com_banners/models/0000777000000000000000000000000011266551250022450 5ustar adminadministratorsjoomla/joomla/components/com_banners/models/banner.php0000766000000000000000000001126711234314126024430 0ustar adminadministratorsgetDBO(); $ordering = @$filters['ordering']; $tagSearch = @$filters['tag_search']; $randomise = ($ordering == 'random'); $wheres = array(); $wheres[] = 'showBanner = 1'; $wheres[] = '(imptotal = 0 OR impmade < imptotal)'; if (@$filters['cid']) { $wheres[] = 'cid = ' . (int) $filters['cid']; } if (@$filters['catid']) { $wheres[] = 'catid = ' . (int) $filters['catid']; } if (is_array( $tagSearch )) { $temp = array(); $n = count( $tagSearch ); if ($n == 0) { // if tagsearch is an array, and empty, fail the query $result = array(); return $result; } for ($i = 0; $i < $n; $i++) { $temp[] = "tags REGEXP '[[:<:]]".$db->getEscaped( $tagSearch[$i] ) . "[[:>:]]'"; } if ($n) { $wheres[] = '(' . implode( ' OR ', $temp). ')'; } } $query = "SELECT *" . ($randomise ? ', RAND() AS ordering' : '') . ' FROM #__banner' . ' WHERE ' . implode( ' AND ', $wheres ) . ' ORDER BY sticky DESC, ordering '; $db->setQuery( $query, 0, $filters['limit'] ); $result = $db->loadObjectList(); // if($db->getErrorNum()) { // JError::raiseError( 500, $db->stderr()); // } return $result; } /** * Makes impressions on a list of banners */ function impress( $list ) { $config =& JComponentHelper::getParams( 'com_banners' ); $db = &$this->getDBO(); $n = count( $list ); $trackImpressions = $config->get( 'track_impressions' ); $date =& JFactory::getDate(); $trackDate = $date->toFormat( '%Y-%m-%d' ); // TODO: Change loop single sql with where bid = x OR bid = y format for ($i = 0; $i < $n; $i++) { $item = &$list[$i]; $item->impmade++; $expire = ($item->impmade >= $item->imptotal) && ($item->imptotal != 0); $query = 'UPDATE #__banner' . ' SET impmade = impmade + 1' . ($expire ? ', showBanner=0' : '') . ' WHERE bid = '.(int) $item->bid ; $db->setQuery( $query ); if(!$db->query()) { JError::raiseError( 500, $db->stderror()); } if ($trackImpressions) { // TODO: Add impression tracking /* $query = 'UPDATE #__bannertrack SET' . ' track_type = 1,' . ' banner_id = ' . $item->bid; */ $query = 'INSERT INTO #__bannertrack ( track_type, banner_id, track_date )' . ' VALUES ( 1, '.(int) $item->bid.', '.$db->Quote($trackDate).' )' ; $db->setQuery( $query ); if(!$db->query()) { JError::raiseError( 500, $db->stderror() ); } } } } /** * Clicks the URL, incrementing the counter */ function click( $id = 0 ) { $config =& JComponentHelper::getParams( 'com_banners' ); $db = &$this->getDBO(); $trackClicks = $config->get( 'track_clicks' ); $date =& JFactory::getDate(); $trackDate = $date->toFormat( '%Y-%m-%d' ); // update click count $query = 'UPDATE #__banner' . ' SET clicks = ( clicks + 1 )' . ' WHERE bid = ' . (int)$id; $db->setQuery( $query ); if(!$db->query()) { JError::raiseError( 500, $db->stderror()); } if ($trackClicks) { $query = 'INSERT INTO #__bannertrack ( track_type, banner_id, track_date )' . ' VALUES ( 2, '.(int)$id.', '.$db->Quote($trackDate).' )' ; $db->setQuery( $query ); if(!$db->query()) { JError::raiseError( 500, $db->stderror() ); } } } /** * Get the URL for a */ function getUrl( $id = 0 ) { global $mainframe; $db = &$this->getDBO(); // redirect to banner url $query = 'SELECT clickurl, bid FROM #__banner' . ' WHERE bid = ' . (int) $id; $db->setQuery( $query ); if(!$db->query()) { JError::raiseError( 500, $db->stderr()); } $url = $db->loadResult(); // check for links if (!preg_match( '#http[s]?://|index[2]?\.php#', $url )) { $url = "http://$url"; } return $url; } } joomla/joomla/components/com_banners/models/index.html0000766000000000000000000000005411234314126024437 0ustar adminadministratorsjoomla/joomla/components/com_content/0000777000000000000000000000000011266551245021213 5ustar adminadministratorsjoomla/joomla/components/com_content/router.php0000766000000000000000000001052411234314122023231 0ustar adminadministratorsgetActive(); } else { $menuItem = &$menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mCatid = (empty($menuItem->query['catid'])) ? null : $menuItem->query['catid']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if(isset($query['view'])) { $view = $query['view']; if(empty($query['Itemid'])) { $segments[] = $query['view']; } unset($query['view']); }; // are we dealing with an article that is attached to a menu item? if (($mView == 'article') and (isset($query['id'])) and ($mId == intval($query['id']))) { unset($query['view']); unset($query['catid']); unset($query['id']); } if (isset($view) and ($view == 'section' && !empty($query['Itemid']))) { if (($mView != 'section') or ($mView == 'section' and $mId != intval($query['id']))) { $segments[] = 'section'; unset($query['Itemid']); } } if (isset($view) and $view == 'category') { if ($mId != intval($query['id']) || $mView != $view) { $segments[] = $query['id']; } unset($query['id']); } if (isset($query['catid'])) { // if we are routing an article or category where the category id matches the menu catid, don't include the category segment if ((($view == 'article') and ($mView != 'category') and ($mView != 'article') and ($mCatid != intval($query['catid'])))) { $segments[] = $query['catid']; } unset($query['catid']); }; if(isset($query['id'])) { if (empty($query['Itemid'])) { $segments[] = $query['id']; } else { if (isset($menuItem->query['id'])) { if($query['id'] != $mId) { $segments[] = $query['id']; } } else { $segments[] = $query['id']; } } unset($query['id']); }; if(isset($query['year'])) { if(!empty($query['Itemid'])) { $segments[] = $query['year']; unset($query['year']); } }; if(isset($query['month'])) { if(!empty($query['Itemid'])) { $segments[] = $query['month']; unset($query['month']); } }; if(isset($query['layout'])) { if(!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if($query['layout'] == 'default') { unset($query['layout']); } } }; return $segments; } function ContentParseRoute($segments) { $vars = array(); //Get the active menu item $menu =& JSite::getMenu(); $item =& $menu->getActive(); // Count route segments $count = count($segments); //Standard routing for articles if(!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } //Handle View and Identifier switch($item->query['view']) { case 'section' : { if($count == 1) { $vars['view'] = 'category'; if(isset($item->query['layout']) && $item->query['layout'] == 'blog') { $vars['layout'] = 'blog'; } } if($count == 2) { $vars['view'] = 'article'; $vars['catid'] = $segments[$count-2]; } $vars['id'] = $segments[$count-1]; } break; case 'category' : { $vars['id'] = $segments[$count-1]; $vars['view'] = 'article'; } break; case 'frontpage' : { $vars['id'] = $segments[$count-1]; $vars['view'] = 'article'; } break; case 'article' : { $vars['id'] = $segments[$count-1]; $vars['view'] = 'article'; } break; case 'archive' : { if($count != 1) { $vars['year'] = $count >= 2 ? $segments[$count-2] : null; $vars['month'] = $segments[$count-1]; $vars['view'] = 'archive'; } else { $vars['id'] = $segments[$count-1]; $vars['view'] = 'article'; } } } return $vars; } joomla/joomla/components/com_content/metadata.xml0000766000000000000000000000007711234314124023506 0ustar adminadministrators joomla/joomla/components/com_content/helpers/0000777000000000000000000000000011266551245022655 5ustar adminadministratorsjoomla/joomla/components/com_content/helpers/query.php0000766000000000000000000000450411234314124024523 0ustar adminadministratorsget('show_vote'); if ($voting) { // calculate voting count $select = ' , ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count'; $join = ' LEFT JOIN #__content_rating AS v ON a.id = v.content_id'; } else { $select = ''; $join = ''; } $results = array ('select' => $select, 'join' => $join); return $results; } } joomla/joomla/components/com_content/helpers/icon.php0000766000000000000000000001323311234314124024305 0ustar adminadministratorstoString(); $url = 'index.php?task=new&ret='.base64_encode($ret).'&id=0§ionid='.$article->sectionid; if ($params->get('show_icons')) { $text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') ); } else { $text = JText::_('New').' '; } $attribs = array( 'title' => JText::_( 'New' )); return JHTML::_('link', JRoute::_($url), $text, $attribs); } function pdf($article, $params, $access, $attribs = array()) { $url = 'index.php?view=article'; $url .= @$article->catslug ? '&catid='.$article->catslug : ''; $url .= '&id='.$article->slug.'&format=pdf'; $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; // checks template image directory for image, if non found default are loaded if ($params->get('show_icons')) { $text = JHTML::_('image.site', 'pdf_button.png', '/images/M_images/', NULL, NULL, JText::_('PDF')); } else { $text = JText::_('PDF').' '; } $attribs['title'] = JText::_( 'PDF' ); $attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; $attribs['rel'] = 'nofollow'; return JHTML::_('link', JRoute::_($url), $text, $attribs); } function email($article, $params, $access, $attribs = array()) { $uri =& JURI::getInstance(); $base = $uri->toString( array('scheme', 'host', 'port')); $link = $base.JRoute::_( ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid) , false ); $url = 'index.php?option=com_mailto&tmpl=component&link='.base64_encode( $link ); $status = 'width=400,height=350,menubar=yes,resizable=yes'; if ($params->get('show_icons')) { $text = JHTML::_('image.site', 'emailButton.png', '/images/M_images/', NULL, NULL, JText::_('Email')); } else { $text = ' '.JText::_('Email'); } $attribs['title'] = JText::_( 'Email' ); $attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; $output = JHTML::_('link', JRoute::_($url), $text, $attribs); return $output; } function edit($article, $params, $access, $attribs = array()) { $user =& JFactory::getUser(); $uri =& JFactory::getURI(); $ret = $uri->toString(); if ($params->get('popup')) { return; } if ($article->state < 0) { return; } if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) { return; } JHTML::_('behavior.tooltip'); $url = 'index.php?view=article&id='.$article->slug.'&task=edit&ret='.base64_encode($ret); $icon = $article->state ? 'edit.png' : 'edit_unpublished.png'; $text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit')); if ($article->state == 0) { $overlib = JText::_('Unpublished'); } else { $overlib = JText::_('Published'); } $date = JHTML::_('date', $article->created); $author = $article->created_by_alias ? $article->created_by_alias : $article->author; $overlib .= '<br />'; $overlib .= JText::_($article->groups); $overlib .= '<br />'; $overlib .= $date; $overlib .= '<br />'; $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8'); $button = JHTML::_('link', JRoute::_($url), $text); $output = ''.$button.''; return $output; } function print_popup($article, $params, $access, $attribs = array()) { $url = 'index.php?view=article'; $url .= @$article->catslug ? '&catid='.$article->catslug : ''; $url .= '&id='.$article->slug.'&tmpl=component&print=1&layout=default&page='.@ $request->limitstart; $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; // checks template image directory for image, if non found default are loaded if ( $params->get( 'show_icons' ) ) { $text = JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) ); } else { $text = JText::_( 'ICON_SEP' ) .' '. JText::_( 'Print' ) .' '. JText::_( 'ICON_SEP' ); } $attribs['title'] = JText::_( 'Print' ); $attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;"; $attribs['rel'] = 'nofollow'; return JHTML::_('link', JRoute::_($url), $text, $attribs); } function print_screen($article, $params, $access, $attribs = array()) { // checks template image directory for image, if non found default are loaded if ( $params->get( 'show_icons' ) ) { $text = JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) ); } else { $text = JText::_( 'ICON_SEP' ) .' '. JText::_( 'Print' ) .' '. JText::_( 'ICON_SEP' ); } return ''.$text.''; } } joomla/joomla/components/com_content/helpers/index.html0000766000000000000000000000005411234314124024636 0ustar adminadministratorsjoomla/joomla/components/com_content/helpers/route.php0000766000000000000000000000514411234314124024515 0ustar adminadministrators (int) $id, 'category' => (int) $catid, 'section' => (int) $sectionid, ); //Create the link $link = 'index.php?option=com_content&view=article&id='. $id; if($catid) { $link .= '&catid='.$catid; } if($item = ContentHelperRoute::_findItem($needles)) { $link .= '&Itemid='.$item->id; }; return $link; } function getSectionRoute($sectionid) { $needles = array( 'section' => (int) $sectionid ); //Create the link $link = 'index.php?option=com_content&view=section&id='.$sectionid; if($item = ContentHelperRoute::_findItem($needles)) { if(isset($item->query['layout'])) { $link .= '&layout='.$item->query['layout']; } $link .= '&Itemid='.$item->id; }; return $link; } function getCategoryRoute($catid, $sectionid) { $needles = array( 'category' => (int) $catid, 'section' => (int) $sectionid ); //Create the link $link = 'index.php?option=com_content&view=category&id='.$catid; if($item = ContentHelperRoute::_findItem($needles)) { if(isset($item->query['layout'])) { $link .= '&layout='.$item->query['layout']; } $link .= '&Itemid='.$item->id; }; return $link; } function _findItem($needles) { $component =& JComponentHelper::getComponent('com_content'); $menus = &JApplication::getMenu('site', array()); $items = $menus->getItems('componentid', $component->id); $match = null; foreach($needles as $needle => $id) { foreach($items as $item) { if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id)) { $match = $item; break; } } if(isset($match)) { break; } } return $match; } } ?> joomla/joomla/components/com_content/content.php0000766000000000000000000000237611234314122023371 0ustar adminadministratorsregisterTask( 'new' , 'edit' ); $controller->registerTask( 'apply', 'save' ); $controller->registerTask( 'apply_new', 'save' ); // Perform the Request task $controller->execute(JRequest::getVar('task', null, 'default', 'cmd')); $controller->redirect(); joomla/joomla/components/com_content/views/0000777000000000000000000000000011266551244022347 5ustar adminadministratorsjoomla/joomla/components/com_content/views/article/0000777000000000000000000000000011266551243023771 5ustar adminadministratorsjoomla/joomla/components/com_content/views/article/view.pdf.php0000766000000000000000000000732211234314124026217 0ustar adminadministratorsget( 'Article' ); $params = & $article->parameters; // Create a user access object for the current user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); // Check to see if the user has access to view the full article $aid = $user->get('aid'); if (($article->access > $aid) && ( ! $aid )) { // Redirect to login $uri = JFactory::getURI(); $return = $uri->toString(); $url = 'index.php?option=com_user&view=login'; $url .= '&return='.base64_encode($return);; //$url = JRoute::_($url, false); $mainframe->redirect($url, JText::_('You must login first') ); } else if ($article->access > $aid) { $document = &JFactory::getDocument(); $document->setTitle($article->title); $document->setHeader($this->_getHeaderText($article, $params)); echo '

    ' . JText::_('ALERTNOTAUTH') . '

    '; return; } // process the new plugins JPluginHelper::importPlugin('content', 'image'); $dispatcher->trigger('onPrepareContent', array (& $article, & $params, 0)); $document = &JFactory::getDocument(); // set document information $document->setTitle($article->title); $document->setName($article->alias); $document->setDescription($article->metadesc); $document->setMetaData('keywords', $article->metakey); // prepare header lines $document->setHeader($this->_getHeaderText($article, $params)); echo $article->text; } function _getHeaderText(& $article, & $params) { // Initialize some variables $text = ''; // Display Author name if ($params->get('show_author')) { // Display Author name $text .= "\n"; $text .= JText::sprintf( 'Written by', ($article->created_by_alias ? $article->created_by_alias : $article->author) ); } if ($params->get('show_create_date') && $params->get('show_author')) { // Display Separator $text .= "\n"; } if ($params->get('show_create_date')) { // Display Created Date if (intval($article->created)) { $create_date = JHTML::_('date', $article->created, JText::_('DATE_FORMAT_LC2')); $text .= $create_date; } } if ($params->get('show_modify_date') && ($params->get('show_author') || $params->get('show_create_date'))) { // Display Separator $text .= " - "; } if ($params->get('show_modify_date')) { // Display Modified Date if (intval($article->modified)) { $mod_date = JHTML::_('date', $article->modified, JText::_('DATE_FORMAT_LC2')); $text .= JText::_('Last Updated').' '.$mod_date; } } return $text; } } ?>joomla/joomla/components/com_content/views/article/tmpl/0000777000000000000000000000000011266551244024746 5ustar adminadministratorsjoomla/joomla/components/com_content/views/article/tmpl/default.xml0000766000000000000000000000077211234314124027110 0ustar adminadministrators Standard Article Layout STANDARD ARTICLE LAYOUT DESC joomla/joomla/components/com_content/views/article/tmpl/default.php0000766000000000000000000001247711234314124027104 0ustar adminadministratorsuser->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')); ?> params->get('show_page_title', 1) && $this->params->get('page_title') != $this->article->title) : ?>
    escape($this->params->get('page_title')); ?>
    params->get('show_title') || $this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon')) : ?> params->get('show_title')) : ?> print) : ?> params->get('show_pdf_icon')) : ?> params->get( 'show_print_icon' )) : ?> params->get('show_email_icon')) : ?>
    params->get('link_titles') && $this->article->readmore_link != '') : ?> escape($this->article->title); ?> escape($this->article->title); ?> article, $this->params, $this->access); ?> article, $this->params, $this->access); ?> article, $this->params, $this->access); ?> article, $this->params, $this->access); ?> article, $this->params, $this->access); ?>
    params->get('show_intro')) : echo $this->article->event->afterDisplayTitle; endif; ?> article->event->beforeDisplayContent; ?> params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid)) : ?> params->get('show_author')) && ($this->article->author != "")) : ?> params->get('show_create_date')) : ?> params->get('show_url') && $this->article->urls) : ?> article->modified) !=0 && $this->params->get('show_modify_date')) : ?>
    params->get('show_section') && $this->article->sectionid && isset($this->article->section)) : ?> params->get('link_section')) : ?> article->sectionid)).'">'; ?> escape($this->article->section); ?> params->get('link_section')) : ?> '; ?> params->get('show_category')) : ?> params->get('show_category') && $this->article->catid) : ?> params->get('link_category')) : ?> article->catslug, $this->article->sectionid)).'">'; ?> escape($this->article->category); ?> params->get('link_category')) : ?> '; ?>
    escape($this->article->created_by_alias) ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author)) ); ?>   
    article->created, JText::_('DATE_FORMAT_LC2')) ?>
    escape($this->article->urls); ?>
    article->toc)) : ?> article->toc; ?> article->text; ?>
    article->modified, JText::_('DATE_FORMAT_LC2'))); ?>
      article->event->afterDisplayContent; ?> joomla/joomla/components/com_content/views/article/tmpl/form.php0000766000000000000000000001466011234314124026417 0ustar adminadministratorsarticle->publish_up); $publish_up->setOffset($config->getValue('config.offset')); $publish_up = $publish_up->toFormat(); if (! isset($this->article->publish_down) || $this->article->publish_down == 'Never') { $publish_down = JText::_('Never'); } else { $publish_down =& JFactory::getDate($this->article->publish_down); $publish_down->setOffset($config->getValue('config.offset')); $publish_down = $publish_down->toFormat(); } ?> params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    editor->display('text', $this->article->text, '100%', '400', '70', '15'); ?>
    user->authorize('com_content', 'publish', 'content', 'all')) : ?>
    lists['sectionid']; ?>
    lists['catid']; ?>
    lists['state']; ?>
    lists['frontpage']; ?>
    'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
    'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
    lists['access']; ?>
    lists['ordering']; ?>
    ', "'"), '', @$_SERVER['HTTP_REFERER']); ?>" />
    joomla/joomla/components/com_content/views/article/tmpl/form.xml0000766000000000000000000000052611234314124026424 0ustar adminadministrators Article Submission Layout ARTICLE SUBMISSION LAYOUT DESC joomla/joomla/components/com_content/views/article/tmpl/index.html0000766000000000000000000000005411234314124026730 0ustar adminadministratorsjoomla/joomla/components/com_content/views/article/tmpl/pagebreak.xml0000766000000000000000000000013211234314124027373 0ustar adminadministrators joomla/joomla/components/com_content/views/article/tmpl/pagebreak.php0000766000000000000000000000265711234314124027400 0ustar adminadministrators
    joomla/joomla/components/com_content/views/article/metadata.xml0000766000000000000000000000022511234314124026261 0ustar adminadministrators joomla/joomla/components/com_content/views/article/view.html.php0000766000000000000000000003011511234314124026406 0ustar adminadministratorsgetPathway(); $params =& $mainframe->getParams('com_content'); // Initialize variables $article =& $this->get('Article'); $aparams =& $article->parameters; $params->merge($aparams); if($this->getLayout() == 'pagebreak') { $this->_displayPagebreak($tpl); return; } if($this->getLayout() == 'form') { $this->_displayForm($tpl); return; } if (($article->id == 0)) { $id = JRequest::getVar( 'id', '', 'default', 'int' ); return JError::raiseError( 404, JText::sprintf( 'Article # not found', $id ) ); } $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); if (!$params->get('intro_only') && ($this->getLayout() == 'default') && ($limitstart == 0)) { $model =& $this->getModel(); $model->hit(); } // Create a user access object for the current user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); // Check to see if the user has access to view the full article $aid = $user->get('aid'); if ($article->access <= $aid) { $article->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid));; } else { if ( ! $aid ) { // Redirect to login $uri = JFactory::getURI(); $return = $uri->toString(); $url = 'index.php?option=com_user&view=login'; $url .= '&return='.base64_encode($return);; //$url = JRoute::_($url, false); $mainframe->redirect($url, JText::_('You must login first') ); } else{ JError::raiseWarning( 403, JText::_('ALERTNOTAUTH') ); return; } } /* * Process the prepare content plugins */ JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onPrepareContent', array (& $article, & $params, $limitstart)); /* * Handle the metadata */ // because the application sets a default page title, we need to get it // right from the menu item itself // Get the menu item object $menus = &JSite::getMenu(); $menu = $menus->getActive(); if (is_object( $menu ) && isset($menu->query['view']) && $menu->query['view'] == 'article' && isset($menu->query['id']) && $menu->query['id'] == $article->id) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $article->title); } } else { $params->set('page_title', $article->title); } $document->setTitle( $params->get( 'page_title' ) ); if ($article->metadesc) { $document->setDescription( $article->metadesc ); } if ($article->metakey) { $document->setMetadata('keywords', $article->metakey); } if ($mainframe->getCfg('MetaTitle') == '1') { $mainframe->addMetaTag('title', $article->title); } if ($mainframe->getCfg('MetaAuthor') == '1') { $mainframe->addMetaTag('author', $article->author); } $mdata = new JParameter($article->metadata); $mdata = $mdata->toArray(); foreach ($mdata as $k => $v) { if ($v) { $document->setMetadata($k, $v); } } // If there is a pagebreak heading or title, add it to the page title if (!empty($article->page_title)) { $article->title = $article->title .' - '. $article->page_title; $document->setTitle($article->page_title.' - '.JText::sprintf('Page %s', $limitstart + 1)); } /* * Handle the breadcrumbs */ if($menu && $menu->query['view'] != 'article') { switch ($menu->query['view']) { case 'section': $pathway->addItem($article->category, 'index.php?view=category&id='.$article->catslug); $pathway->addItem($article->title, ''); break; case 'category': $pathway->addItem($article->title, ''); break; } } /* * Handle display events */ $article->event = new stdClass(); $results = $dispatcher->trigger('onAfterDisplayTitle', array ($article, &$params, $limitstart)); $article->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeDisplayContent', array (& $article, & $params, $limitstart)); $article->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterDisplayContent', array (& $article, & $params, $limitstart)); $article->event->afterDisplayContent = trim(implode("\n", $results)); $print = JRequest::getBool('print'); if ($print) { $document->setMetaData('robots', 'noindex, nofollow'); } $this->assignRef('article', $article); $this->assignRef('params' , $params); $this->assignRef('user' , $user); $this->assignRef('access' , $access); $this->assignRef('print', $print); parent::display($tpl); } function _displayForm($tpl) { global $mainframe; // Initialize variables $document =& JFactory::getDocument(); $user =& JFactory::getUser(); $uri =& JFactory::getURI(); $params =& $mainframe->getParams('com_content'); // Make sure you are logged in and have the necessary access rights if ($user->get('gid') < 19) { JResponse::setHeader('HTTP/1.0 403',true); JError::raiseWarning( 403, JText::_('ALERTNOTAUTH') ); return; } // Initialize variables $article =& $this->get('Article'); $aparams =& $article->parameters; $isNew = ($article->id < 1); $params->merge($aparams); // At some point in the future this will come from a request object $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); // Add the Calendar includes to the document section JHTML::_('behavior.calendar'); if ($isNew) { // TODO: Do we allow non-sectioned articles from the frontend?? $article->sectionid = JRequest::getVar('sectionid', 0, '', 'int'); $db = JFactory::getDBO(); $db->setQuery('SELECT title FROM #__sections WHERE id = '.(int) $article->sectionid); $article->section = $db->loadResult(); } // Get the lists $lists = $this->_buildEditLists(); // Load the JEditor object $editor =& JFactory::getEditor(); // Build the page title string $title = $article->id ? JText::_('Edit') : JText::_('New'); // Set page title // because the application sets a default page title, we need to get it // right from the menu item itself // Get the menu item object $menus = &JSite::getMenu(); $menu = $menus->getActive(); $params->set( 'page_title', $params->get( 'page_title' ) ); if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Submit an Article' )); } } else { $params->set('page_title', JText::_( 'Submit an Article' )); } $document->setTitle( $params->get( 'page_title' ) ); // get pathway $pathway =& $mainframe->getPathWay(); $pathway->addItem($title, ''); // Unify the introtext and fulltext fields and separated the fields by the {readmore} tag if (JString::strlen($article->fulltext) > 1) { $article->text = $article->introtext."
    ".$article->fulltext; } else { $article->text = $article->introtext; } $this->assign('action', $uri->toString()); $this->assignRef('article', $article); $this->assignRef('params', $params); $this->assignRef('lists', $lists); $this->assignRef('editor', $editor); $this->assignRef('user', $user); parent::display($tpl); } function _buildEditLists() { // Get the article and database connector from the model $article = & $this->get('Article'); $db = & JFactory::getDBO(); $javascript = "onchange=\"changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);\""; $query = 'SELECT s.id, s.title' . ' FROM #__sections AS s' . ' ORDER BY s.ordering'; $db->setQuery($query); $sections[] = JHTML::_('select.option', '-1', '- '.JText::_('Select Section').' -', 'id', 'title'); $sections[] = JHTML::_('select.option', '0', JText::_('Uncategorized'), 'id', 'title'); $sections = array_merge($sections, $db->loadObjectList()); $lists['sectionid'] = JHTML::_('select.genericlist', $sections, 'sectionid', 'class="inputbox" size="1" '.$javascript, 'id', 'title', intval($article->sectionid)); foreach ($sections as $section) { $section_list[] = (int) $section->id; // get the type name - which is a special category if ($article->sectionid) { if ($section->id == $article->sectionid) { $contentSection = $section->title; } } else { if ($section->id == $article->sectionid) { $contentSection = $section->title; } } } $sectioncategories = array (); $sectioncategories[-1] = array (); $sectioncategories[-1][] = JHTML::_('select.option', '-1', JText::_( 'Select Category' ), 'id', 'title'); $section_list = implode('\', \'', $section_list); $query = 'SELECT id, title, section' . ' FROM #__categories' . ' WHERE section IN ( \''.$section_list.'\' )' . ' ORDER BY ordering'; $db->setQuery($query); $cat_list = $db->loadObjectList(); // Uncategorized category mapped to uncategorized section $uncat = new stdClass(); $uncat->id = 0; $uncat->title = JText::_('Uncategorized'); $uncat->section = 0; $cat_list[] = $uncat; foreach ($sections as $section) { $sectioncategories[$section->id] = array (); $rows2 = array (); foreach ($cat_list as $cat) { if ($cat->section == $section->id) { $rows2[] = $cat; } } foreach ($rows2 as $row2) { $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->title, 'id', 'title'); } } $categories = array(); foreach ($cat_list as $cat) { if($cat->section == $article->sectionid) $categories[] = $cat; } $categories[] = JHTML::_('select.option', '-1', JText::_( 'Select Category' ), 'id', 'title'); $lists['sectioncategories'] = $sectioncategories; $lists['catid'] = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1"', 'id', 'title', intval($article->catid)); // Select List: Category Ordering $query = 'SELECT ordering AS value, title AS text FROM #__content WHERE catid = '.(int) $article->catid.' AND state > ' .(int) "-1" . ' ORDER BY ordering'; $lists['ordering'] = JHTML::_('list.specificordering', $article, $article->id, $query, 1); // Radio Buttons: Should the article be published $lists['state'] = JHTML::_('select.booleanlist', 'state', '', $article->state); // Radio Buttons: Should the article be added to the frontpage if($article->id) { $query = 'SELECT content_id FROM #__content_frontpage WHERE content_id = '. (int) $article->id; $db->setQuery($query); $article->frontpage = $db->loadResult(); } else { $article->frontpage = 0; } $lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', (boolean) $article->frontpage); // Select List: Group Access $lists['access'] = JHTML::_('list.accesslevel', $article); return $lists; } function _displayPagebreak($tpl) { $document =& JFactory::getDocument(); $document->setTitle(JText::_('PGB ARTICLE PAGEBRK')); parent::display($tpl); } } ?> joomla/joomla/components/com_content/views/article/index.html0000766000000000000000000000005411234314124025754 0ustar adminadministratorsjoomla/joomla/components/com_content/views/archive/0000777000000000000000000000000011266551244023770 5ustar adminadministratorsjoomla/joomla/components/com_content/views/archive/tmpl/0000777000000000000000000000000011266551244024744 5ustar adminadministratorsjoomla/joomla/components/com_content/views/archive/tmpl/default.xml0000766000000000000000000000172611234314124027106 0ustar adminadministrators Archived Article List Layout ARCHIVED ARTICLE LIST LAYOUT DESC joomla/joomla/components/com_content/views/archive/tmpl/default.php0000766000000000000000000000177411234314124027100 0ustar adminadministrators
    params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>

    params->get('filter')) : ?> form->monthField; ?> form->yearField; ?> form->limitField; ?>

    loadTemplate('items'); ?>
    joomla/joomla/components/com_content/views/archive/tmpl/default_items.php0000766000000000000000000000456211234314124030277 0ustar adminadministrators joomla/joomla/components/com_content/views/archive/tmpl/index.html0000766000000000000000000000005411234314124026726 0ustar adminadministratorsjoomla/joomla/components/com_content/views/archive/metadata.xml0000766000000000000000000000021711234314124026260 0ustar adminadministrators joomla/joomla/components/com_content/views/archive/view.html.php0000766000000000000000000001035611234314124026411 0ustar adminadministratorsgetPathway(); $document =& JFactory::getDocument(); // Get the page/component configuration $params = &$mainframe->getParams('com_content'); // Request variables $task = JRequest::getCmd('task'); $limit = $mainframe->getUserStateFromRequest('com_content.'.$this->getLayout().'.limit', 'limit', $params->get('display_num', 20), 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $month = JRequest::getInt( 'month' ); $year = JRequest::getInt( 'year' ); $filter = JRequest::getString( 'filter' ); JRequest::setVar('limit', (int) $limit); // Get some data from the model $state = & $this->get( 'state' ); $items = & $this->get( 'data' ); $total = & $this->get( 'total' ); // Add item to pathway $pathway->addItem(JText::_('Archive'), ''); $params->def('filter', 1); $params->def('filter_type', 'title'); jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Archives' )); } } else { $params->set('page_title', JText::_( 'Archives' )); } $document->setTitle( $params->get( 'page_title' ) ); $form = new stdClass(); // Month Field $months = array( JHTML::_('select.option', null, JText::_( 'Month' ) ), JHTML::_('select.option', '01', JText::_( 'JANUARY_SHORT' ) ), JHTML::_('select.option', '02', JText::_( 'FEBRUARY_SHORT' ) ), JHTML::_('select.option', '03', JText::_( 'MARCH_SHORT' ) ), JHTML::_('select.option', '04', JText::_( 'APRIL_SHORT' ) ), JHTML::_('select.option', '05', JText::_( 'MAY_SHORT' ) ), JHTML::_('select.option', '06', JText::_( 'JUNE_SHORT' ) ), JHTML::_('select.option', '07', JText::_( 'JULY_SHORT' ) ), JHTML::_('select.option', '08', JText::_( 'AUGUST_SHORT' ) ), JHTML::_('select.option', '09', JText::_( 'SEPTEMBER_SHORT' ) ), JHTML::_('select.option', '10', JText::_( 'OCTOBER_SHORT' ) ), JHTML::_('select.option', '11', JText::_( 'NOVEMBER_SHORT' ) ), JHTML::_('select.option', '12', JText::_( 'DECEMBER_SHORT' ) ) ); $form->monthField = JHTML::_('select.genericlist', $months, 'month', 'size="1" class="inputbox"', 'value', 'text', $month ); // Year Field $years = array(); $years[] = JHTML::_('select.option', null, JText::_( 'Year' ) ); for ($i=2000; $i <= 2010; $i++) { $years[] = JHTML::_('select.option', $i, $i ); } $form->yearField = JHTML::_('select.genericlist', $years, 'year', 'size="1" class="inputbox"', 'value', 'text', $year ); $form->limitField = $pagination->getLimitBox(); $this->assign('filter' , $filter); $this->assign('year' , $year); $this->assign('month' , $month); $this->assignRef('form', $form); $this->assignRef('items', $items); $this->assignRef('params', $params); $this->assignRef('user', $user); $this->assignRef('pagination', $pagination); parent::display($tpl); } } ?> joomla/joomla/components/com_content/views/archive/index.html0000766000000000000000000000005411234314124025752 0ustar adminadministratorsjoomla/joomla/components/com_content/views/index.html0000766000000000000000000000005411234314122024327 0ustar adminadministratorsjoomla/joomla/components/com_content/views/section/0000777000000000000000000000000011266551237024015 5ustar adminadministratorsjoomla/joomla/components/com_content/views/section/tmpl/0000777000000000000000000000000011266551240024763 5ustar adminadministratorsjoomla/joomla/components/com_content/views/section/tmpl/blog_item.php0000766000000000000000000001322011234314124027425 0ustar adminadministrators user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')); ?> item->state == 0) : ?>
    item->params->get('show_title') || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon') || $canEdit) : ?> item->params->get('show_title')) : ?> item->params->get('show_pdf_icon')) : ?> item->params->get( 'show_print_icon' )) : ?> item->params->get('show_email_icon')) : ?>
    item->params->get('link_titles') && $this->item->readmore_link != '') : ?> escape($this->item->title); ?> escape($this->item->title); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?>
    item->params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?> item->event->beforeDisplayContent; ?> item->params->get('show_section') && $this->item->sectionid) || ($this->item->params->get('show_category') && $this->item->catid)) : ?> item->params->get('show_author')) && ($this->item->author != "")) : ?> item->params->get('show_create_date')) : ?> item->params->get('show_url') && $this->item->urls) : ?> item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?> item->params->get('show_readmore') && $this->item->readmore) : ?>
    item->params->get('show_section') && $this->item->sectionid && isset($this->section->title)) : ?> item->params->get('link_section')) : ?> item->sectionid)).'">'; ?> escape($this->section->title); ?> item->params->get('link_section')) : ?> '; ?> item->params->get('show_category')) : ?> item->params->get('show_category') && $this->item->catid) : ?> item->params->get('link_category')) : ?> item->catslug, $this->item->sectionid)).'">'; ?> escape($this->item->category); ?> item->params->get('link_category')) : ?> '; ?>
    escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author)) ); ?>   
    item->created, JText::_('DATE_FORMAT_LC2')); ?>
    escape($this->item->urls); ?>
    item->toc)) : ?> item->toc; ?> item->text; ?>
    item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
    item->readmore_register) : echo JText::_('Register to read more...'); elseif ($readmore = $this->item->params->get('readmore')) : echo $readmore; else : echo JText::sprintf('Read more...'); endif; ?>
    item->state == 0) : ?>
      item->event->afterDisplayContent; ?> joomla/joomla/components/com_content/views/section/tmpl/blog.xml0000766000000000000000000000642011234314124026424 0ustar adminadministrators Section Blog Layout SECTION BLOG LAYOUT DESC joomla/joomla/components/com_content/views/section/tmpl/default.xml0000766000000000000000000000567411234314124027137 0ustar adminadministrators Standard Section Layout STANDARD SECTION LAYOUT DESC joomla/joomla/components/com_content/views/section/tmpl/default.php0000766000000000000000000000400711234314124027113 0ustar adminadministrators params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    params->get('show_description_image') && $this->section->image) : ?> <?php echo $this->section->image;?> params->get('show_description') && $this->section->description) : ?> section->description; ?>
    params->get('show_categories', 1)) : ?>
      categories as $category) : ?> params->get('show_empty_categories') && !$category->numitems) continue; ?>
    • escape($category->title);?> params->get('show_cat_num_articles')) : ?>   ( numitems==1) { echo $category->numitems ." ". JText::_( 'item' );} else { echo $category->numitems ." ". JText::_( 'items' );} ?> ) params->def('show_category_description', 1) && $category->description) : ?>
      description; ?>
    joomla/joomla/components/com_content/views/section/tmpl/blog_links.php0000766000000000000000000000063611234314124027616 0ustar adminadministrators
    joomla/joomla/components/com_content/views/section/tmpl/index.html0000766000000000000000000000005411234314124026751 0ustar adminadministratorsjoomla/joomla/components/com_content/views/section/tmpl/blog.php0000766000000000000000000001060211234314124026410 0ustar adminadministrators params->get('show_page_title')) : ?>
    escape($this->params->get('page_title')); ?>
    params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?> params->def('num_leading_articles', 1)) : ?> pagination->limitstart; endif; ?> pagination->limitstart + $this->params->get('num_leading_articles'); $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles', 4); if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?> params->def('num_links', 4) && ($i < $this->total)) : ?> params->def('show_pagination', 2)) : ?> params->def('show_pagination_results', 1)) : ?>
    params->get('show_description_image') && $this->section->image) : ?> params->get('show_description') && $this->section->description) : ?> section->description; ?>

    pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?> = $this->total) : break; endif; ?>
    item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); ?>
    params->def('multi_column_order', 0)) : // order across, like front page for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?> params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns')); ?> params->get('num_intro_articles', 4) ; else : // otherwise, order down, same as before (default behaviour) for ($z = 0; $z < $this->params->get('num_columns'); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?>
    params->get('num_columns')) + $z; if ($target < $this->total && $target < ($numIntroArticles)) : $this->item =& $this->getItem($target, $this->params); echo $this->loadTemplate('item'); endif; endfor; ?> params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $y ++) : if ($i < $this->total && $i < ($numIntroArticles)) : $this->item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); $i ++; endif; endfor; ?>
    links = array_splice($this->items, $i - $this->pagination->limitstart); echo $this->loadTemplate('links'); ?>
    pagination->getPagesLinks(); ?>

    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_content/views/section/metadata.xml0000766000000000000000000000021711234314124026303 0ustar adminadministrators joomla/joomla/components/com_content/views/section/view.html.php0000766000000000000000000001415211234314124026432 0ustar adminadministratorsgetParams(); // Request variables $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); //parameters $intro = $params->def('num_intro_articles', 4); $leading = $params->def('num_leading_articles', 1); $links = $params->def('num_links', 4); $limit = $intro + $leading + $links; JRequest::setVar('limit', (int) $limit); // Get some data from the model $items = & $this->get( 'Data'); $total = & $this->get( 'Total'); $categories = & $this->get( 'Categories' ); $section = & $this->get( 'Section' ); // Create a user access object for the user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); //add alternate feed link if($params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $section->title); } } else { $params->set('page_title', $section->title); } $document->setTitle( $params->get( 'page_title' ) ); // Prepare section description $section->description = JHTML::_('content.prepare', $section->description); for($i = 0; $i < count($categories); $i++) { $category =& $categories[$i]; $category->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->slug, $category->section).'&layout=default'); // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); } if ($total == 0) { $params->set('show_categories', false); } jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit - $links); $this->assign('total', $total); $this->assignRef('items', $items); $this->assignRef('section', $section); $this->assignRef('categories', $categories); $this->assignRef('params', $params); $this->assignRef('user', $user); $this->assignRef('access', $access); $this->assignRef('pagination', $pagination); parent::display($tpl); } function &getItem( $index = 0, &$params) { global $mainframe; // Initialize some variables $user =& JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); $SiteName = $mainframe->getCfg('sitename'); $task = JRequest::getCmd('task'); $linkOn = null; $linkText = null; $item =& $this->items[$index]; $item->text = $item->introtext; // Get the page/component configuration and article parameters $item->params = clone($params); $aparams = new JParameter($item->attribs); // Merge article parameters into the page configuration $item->params->merge($aparams); // Process the content preparation plugins JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onPrepareContent', array (& $item, & $item->params, 0)); // Build the link and text of the readmore button if (($item->params->get('show_readmore') && @ $item->readmore) || $item->params->get('link_titles')) { // checks if the item is a public or registered/special item if ($item->access <= $user->get('aid', 0)) { //$item->readmore_link = JRoute::_("index.php?view=article&id=".$item->slug); $item->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid)); $item->readmore_register = false; } else { $item->readmore_link = JRoute::_("index.php?option=com_user&view=login"); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid),false); $fullURL = new JURI($item->readmore_link); $fullURL->setVar('return', base64_encode($returnURL)); $item->readmore_link = $fullURL->toString(); $item->readmore_register = true; } } $item->event = new stdClass(); $results = $dispatcher->trigger('onAfterDisplayTitle', array (& $item, & $item->params,0)); $item->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeDisplayContent', array (& $item, & $item->params, 0)); $item->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterDisplayContent', array (& $item, & $item->params, 0)); $item->event->afterDisplayContent = trim(implode("\n", $results)); return $item; } } joomla/joomla/components/com_content/views/section/index.html0000766000000000000000000000005411234314124025775 0ustar adminadministratorsjoomla/joomla/components/com_content/views/section/view.feed.php0000766000000000000000000000470011234314124026367 0ustar adminadministratorsgetParams(); $feedEmail = (@$mainframe->getCfg('feed_email')) ? $mainframe->getCfg('feed_email') : 'author'; $siteEmail = $mainframe->getCfg('mailfrom'); // Get some data from the model JRequest::setVar('limit', $mainframe->getCfg('feed_limit')); // Lets get our data from the model $rows = &$this->get( 'Data' ); $section = &$this->get( 'Section' ); $doc->link = JRoute::_(ContentHelperRoute::getSectionRoute($section->id));; foreach ( $rows as $row ) { // strip html from feed item title $title = $this->escape( $row->title ); $title = html_entity_decode( $title ); // url link to article // & used instead of & as this is converted by feed creator $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));; // strip html from feed item description text $description = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext); $author = $row->created_by_alias ? $row->created_by_alias : $row->author; // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $row->created; $item->category = $row->category; $item->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } else { $item->authorEmail = $row->author_email; } // loads item info into rss array $doc->addItem( $item ); } } } joomla/joomla/components/com_content/views/category/0000777000000000000000000000000011266551241024161 5ustar adminadministratorsjoomla/joomla/components/com_content/views/category/tmpl/0000777000000000000000000000000011266551242025136 5ustar adminadministratorsjoomla/joomla/components/com_content/views/category/tmpl/blog_item.php0000766000000000000000000001321511234314122027600 0ustar adminadministrators user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')); ?> item->state == 0) : ?>
    item->params->get('show_title') || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon') || $canEdit) : ?> item->params->get('show_title')) : ?> item->params->get('show_pdf_icon')) : ?> item->params->get( 'show_print_icon' )) : ?> item->params->get('show_email_icon')) : ?>
    item->params->get('link_titles') && $this->item->readmore_link != '') : ?> escape($this->item->title); ?> escape($this->item->title); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?>
    item->params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?> item->event->beforeDisplayContent; ?> item->params->get('show_section') && $this->item->sectionid) || ($this->item->params->get('show_category') && $this->item->catid)) : ?> item->params->get('show_author')) && ($this->item->author != "")) : ?> item->params->get('show_create_date')) : ?> item->params->get('show_url') && $this->item->urls) : ?> item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?> item->params->get('show_readmore') && $this->item->readmore) : ?>
    item->params->get('show_section') && $this->item->sectionid && isset($this->item->section)) : ?> item->params->get('link_section')) : ?> item->sectionid)).'">'; ?> escape($this->item->section); ?> item->params->get('link_section')) : ?> '; ?> item->params->get('show_category')) : ?> item->params->get('show_category') && $this->item->catid) : ?> item->params->get('link_category')) : ?> item->catslug, $this->item->sectionid)).'">'; ?> escape($this->item->category); ?> item->params->get('link_category')) : ?> '; ?>
    escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author)) ); ?>   
    item->created, JText::_('DATE_FORMAT_LC2')); ?>
    escape($this->item->urls); ?>
    item->toc)) : ?> item->toc; ?> item->text; ?>
    item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
    item->readmore_register) : echo JText::_('Register to read more...'); elseif ($readmore = $this->item->params->get('readmore')) : echo $readmore; else : echo JText::sprintf('Read more...'); endif; ?>
    item->state == 0) : ?>
      item->event->afterDisplayContent; ?> joomla/joomla/components/com_content/views/category/tmpl/blog.xml0000766000000000000000000000646411234314122026603 0ustar adminadministrators Category Blog Layout CATEGORY BLOG LAYOUT DESC joomla/joomla/components/com_content/views/category/tmpl/default.xml0000766000000000000000000000646211234314122027302 0ustar adminadministrators Standard Category Layout STANDARD CATEGORY LAYOUT DESC joomla/joomla/components/com_content/views/category/tmpl/default.php0000766000000000000000000000240511234314122027262 0ustar adminadministrators params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    category->image) : ?> <?php echo $this->category->image;?> category->description; ?>
    items =& $this->getItems(); echo $this->loadTemplate('items'); ?> access->canEdit || $this->access->canEditOwn) : echo JHTML::_('icon.create', $this->category , $this->params, $this->access); endif; ?>
    joomla/joomla/components/com_content/views/category/tmpl/default_items.php0000766000000000000000000001206611234314122030467 0ustar adminadministrators
    params->get('filter') || $this->params->get('show_pagination_limit')) : ?> params->get('show_headings')) : ?> params->get('show_title')) : ?> params->get('show_date')) : ?> params->get('show_author')) : ?> params->get('show_hits')) : ?> items as $item) : ?> params->get('show_title')) : ?> access <= $this->user->get('aid', 0)) : ?> params->get('show_date')) : ?> params->get('show_author')) : ?> params->get('show_hits')) : ?> params->get('show_pagination')) : ?>
    params->get('filter')) : ?> params->get('show_pagination_limit')) : ?>
    params->get('filter_type') . ' Filter').' '; ?> pagination->getLimitBox(); ?>
    lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?>
    pagination->getRowOffset( $item->count ); ?> escape($item->title); ?> item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?> escape($item->title).' : '; $link = JRoute::_('index.php?option=com_user&view=login'); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false); $fullURL = new JURI($link); $fullURL->setVar('return', base64_encode($returnURL)); $link = $fullURL->toString(); ?> created; ?> escape($item->created_by_alias) ? $this->escape($item->created_by_alias) : $this->escape($item->author); ?> escape($item->hits) ? $this->escape($item->hits) : '-'; ?>
     
    pagination->getPagesLinks(); ?>
    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_content/views/category/tmpl/blog_links.php0000766000000000000000000000066211234314122027764 0ustar adminadministrators
    joomla/joomla/components/com_content/views/category/tmpl/index.html0000766000000000000000000000005411234314122027120 0ustar adminadministratorsjoomla/joomla/components/com_content/views/category/tmpl/blog.php0000766000000000000000000001061711234314122026565 0ustar adminadministrators params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?> params->get('num_leading_articles')) : ?> pagination->limitstart; endif; ?> pagination->limitstart + $this->params->get('num_leading_articles'); $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles'); if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?> params->get('num_links') && ($i < $this->total)) : ?> params->get('show_pagination')) : ?> params->get('show_pagination_results')) : ?>
    params->get('show_description_image') && $this->category->image) : ?> params->get('show_description') && $this->category->description) : ?> category->description; ?>

    pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?> = $this->total) : break; endif; ?>
    item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); ?>
    params->def('multi_column_order', 0)) : // order across, like front page for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?> params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns')); ?> params->get('num_intro_articles') ; else : // otherwise, order down, same as before (default behaviour) for ($z = 0; $z < $this->params->get('num_columns'); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?>
    params->get('num_columns')) + $z; if ($target < $this->total && $target < ($numIntroArticles)) : $this->item =& $this->getItem($target, $this->params); echo $this->loadTemplate('item'); endif; endfor; ?> params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) : if ($i < $this->total && $i < ($numIntroArticles)) : $this->item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); $i ++; endif; endfor; ?>
    links = array_splice($this->items, $i - $this->pagination->limitstart); echo $this->loadTemplate('links'); ?>
    pagination->getPagesLinks(); ?>

    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_content/views/category/metadata.xml0000766000000000000000000000022111234314122026445 0ustar adminadministrators joomla/joomla/components/com_content/views/category/view.html.php0000766000000000000000000002255611234314122026610 0ustar adminadministratorsgetPathway(); // Get the menu item object $menus = &JSite::getMenu(); $menu = $menus->getActive(); // Get the page/component configuration $params = clone($mainframe->getParams('com_content')); // Request variables $layout = JRequest::getCmd('layout'); $task = JRequest::getCmd('task'); // Parameters $params->def('num_leading_articles', 1); $params->def('num_intro_articles', 4); $params->def('num_columns', 2); $params->def('num_links', 4); $params->def('show_headings', 1); $params->def('show_pagination', 2); $params->def('show_pagination_results', 1); $params->def('show_pagination_limit', 1); $params->def('filter', 1); if (($params->def('filter_type', 'title') != 'hits') && ($params->def('filter_type', 'title') != 'author')) { $params->set('filter_type', 'title'); } $intro = $params->get('num_intro_articles'); $leading = $params->get('num_leading_articles'); $links = $params->get('num_links'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); if ($layout == 'blog') { $default_limit = $intro + $leading + $links; } else { $params->def('display_num', $mainframe->getCfg('list_limit')); $default_limit = $params->get('display_num'); } $limit = $mainframe->getUserStateFromRequest('com_content.'.$this->getLayout().'.limit', 'limit', $default_limit, 'int'); JRequest::setVar('limit', (int) $limit); $contentConfig = &JComponentHelper::getParams('com_content'); $params->def('show_page_title', $contentConfig->get('show_title')); // Get some data from the model $items = & $this->get( 'Data' ); $total = & $this->get( 'Total' ); $category = & $this->get( 'Category' ); //add alternate feed link if($params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } // Create a user access object for the user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); // Set page title per category // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $category->title); } } else { $params->set('page_title', $category->title); } $document->setTitle( $params->get( 'page_title' ) ); //set breadcrumbs if(is_object($menu) && $menu->query['view'] != 'category') { $pathway->addItem($category->title, ''); } // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); $params->def('date_format', JText::_('DATE_FORMAT_LC1')); // Keep a copy for safe keeping this is soooooo dirty -- must deal with in a later version // @todo -- oh my god we need to find this reference issue in 1.6 :) $this->_params = $params->toArray(); jimport('joomla.html.pagination'); //In case we are in a blog view set the limit if ($layout == 'blog') { $pagination = new JPagination($total, $limitstart, $limit - $links); } else { $pagination = new JPagination($total, $limitstart, $limit); } $this->assign('total', $total); $this->assign('action', str_replace('&', '&', $uri->toString())); $this->assignRef('items', $items); $this->assignRef('params', $params); $this->assignRef('category', $category); $this->assignRef('user', $user); $this->assignRef('access', $access); $this->assignRef('pagination', $pagination); parent::display($tpl); } function &getItems() { global $mainframe; //create select lists $user = &JFactory::getUser(); $lists = $this->_buildSortLists(); if (!count( $this->items ) ) { $this->assign('lists', $lists); $return = array(); return $return; } //create paginatiion if ($lists['filter']) { $this->data->link .= '&filter='.urlencode($lists['filter']); } $k = 0; $i = 0; foreach($this->items as $key => $item) { // checks if the item is a public or registered/special item if ($item->access <= $user->get('aid', 0)) { $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid)); $item->readmore_register = false; } else { $item->link = JRoute::_('index.php?option=com_user&task=register'); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false); $fullURL = new JURI($item->link); $fullURL->setVar('return', base64_encode($returnURL)); $item->link = $fullURL->toString(); $item->readmore_register = true; } $item->created = JHTML::_('date', $item->created, $this->params->get('date_format')); $item->odd = $k; $item->count = $i; $this->items[$key] = $item; $k = 1 - $k; $i++; } $this->assign('lists', $lists); return $this->items; } function &getItem($index = 0, &$params) { global $mainframe; // Initialize some variables $user =& JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); $SiteName = $mainframe->getCfg('sitename'); $item =& $this->items[$index]; $item->text = $item->introtext; $category = & $this->get( 'Category' ); $item->category = $category->title; $item->section = $category->sectiontitle; // Get the page/component configuration and article parameters $item->params = clone($params); $aparams = new JParameter($item->attribs); // Merge article parameters into the page configuration $item->params->merge($aparams); // Process the content preparation plugins JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onPrepareContent', array (& $item, & $item->params, 0)); // Build the link and text of the readmore button if (($item->params->get('show_readmore') && @ $item->readmore) || $item->params->get('link_titles')) { // checks if the item is a public or registered/special item if ($item->access <= $user->get('aid', 0)) { //$item->readmore_link = JRoute::_('index.php?view=article&catid='.$this->category->slug.'&id='.$item->slug); $item->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid)); $item->readmore_register = false; } else { $item->readmore_link = JRoute::_('index.php?option=com_user&view=login'); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid),false); $fullURL = new JURI($item->readmore_link); $fullURL->setVar('return', base64_encode($returnURL)); $item->readmore_link = $fullURL->toString(); $item->readmore_register = true; } } $item->event = new stdClass(); $results = $dispatcher->trigger('onAfterDisplayTitle', array (& $item, & $item->params,0)); $item->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeDisplayContent', array (& $item, & $item->params, 0)); $item->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterDisplayContent', array (& $item, & $item->params, 0)); $item->event->afterDisplayContent = trim(implode("\n", $results)); return $item; } function _buildSortLists() { // Table ordering values $filter = JRequest::getString('filter'); global $mainframe; $itemid = JRequest::getInt('id',0) . ':' . JRequest::getInt('Itemid',0); $filter_order = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd'); $lists['task'] = 'category'; $lists['filter'] = $filter; $lists['order'] = $filter_order; $lists['order_Dir'] = $filter_order_Dir; return $lists; } } ?> joomla/joomla/components/com_content/views/category/index.html0000766000000000000000000000005411234314122026144 0ustar adminadministratorsjoomla/joomla/components/com_content/views/category/view.feed.php0000766000000000000000000000465411234314122026546 0ustar adminadministratorsgetParams(); $feedEmail = (@$mainframe->getCfg('feed_email')) ? $mainframe->getCfg('feed_email') : 'author'; $siteEmail = $mainframe->getCfg('mailfrom'); // Get some data from the model JRequest::setVar('limit', $mainframe->getCfg('feed_limit')); $category = & $this->get( 'Category' ); $rows = & $this->get( 'Data' ); $doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id, $category->sectionid)); foreach ( $rows as $row ) { // strip html from feed item title $title = $this->escape( $row->title ); $title = html_entity_decode( $title ); // url link to article // & used instead of & as this is converted by feed creator $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); // strip html from feed item description text $description = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext); $author = $row->created_by_alias ? $row->created_by_alias : $row->author; // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $row->created; $item->category = $row->category; $item->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } else { $item->authorEmail = $row->author_email; } // loads item info into rss array $doc->addItem( $item ); } } } joomla/joomla/components/com_content/views/frontpage/0000777000000000000000000000000011266551240024330 5ustar adminadministratorsjoomla/joomla/components/com_content/views/frontpage/tmpl/0000777000000000000000000000000011266551241025305 5ustar adminadministratorsjoomla/joomla/components/com_content/views/frontpage/tmpl/default.xml0000766000000000000000000000526311234314124027452 0ustar adminadministrators Frontpage Blog Layout FRONTPAGE BLOG LAYOUT DESC joomla/joomla/components/com_content/views/frontpage/tmpl/default.php0000766000000000000000000000747311234314124027446 0ustar adminadministrators params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    params->def('num_leading_articles', 1)) : ?> pagination->limitstart; endif; ?> pagination->limitstart + $this->params->get('num_leading_articles'); $numIntroArticles = $startIntroArticles + $this->params->get('num_intro_articles', 4); if (($numIntroArticles != $startIntroArticles) && ($i < $this->total)) : ?> params->def('num_links', 4) && ($i < $this->total)) : ?> params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) : ?> params->def('show_pagination_results', 1)) : ?>
    pagination->limitstart; $i < ($this->pagination->limitstart + $this->params->get('num_leading_articles')); $i++) : ?> = $this->total) : break; endif; ?>
    item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); ?>
    params->def('multi_column_order',1)) : // order across as before for ($z = 0; $z < $this->params->def('num_columns', 2); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?> params->get('num_intro_articles', 4) / $this->params->get('num_columns')); $cols = ($this->params->get('num_intro_articles', 4) % $this->params->get('num_columns')); ?> params->get('num_intro_articles') ; else : // otherwise, order down columns, like old category blog for ($z = 0; $z < $this->params->get('num_columns'); $z ++) : if ($z > 0) : $divider = " column_separator"; endif; ?>
    params->get('num_columns')) + $z; if ($target < $this->total && $target < ($numIntroArticles)) : $this->item =& $this->getItem($target, $this->params); echo $this->loadTemplate('item'); endif; endfor; ?> params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) : if ($i < $this->total && $i < ($numIntroArticles)) : $this->item =& $this->getItem($i, $this->params); echo $this->loadTemplate('item'); $i ++; endif; endfor; ?>
    links = array_splice($this->items, $i - $this->pagination->limitstart); echo $this->loadTemplate('links'); ?>
    pagination->getPagesLinks(); ?>

    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_content/views/frontpage/tmpl/default_links.php0000766000000000000000000000066111234314124030636 0ustar adminadministrators
    joomla/joomla/components/com_content/views/frontpage/tmpl/default_item.php0000766000000000000000000001316611234314124030460 0ustar adminadministratorsuser->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')); ?> item->state == 0) : ?>
    item->params->get('show_title') || $this->item->params->get('show_pdf_icon') || $this->item->params->get('show_print_icon') || $this->item->params->get('show_email_icon')) : ?> item->params->get('show_title')) : ?> item->params->get('show_pdf_icon')) : ?> item->params->get( 'show_print_icon' )) : ?> item->params->get('show_email_icon')) : ?>
    item->params->get('link_titles') && $this->item->readmore_link != '') : ?> escape($this->item->title); ?> escape($this->item->title); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?> item, $this->item->params, $this->access); ?>
    item->params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?> item->event->beforeDisplayContent; ?> item->params->get('show_section') && $this->item->sectionid) || ($this->item->params->get('show_category') && $this->item->catid)) : ?> item->params->get('show_author')) && ($this->item->author != "")) : ?> item->params->get('show_create_date')) : ?> item->params->get('show_url') && $this->item->urls) : ?> item->modified) != 0 && $this->item->params->get('show_modify_date')) : ?> item->params->get('show_readmore') && $this->item->readmore) : ?>
    item->params->get('show_section') && $this->item->sectionid && isset($this->item->section)) : ?> item->params->get('link_section')) : ?> item->sectionid)).'">'; ?> escape($this->item->section); ?> item->params->get('link_section')) : ?> '; ?> item->params->get('show_category')) : ?> item->params->get('show_category') && $this->item->catid) : ?> item->params->get('link_category')) : ?> item->catslug, $this->item->sectionid)).'">'; ?> escape($this->item->category); ?> item->params->get('link_category')) : ?> '; ?>
    escape($this->item->created_by_alias) ? $this->escape($this->item->created_by_alias) : $this->escape($this->item->author)) ); ?>   
    item->created, JText::_('DATE_FORMAT_LC2')); ?>
    escape($this->item->urls); ?>
    item->toc)) : ?> item->toc; ?> item->text; ?>
    item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
    item->readmore_register) : echo JText::_('Register to read more...'); elseif ($readmore = $this->item->params->get('readmore')) : echo $readmore; else : echo JText::sprintf('Read more...'); endif; ?>
    item->state == 0) : ?>
      item->event->afterDisplayContent; ?> joomla/joomla/components/com_content/views/frontpage/tmpl/index.html0000766000000000000000000000005411234314124027272 0ustar adminadministratorsjoomla/joomla/components/com_content/views/frontpage/metadata.xml0000766000000000000000000000022211234314124026620 0ustar adminadministrators joomla/joomla/components/com_content/views/frontpage/view.html.php0000766000000000000000000001240511234314124026752 0ustar adminadministratorsgetParams(); // parameters $intro = $params->def('num_intro_articles', 4); $leading = $params->def('num_leading_articles', 1); $links = $params->def('num_links', 4); $descrip = $params->def('show_description', 1); $descrip_image = $params->def('show_description_image',1); $params->set('show_intro', 1); $limit = $intro + $leading + $links; JRequest::setVar('limit', (int) $limit); //set data model $items =& $this->get('data' ); $total =& $this->get('total'); // Create a user access object for the user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); //add alternate feed link if($params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', htmlspecialchars_decode($mainframe->getCfg('sitename' ))); } } else { $params->set('page_title', htmlspecialchars_decode($mainframe->getCfg('sitename' ))); } $document->setTitle( $params->get( 'page_title' ) ); jimport('joomla.html.pagination'); $this->pagination = new JPagination($total, $limitstart, $limit - $links); $this->assign('total', $total); $this->assignRef('user', $user); $this->assignRef('access', $access); $this->assignRef('params', $params); $this->assignRef('items', $items); parent::display($tpl); } function &getItem($index = 0, &$params) { global $mainframe; // Initialize some variables $user =& JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); $SiteName = $mainframe->getCfg('sitename'); $task = JRequest::getCmd('task'); $linkOn = null; $linkText = null; $item =& $this->items[$index]; $item->text = $item->introtext; // Get the page/component configuration and article parameters $item->params = clone($params); $aparams = new JParameter($item->attribs); // Merge article parameters into the page configuration $item->params->merge($aparams); // Process the content preparation plugins JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onPrepareContent', array (& $item, & $item->params, 0)); // Build the link and text of the readmore button if (($item->params->get('show_readmore') && @ $item->readmore) || $item->params->get('link_titles')) { // checks if the item is a public or registered/special item if ($item->access <= $user->get('aid', 0)) { $item->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid)); $item->readmore_register = false; } else { $item->readmore_link = JRoute::_("index.php?option=com_user&view=login"); $item->readmore_register = true; } } $item->event = new stdClass(); $results = $dispatcher->trigger('onAfterDisplayTitle', array (& $item, & $item->params,0)); $item->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeDisplayContent', array (& $item, & $item->params, 0)); $item->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterDisplayContent', array (& $item, & $item->params, 0)); $item->event->afterDisplayContent = trim(implode("\n", $results)); return $item; } } joomla/joomla/components/com_content/views/frontpage/index.html0000766000000000000000000000005411234314124026316 0ustar adminadministratorsjoomla/joomla/components/com_content/views/frontpage/view.feed.php0000766000000000000000000000454211234314124026714 0ustar adminadministratorsgetParams(); $feedEmail = (@$mainframe->getCfg('feed_email')) ? $mainframe->getCfg('feed_email') : 'author'; $siteEmail = $mainframe->getCfg('mailfrom'); $document->link = JRoute::_('index.php?option=com_content&view=frontpage'); // Get some data from the model JRequest::setVar('limit', $mainframe->getCfg('feed_limit')); $rows = & $this->get( 'Data' ); foreach ( $rows as $row ) { // strip html from feed item title $title = $this->escape( $row->title ); $title = html_entity_decode( $title ); // url link to article $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); // strip html from feed item description text $description = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext); $author = $row->created_by_alias ? $row->created_by_alias : $row->author; // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $row->created; $item->category = 'frontpage'; $item->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } else { $item->authorEmail = $row->author_email; } // loads item info into rss array $document->addItem( $item ); } } } ?> joomla/joomla/components/com_content/controller.php0000766000000000000000000002264711234314122024105 0ustar adminadministratorsget('id') || (JRequest::getVar('view') == 'category' && JRequest::getVar('layout') != 'blog')) { parent::display(false); } else { parent::display(true); } } /** * Edits an article * * @access public * @since 1.5 */ function edit() { $user =& JFactory::getUser(); // Create a user access object for the user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); // Create the view $view = & $this->getView('article', 'html'); // Get/Create the model $model = & $this->getModel('Article'); // new record if (!($access->canEdit || $access->canEditOwn)) { JError::raiseError( 403, JText::_("ALERTNOTAUTH") ); } if( $model->get('id') > 1 && $user->get('gid') <= 19 && $model->get('created_by') != $user->id ) { JError::raiseError( 403, JText::_("ALERTNOTAUTH") ); } if ( $model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The item'), $model->get('title')); $this->setRedirect(JRoute::_('index.php?view=article&id='.$model->get('id'), false), $msg); return; } //Checkout the article $model->checkout(); // Push the model into the view (as default) $view->setModel($model, true); // Set the layout $view->setLayout('form'); // Display the view $view->display(); } /** * Saves the content item an edit form submit * * @todo */ function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $task = JRequest::getVar('task', null, 'default', 'cmd'); // Make sure you are logged in and have the necessary access rights if ($user->get('gid') < 19) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } // Create a user access object for the user $access = new stdClass(); $access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all'); $access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own'); $access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all'); if (!($access->canEdit || $access->canEditOwn)) { JError::raiseError( 403, JText::_("ALERTNOTAUTH") ); } //get data from the request $model = $this->getModel('article'); //get data from request $post = JRequest::get('post'); $post['text'] = JRequest::getVar('text', '', 'post', 'string', JREQUEST_ALLOWRAW); //preform access checks $isNew = ((int) $post['id'] < 1); if ($model->store($post)) { $msg = JText::_( 'Article Saved' ); if($isNew) { $post['id'] = (int) $model->get('id'); } } else { $msg = JText::_( 'Error Saving Article' ); JError::raiseError( 500, $model->getError() ); } // manage frontpage items //TODO : Move this into a frontpage model require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_frontpage'.DS.'tables'.DS.'frontpage.php'); $fp = new TableFrontPage($db); if (JRequest::getVar('frontpage', false, '', 'boolean')) { // toggles go to first place if (!$fp->load($post['id'])) { // new entry $query = 'INSERT INTO #__content_frontpage' . ' VALUES ( '.(int) $post['id'].', 1 )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->stderr()); } $fp->ordering = 1; } } else { // no frontpage mask if (!$fp->delete($post['id'])) { $msg .= $fp->stderr(); } $fp->ordering = 0; } $fp->reorder(); $model->checkin(); // gets section name of item $query = 'SELECT s.title' . ' FROM #__sections AS s' . ' WHERE s.scope = "content"' . ' AND s.id = ' . (int) $post['sectionid']; $db->setQuery($query); // gets category name of item $section = $db->loadResult(); $query = 'SELECT c.title' . ' FROM #__categories AS c' . ' WHERE c.id = ' . (int) $post['catid']; $db->setQuery($query); $category = $db->loadResult(); if ($isNew) { // messaging for new items require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_messages'.DS.'tables'.DS.'message.php'); // load language for messaging $lang =& JFactory::getLanguage(); $lang->load('com_messages'); $query = 'SELECT id' . ' FROM #__users' . ' WHERE sendEmail = 1'; $db->setQuery($query); $users = $db->loadResultArray(); foreach ($users as $user_id) { $msg = new TableMessage($db); $msg->send($user->get('id'), $user_id, JText::_('New Item'), JText::sprintf('ON_NEW_CONTENT', $user->get('username'), $post['title'], $section, $category)); } } else { // If the article isn't new, then we need to clean the cache so that our changes appear realtime :) $cache = &JFactory::getCache('com_content'); $cache->clean(); } if ($access->canPublish) { // Publishers, admins, etc just get the stock msg $msg = JText::_('Item successfully saved.'); } else { $msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item successfully saved.'); } $referer = JRequest::getString('ret', base64_encode(JURI::base()), 'get'); $referer = base64_decode($referer); if (!JURI::isInternal($referer)) { $referer = ''; } $this->setRedirect($referer, $msg); } /** * Cancels an edit article operation * * @access public * @since 1.5 */ function cancel() { // Initialize some variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); // Get an article table object and bind post variabes to it [We don't need a full model here] $article = & JTable::getInstance('content'); $article->bind(JRequest::get('post')); if ($user->authorize('com_content', 'edit', 'content', 'all') || ($user->authorize('com_content', 'edit', 'content', 'own') && $article->created_by == $user->get('id'))) { $article->checkin(); } // If the task was edit or cancel, we go back to the content item $referer = JRequest::getString('ret', base64_encode(JURI::base()), 'get'); $referer = base64_decode($referer); if (!JURI::isInternal($referer)) { $referer = ''; } $this->setRedirect($referer); } /** * Rates an article * * @access public * @since 1.5 */ function vote() { $url = JRequest::getVar('url', '', 'default', 'string'); $rating = JRequest::getVar('user_rating', 0, '', 'int'); $id = JRequest::getVar('cid', 0, '', 'int'); // Get/Create the model $model = & $this->getModel('Article' ); $model->setId($id); if(!JURI::isInternal($url)) { $url = JRoute::_('index.php?option=com_content&view=article&id='.$id); } if ($model->storeVote($rating)) { $this->setRedirect($url, JText::_('Thanks for rating!')); } else { $this->setRedirect($url, JText::_('You already rated this article today!')); } } /** * Searches for an item by a key parameter * * @access public * @since 1.5 */ function findkey() { // Initialize variables $db = & JFactory::getDBO(); $keyref = JRequest::getVar('keyref', null, 'default', 'cmd'); JRequest::setVar('keyref', $keyref); // If no keyref left, throw 404 if( empty($keyref) === true ) { JError::raiseError( 404, JText::_("Key Not Found") ); } $keyref = $db->Quote( '%keyref='.$db->getEscaped( $keyref, true ).'%', false ); $query = 'SELECT id' . ' FROM #__content' . ' WHERE attribs LIKE '.$keyref; $db->setQuery($query); $id = (int) $db->loadResult(); if ($id > 0) { // Create the view $view =& $this->getView('article', 'html'); // Get/Create the model $model =& $this->getModel('Article' ); // Set the id of the article to display $model->setId($id); // Push the model into the view (as default) $view->setModel($model, true); // Display the view $view->display(); } else { JError::raiseError( 404, JText::_( 'Key Not Found' ) ); } } /** * Output the pagebreak dialog * * @access public * @since 1.5 */ function ins_pagebreak() { // Create the view $view = & $this->getView('article', 'html'); // Set the layout $view->setLayout('pagebreak'); // Display the view $view->display(); } } joomla/joomla/components/com_content/view.php0000766000000000000000000000047611234314124022672 0ustar adminadministratorsjoomla/joomla/components/com_content/models/0000777000000000000000000000000011266551245022476 5ustar adminadministratorsjoomla/joomla/components/com_content/models/frontpage.php0000766000000000000000000001335711234314124025172 0ustar adminadministrators_loadData()) { // Initialize some variables $user =& JFactory::getUser(); // raise errors } return $this->_data; } /** * Method to get the total number of content items for the frontpage * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } /** * Method to load content item data for items in the frontpage * exist. * * @access private * @return boolean True on success */ function _loadData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { // Get the pagination request variables $limit = JRequest::getVar('limit', 0, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $query = $this->_buildQuery(); $Arows = $this->_getList($query, $limitstart, $limit); // special handling required as Uncategorized content does not have a section / category id linkage $i = $limitstart; $rows = array(); foreach ($Arows as $row) { // check to determine if section or category has proper access rights $rows[$i] = $row; $i ++; } $this->_data = $rows; } return true; } function _buildQuery() { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); // Voting is turned on, get voting data as well for the content items $voting = ContentHelperQuery::buildVotingQuery($params); // Get the WHERE and ORDER BY clauses for the query $where = $this->_buildContentWhere(); $orderby = $this->_buildContentOrderBy(); $query = ' SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,' . ' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.attribs, a.urls, a.metakey, a.metadesc, a.access,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'. ' CHAR_LENGTH( a.`fulltext` ) AS readmore,' . ' u.name AS author, u.usertype, g.name AS groups, u.email as author_email, cc.title AS category, s.title AS section, s.ordering AS s_ordering, cc.ordering AS cc_ordering, a.ordering AS a_ordering, f.ordering AS f_ordering'. $voting['select'] . ' FROM #__content AS a' . ' INNER JOIN #__content_frontpage AS f ON f.content_id = a.id' . ' LEFT JOIN #__categories AS cc ON cc.id = a.catid'. ' LEFT JOIN #__sections AS s ON s.id = a.sectionid'. ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id'. $voting['join']. $where .$orderby ; return $query; } function _buildContentOrderBy() { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); if (!is_object($params)) { $params = &JComponentHelper::getParams('com_content'); } $orderby_sec = $params->def('orderby_sec', ''); $orderby_pri = $params->def('orderby_pri', ''); $secondary = ContentHelperQuery::orderbySecondary($orderby_sec); $primary = ContentHelperQuery::orderbyPrimary($orderby_pri); $orderby = ' ORDER BY '.$primary.' '.$secondary; return $orderby; } function _buildContentWhere() { global $mainframe; $user =& JFactory::getUser(); $gid = $user->get('aid', 0); // TODO: Should we be using requestTime here? or is JDate ok? // $now = $mainframe->get('requestTime'); $jnow =& JFactory::getDate(); $now = $jnow->toMySQL(); // Get the page/component configuration $params = &$mainframe->getParams(); $noauth = !$params->get('show_noauth'); $nullDate = $this->_db->getNullDate(); //First thing we need to do is assert that the articles are in the current category $where = ' WHERE 1'; // Does the user have access to view the items? if ($noauth) { $where .= ' AND a.access <= '.(int) $gid; } if ($user->authorize('com_content', 'edit', 'content', 'all')) { $where .= ' AND a.state >= 0'; } else { $where .= ' AND a.state = 1'. ' AND (( cc.published = 1'. ' AND s.published = 1 )'. ' OR ( a.catid = 0 AND a.sectionid = 0 ) )'; $where .= ' AND ( a.publish_up = '.$this->_db->Quote($nullDate).' OR a.publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( a.publish_down = '.$this->_db->Quote($nullDate).' OR a.publish_down >= '.$this->_db->Quote($now).' )'; } return $where; } } joomla/joomla/components/com_content/models/section.php0000766000000000000000000003452011234314124024644 0ustar adminadministratorssetId((int)$id); } /** * Method to set the section id * * @access public * @param int Section ID number */ function setId($id) { // Set new ID and wipe data $this->_id = $id; $this->_data = array(); $this->_total = null; $this->_section = null; $this->_categories = null; } /** * Method to get content item data for the section * * @param int $state The content state to pull from for the current * section * @since 1.5 */ function getData($state = 1) { // Load the Category data if ($this->_loadSection() && $this->_loadData($state)) { // Initialize some variables $user =& JFactory::getUser(); // Make sure the category is published if (!$this->_section->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_section->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_data[$state]; } /** * Method to get the total number of content items for the section * * @access public * @return integer */ function getTotal($state = 1) { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery($state); $this->_total[$state] = $this->_getListCount($query); } return $this->_total[$state]; } /** * Method to get section data for the current section * * @since 1.5 */ function getSection() { // Initialize some variables $user =& JFactory::getUser(); // Load the Category data if ($this->_loadSection()) { // Make sure the category is published if (!$this->_section->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_section->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_section; } /** * Method to get sibling category data for the current category * * @since 1.5 */ function getCategories() { // Initialize some variables $user =& JFactory::getUser(); // Load the Category data if ($this->_loadSection() && $this->_loadCategories()) { // Make sure the category is published if (!$this->_section->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_section->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_categories; } /** * Method to get archived article data for the current section * * @param int $state The content state to pull from for the current section * @since 1.5 */ function getArchives($state = -1) { return $this->getData(-1); } /** * Method to get archived article data for the current section * * @param int $state The content state to pull from for the current section * @since 1.5 */ function getTree() { return $this->_loadTree(); } /** * Method to load section data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadSection() { if (empty($this->_section)) { // Lets get the information for the current section if ($this->_id) { $where = ' WHERE id = '. (int) $this->_id; } else { $where = null; } $query = 'SELECT *' . ' FROM #__sections' . $where; $this->_db->setQuery($query, 0, 1); $this->_section = $this->_db->loadObject(); } return true; } /** * Method to load sibling category data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadCategories() { global $mainframe; // Lets load the siblings if they don't already exist if (empty($this->_categories)) { $user =& JFactory::getUser(); // Get the page/component configuration $params = &$mainframe->getParams(); $noauth = !$params->get('show_noauth'); $gid = $user->get('aid', 0); $now = $mainframe->get('requestTime'); $nullDate = $this->_db->getNullDate(); // Ordering control $orderby = $params->get('orderby', ''); $orderby = ContentHelperQuery::orderbySecondary($orderby); // Handle the access permissions part of the main database query if ($user->authorize('com_content', 'edit', 'content', 'all')) { $xwhere = ''; $xwhere2 = ' AND b.state >= 0'; } else { $xwhere = ' AND a.published = 1'; $xwhere2 = ' AND b.state = 1' . ' AND ( b.publish_up = '.$this->_db->Quote($nullDate).' OR b.publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( b.publish_down = '.$this->_db->Quote($nullDate).' OR b.publish_down >= '.$this->_db->Quote($now).' )'; if ($noauth) { $xwhere2 .= ' AND b.access <= '.(int) $gid; } } // Determine whether to show/hide the empty categories and sections $empty = null; $empty_sec = null; // show/hide empty categories in section if (!$params->get('show_empty_categories')) { $empty_sec = ' HAVING numitems > 0'; } // Handle the access permissions $access_check = null; if ($noauth) { $access_check = ' AND a.access <= '.(int) $gid; //$access_check .= ' AND b.access <= '.(int) $gid; } // Query of categories within section $query = 'SELECT a.*, COUNT( b.id ) AS numitems,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'. ' FROM #__categories AS a' . ' LEFT JOIN #__content AS b ON b.catid = a.id'. $xwhere2 . ' WHERE a.section = '.(int) $this->_id. $xwhere. $access_check . ' GROUP BY a.id'.$empty.$empty_sec . ' ORDER BY '. $orderby; $this->_db->setQuery($query); $this->_categories = $this->_db->loadObjectList(); } return true; } /** * Method to load content item data for items in the category if they don't * exist. * * @access private * @return boolean True on success */ function _loadData($state = 1) { if (empty($this->_section)) { return false; // TODO: set error -- can't get siblings when we don't know the category } // Lets load the content if it doesn't already exist if (empty($this->_data[$state])) { // Get the pagination request variables $limit = JRequest::getVar('limit', 0, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $query = $this->_buildQuery(); $Arows = $this->_getList($query, $limitstart, $limit); // special handling required as Uncategorized content does not have a section / category id linkage $i = $limitstart; $rows = array(); foreach ($Arows as $row) { // check to determine if section or category has proper access rights $rows[$i] = $row; $i ++; } $this->_data[$state] = $rows; } return true; } /** * Method to load content item data for items in the category if they don't * exist. * * @access private * @return boolean True on success */ function _loadTree() { global $mainframe; // Lets load the content if it doesn't already exist if (empty($this->_tree)) { $user =& JFactory::getUser(); $aid = $user->get('aid', 0); $now = $mainframe->get('requestTime'); $nullDate = $this->_db->getNullDate(); // Get the information for the current section if ($this->_id) { $and = ' AND a.section = '.(int) $this->_id; } else { $and = null; } // Query of categories within section $query = 'SELECT a.name AS catname, a.title AS cattitle, b.* ' . ' FROM #__categories AS a' . ' INNER JOIN #__content AS b ON b.catid = a.id' . ' AND b.state = 1' . ' AND ( b.publish_up = '.$this->_db->Quote($nullDate).' OR b.publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( b.publish_down = '.$this->_db->Quote($nullDate).' OR b.publish_down >= '.$this->_db->Quote($now).' )'; ' WHERE a.published = 1' . $and . ' AND a.access <= '.(int) $aid . ' ORDER BY a.catid, a.ordering, b.ordering'; $this->_db->setQuery($query); $this->_tree = $this->_db->loadObjectList(); } return true; } function _buildQuery($state = 1) { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); // If voting is turned on, get voting data as well for the content items $voting = ContentHelperQuery::buildVotingQuery($params); // Get the WHERE and ORDER BY clauses for the query $where = $this->_buildContentWhere($state); $orderby = $this->_buildContentOrderBy($state); $query = 'SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,' . ' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.attribs, a.hits, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'. ' CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, cc.title AS category, g.name AS groups, u.email as author_email'.$voting['select'] . ' FROM #__content AS a' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' LEFT JOIN #__sections AS s ON s.id = a.sectionid' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id'. $voting['join']. $where. $orderby; return $query; } function _buildContentOrderBy($state = 1) { $filter_order = JRequest::getCmd('filter_order'); $filter_order_Dir = JRequest::getWord('filter_order_Dir'); $orderby = ' ORDER BY '; if ($filter_order && $filter_order_Dir) { $orderby .= $filter_order .' '. $filter_order_Dir.', '; } // Get the page/component configuration $app =& JFactory::getApplication(); $params =& $app->getParams(); switch ($state) { case -1: // Special ordering for archive articles $orderby_sec = $params->def('orderby', 'rdate'); $secondary = ContentHelperQuery::orderbySecondary($orderby_sec); $primary = ''; break; case 1: default: $orderby_sec = $params->def('orderby_sec', 'rdate'); $orderby_sec = ($orderby_sec == 'front') ? '' : $orderby_sec; $orderby_pri = $params->def('orderby_pri', ''); $secondary = ContentHelperQuery::orderbySecondary($orderby_sec); $primary = ContentHelperQuery::orderbyPrimary($orderby_pri); break; } $orderby .= "$primary $secondary"; return $orderby; } function _buildContentWhere($state = 1) { global $mainframe; $user =& JFactory::getUser(); $aid = $user->get('aid', 0); $jnow =& JFactory::getDate(); $now = $jnow->toMySQL(); // Get the page/component configuration $params = &$mainframe->getParams(); $noauth = !$params->get('show_noauth'); $nullDate = $this->_db->getNullDate(); // First thing we need to do is assert that the articles are in the current category if ($noauth) { $where = ' WHERE a.access <= '.(int) $aid; } else { $where = ' WHERE 1'; } if ($this->_id) { $where .= ' AND s.id = '.(int)$this->_id; } $where .= ' AND s.access <= '.(int) $aid; $where .= ' AND cc.access <= '.(int) $aid; $where .= ' AND s.published = 1'; $where .= ' AND cc.published = 1'; // Regular Published Content switch ($state) { case 1: if ($user->authorize('com_content', 'edit', 'content', 'all')) { $where .= ' AND a.state >= 0'; } else { $where .= ' AND a.state = 1' . ' AND ( publish_up = '.$this->_db->Quote($nullDate).' OR publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( publish_down = '.$this->_db->Quote($nullDate).' OR publish_down >= '.$this->_db->Quote($now).' )'; } break; // Archive Content case -1: // Get some request vars specific to this state $year = JRequest::getInt( 'year', date('Y') ); $month = JRequest::getInt( 'month', date('m') ); $where .= ' AND a.state = -1'; $where .= ' AND YEAR( a.created ) = '.(int) $year; $where .= ' AND MONTH( a.created ) = '.(int) $month; break; default: $where .= ' AND a.state = '.(int) $state; break; } /* * If we have a filter, and this is enabled... lets tack the AND clause * for the filter onto the WHERE clause of the content item query. */ if ($params->get('filter')) { $filter = JRequest::getString('filter', '', 'request'); if ($filter) { // clean filter variable $filter = JString::strtolower($filter); $filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false ); switch ($params->get('filter_type')) { case 'title' : $where .= ' AND LOWER( a.title ) LIKE '.$filter; break; case 'author' : $where .= ' AND ( ( LOWER( u.name ) LIKE '.$filter.' ) OR ( LOWER( a.created_by_alias ) LIKE '.$filter.' ) )'; break; case 'hits' : $where .= ' AND a.hits LIKE '.$filter; break; } } } return $where; } } ?> joomla/joomla/components/com_content/models/archive.php0000766000000000000000000001346111234314124024622 0ustar adminadministrators_data)) { // Get the page/component configuration $params = &$mainframe->getParams(); // Get the pagination request variables $limit = JRequest::getVar('limit', $params->get('display_num', 20), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $limitstart, $limit); } return $this->_data; } /** * Method to get the total number of content items for the frontpage * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } // JModel override to add alternating value for $odd function &_getList( $query, $limitstart=0, $limit=0 ) { $result =& parent::_getList($query, $limitstart, $limit); $odd = 1; foreach ($result as $k => $row) { $result[$k]->odd = $odd; $odd = 1 - $odd; } return $result; } function _buildQuery() { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); // If voting is turned on, get voting data as well for the content items $voting = ContentHelperQuery::buildVotingQuery($params); // Get the WHERE and ORDER BY clauses for the query $where = $this->_buildContentWhere(); $orderby = $this->_buildContentOrderBy(); $query = 'SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,'. ' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.attribs, a.hits, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access, cc.title AS category, s.title AS section,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'. ' CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups'.$voting['select'] . ' FROM #__content AS a' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' LEFT JOIN #__sections AS s ON s.id = a.sectionid' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id'. $voting['join']. $where. $orderby; return $query; } function _buildContentOrderBy() { $filter_order = JRequest::getCmd('filter_order'); $filter_order_Dir = JRequest::getWord('filter_order_Dir'); $orderby = ' ORDER BY '; if ($filter_order && $filter_order_Dir) { $orderby .= $filter_order.' '.$filter_order_Dir.', '; } // Get the page/component configuration $params = $this->getState('parameters.menu'); if (!is_object($params)) { $params = &JComponentHelper::getParams('com_content'); } // Special ordering for archive articles $orderby_sec = $params->def('orderby', 'rdate'); $primary = ContentHelperQuery::orderbySecondary($orderby_sec); $orderby .= $primary; return $orderby; } function _buildContentWhere() { global $mainframe; // Initialize some variables $user =& JFactory::getUser(); $db =& JFactory::getDBO(); $aid = (int) $user->get('aid', 0); // First thing we need to do is build the access section of the clause $where = ' WHERE a.access <= '.$aid; $where .= ' AND s.access <= '.$aid; $where .= ' AND cc.access <= '.$aid; $where .= ' AND s.published = 1'; $where .= ' AND cc.published = 1'; $where .= ' AND a.state = \'-1\''; $year = JRequest::getInt( 'year' ); if ($year) { $where .= ' AND YEAR( a.created ) = \''.$year.'\''; } $month = JRequest::getInt( 'month' ); if ($month) { $where .= ' AND MONTH( a.created ) = \''.$month.'\''; } /* * If we have a filter... lets tack the AND clause * for the filter onto the WHERE clause of the archive query. */ $filter = JRequest::getString('filter', '', 'post'); if ($filter) { // clean filter variable $filter = JString::strtolower($filter); $filter = $db->Quote( '%'.$db->getEscaped( $filter, true ).'%', false ); // Get the page/component configuration $params = &$mainframe->getParams(); switch ($params->get('filter_type', 'title')) { case 'title' : default : $where .= ' AND LOWER( a.title ) LIKE '.$filter; break; case 'author' : $where .= ' AND ( ( LOWER( u.name ) LIKE '.$filter.' ) OR ( LOWER( a.created_by_alias ) LIKE '.$filter.' ) )'; break; case 'hits' : $where .= ' AND a.hits LIKE '.$filter; break; } } return $where; } } joomla/joomla/components/com_content/models/article.php0000766000000000000000000003724711234314124024634 0ustar adminadministratorssetId((int)$id); } /** * Method to set the article id * * @access public * @param int Article ID number */ function setId($id) { // Set new article ID and wipe data $this->_id = $id; $this->_article = null; } /** * Overridden set method to pass properties on to the article * * @access public * @param string $property The name of the property * @param mixed $value The value of the property to set * @return boolean True on success * @since 1.5 */ function set( $property, $value=null ) { if ($this->_loadArticle()) { $this->_article->$property = $value; return true; } else { return false; } } /** * Overridden get method to get properties from the article * * @access public * @param string $property The name of the property * @param mixed $value The value of the property to set * @return mixed The value of the property * @since 1.5 */ function get($property, $default=null) { if ($this->_loadArticle()) { if(isset($this->_article->$property)) { return $this->_article->$property; } } return $default; } /** * Method to get content article data for the frontpage * * @since 1.5 */ function &getArticle() { // Load the Category data if ($this->_loadArticle()) { $user = & JFactory::getUser(); // Is the category published? if (!$this->_article->cat_pub && $this->_article->catid) { JError::raiseError( 404, JText::_("Article category not published") ); } // Is the section published? if ($this->_article->sectionid) { if ($this->_article->sec_pub === null) { // probably a new item // check the sectionid probably passed in the request $db =& $this->getDBO(); $query = 'SELECT published' . ' FROM #__sections' . ' WHERE id = ' . (int) $this->_article->sectionid; $db->setQuery( $query ); $this->_article->sec_pub = $db->loadResult(); } if (!$this->_article->sec_pub) { JError::raiseError( 404, JText::_("Article section not published") ); } } // Do we have access to the category? if (($this->_article->cat_access > $user->get('aid', 0)) && $this->_article->catid) { JError::raiseError( 403, JText::_("ALERTNOTAUTH") ); } // Do we have access to the section? if (($this->_article->sec_access > $user->get('aid', 0)) && $this->_article->sectionid) { JError::raiseError( 403, JText::_("ALERTNOTAUTH") ); } $this->_loadArticleParams(); } else { $user =& JFactory::getUser(); $article =& JTable::getInstance('content'); $article->state = 1; $article->cat_pub = null; $article->sec_pub = null; $article->cat_access = null; $article->sec_access = null; $article->author = null; $article->created_by = $user->get('id'); $article->parameters = new JParameter( '' ); $article->text = ''; $this->_article = $article; } return $this->_article; } /** * Method to increment the hit counter for the article * * @access public * @return boolean True on success * @since 1.5 */ function hit() { global $mainframe; if ($this->_id) { $article = & JTable::getInstance('content'); $article->hit($this->_id); return true; } return false; } /** * Tests if article is checked out * * @access public * @param int A user id * @return boolean True if checked out * @since 1.5 */ function isCheckedOut( $uid=0 ) { if ($this->_loadArticle()) { if ($uid) { return ($this->_article->checked_out && $this->_article->checked_out != $uid); } else { return $this->_article->checked_out; } } elseif ($this->_id < 1) { return false; } else { JError::raiseWarning( 0, 'Unable to Load Data'); return false; } } /** * Method to checkin/unlock the article * * @access public * @return boolean True on success * @since 1.5 */ function checkin() { if ($this->_id) { $article = & JTable::getInstance('content'); return $article->checkin($this->_id); } return false; } /** * Method to checkout/lock the article * * @access public * @param int $uid User ID of the user checking the article out * @return boolean True on success * @since 1.5 */ function checkout($uid = null) { if ($this->_id) { // Make sure we have a user id to checkout the article with if (is_null($uid)) { $user =& JFactory::getUser(); $uid = $user->get('id'); } // Lets get to it and checkout the thing... $article = & JTable::getInstance('content'); return $article->checkout($uid, $this->_id); } return false; } /** * Method to store the article * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { global $mainframe; $article =& JTable::getInstance('content'); $user =& JFactory::getUser(); $dispatcher =& JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); // Bind the form fields to the web link table if (!$article->bind($data, "published")) { $this->setError($this->_db->getErrorMsg()); return false; } // sanitise id field $article->id = (int) $article->id; $isNew = ($article->id < 1); if ($isNew) { $article->created = gmdate('Y-m-d H:i:s'); $article->created_by = $user->get('id'); } else { $article->modified = gmdate('Y-m-d H:i:s'); $article->modified_by = $user->get('id'); } // Append time if not added to publish date if (strlen(trim($article->publish_up)) <= 10) { $article->publish_up .= ' 00:00:00'; } $date =& JFactory::getDate($article->publish_up, $mainframe->getCfg('offset')); $article->publish_up = $date->toMySQL(); // Handle never unpublish date if (trim($article->publish_down) == JText::_('Never') || trim( $article->publish_down ) == '') { $article->publish_down = $this->_db->getNullDate();; } else { if (strlen(trim( $article->publish_down )) <= 10) { $article->publish_down .= ' 00:00:00'; } $date =& JFactory::getDate($article->publish_down, $mainframe->getCfg('offset')); $article->publish_down = $date->toMySQL(); } $article->title = trim( $article->title ); // Publishing state hardening for Authors if (!$user->authorize('com_content', 'publish', 'content', 'all')) { if ($isNew) { // For new items - author is not allowed to publish - prevent them from doing so $article->state = 0; } else { // For existing items keep existing state - author is not allowed to change status $query = 'SELECT state' . ' FROM #__content' . ' WHERE id = '.(int) $article->id; $this->_db->setQuery($query); $state = $this->_db->loadResult(); if ($state) { $article->state = 1; } else { $article->state = 0; } } } // Search for the {readmore} tag and split the text up accordingly. $text = str_replace('
    ', '
    ', $data['text']); $pattern = '##i'; $tagPos = preg_match($pattern, $text); if ($tagPos == 0) { $article->introtext = $text; } else { list($article->introtext, $article->fulltext) = preg_split($pattern, $text, 2); } // Filter settings jimport( 'joomla.application.component.helper' ); $config = JComponentHelper::getParams( 'com_content' ); $user = &JFactory::getUser(); $gid = $user->get( 'gid' ); $filterGroups = $config->get( 'filter_groups' ); // convert to array if one group selected if ( (!is_array($filterGroups) && (int) $filterGroups > 0) ) { $filterGroups = array($filterGroups); } if (is_array($filterGroups) && in_array( $gid, $filterGroups )) { $filterType = $config->get( 'filter_type' ); $filterTags = preg_split( '#[,\s]+#', trim( $config->get( 'filter_tags' ) ) ); $filterAttrs = preg_split( '#[,\s]+#', trim( $config->get( 'filter_attritbutes' ) ) ); switch ($filterType) { case 'NH': $filter = new JFilterInput(); break; case 'WL': $filter = new JFilterInput( $filterTags, $filterAttrs, 0, 0 ); break; case 'BL': default: $filter = new JFilterInput( $filterTags, $filterAttrs, 1, 1 ); break; } $article->introtext = $filter->clean( $article->introtext ); $article->fulltext = $filter->clean( $article->fulltext ); } elseif(empty($filterGroups)) { $filter = new JFilterInput(array(), array(), 1, 1); $article->introtext = $filter->clean( $article->introtext ); $article->fulltext = $filter->clean( $article->fulltext ); } // Make sure the article table is valid if (!$article->check()) { $this->setError($article->getError()); return false; } $article->version++; //Trigger OnBeforeContentSave $result = $dispatcher->trigger('onBeforeContentSave', array(&$article, $isNew)); if(in_array(false, $result, true)) { $this->setError($article->getError()); return false; } // Store the article table to the database if (!$article->store()) { $this->setError($this->_db->getErrorMsg()); return false; } if ($isNew) { $this->_id = $article->_db->insertId(); } $article->reorder("catid = " . (int) $data['catid']); //Trigger OnAfterContentSave $dispatcher->trigger('onAfterContentSave', array(&$article, $isNew)); $this->_article =& $article; return true; } /** * Method to store a user rating for a content article * * @access public * @param int $rating Article rating [ 1 - 5 ] * @return boolean True on success * @since 1.5 */ function storeVote($rate) { if ( $rate >= 1 && $rate <= 5) { $userIP = $_SERVER['REMOTE_ADDR']; $query = 'SELECT *' . ' FROM #__content_rating' . ' WHERE content_id = '.(int) $this->_id; $this->_db->setQuery($query); $rating = $this->_db->loadObject(); if (!$rating) { // There are no ratings yet, so lets insert our rating $query = 'INSERT INTO #__content_rating ( content_id, lastip, rating_sum, rating_count )' . ' VALUES ( '.(int) $this->_id.', '.$this->_db->Quote($userIP).', '.(int) $rate.', 1 )'; $this->_db->setQuery($query); if (!$this->_db->query()) { JError::raiseError( 500, $this->_db->stderr()); } } else { if ($userIP != ($rating->lastip)) { // We weren't the last voter so lets add our vote to the ratings totals for the article $query = 'UPDATE #__content_rating' . ' SET rating_count = rating_count + 1, rating_sum = rating_sum + '.(int) $rate.', lastip = '.$this->_db->Quote($userIP) . ' WHERE content_id = '.(int) $this->_id; $this->_db->setQuery($query); if (!$this->_db->query()) { JError::raiseError( 500, $this->_db->stderr()); } } else { return false; } } return true; } JError::raiseWarning( 'SOME_ERROR_CODE', 'Article Rating:: Invalid Rating:' .$rate, "JModelArticle::storeVote($rate)"); return false; } /** * Method to load content article data * * @access private * @return boolean True on success * @since 1.5 */ function _loadArticle() { global $mainframe; if($this->_id == '0') { return false; } // Load the content if it doesn't already exist if (empty($this->_article)) { // Get the page/component configuration $params = &$mainframe->getParams(); // If voting is turned on, get voting data as well for the article $voting = ContentHelperQuery::buildVotingQuery($params); // Get the WHERE clause $where = $this->_buildContentWhere(); $query = 'SELECT a.*, u.name AS author, u.usertype, cc.title AS category, s.title AS section,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'. ' g.name AS groups, s.published AS sec_pub, cc.published AS cat_pub, s.access AS sec_access, cc.access AS cat_access '.$voting['select']. ' FROM #__content AS a' . ' LEFT JOIN #__categories AS cc ON cc.id = a.catid' . ' LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = "content"' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id'. $voting['join']. $where; $this->_db->setQuery($query); $this->_article = $this->_db->loadObject(); if ( ! $this->_article ) { return false; } if($this->_article->publish_down == $this->_db->getNullDate()) { $this->_article->publish_down = JText::_('Never'); } // These attributes need to be defined in order for the voting plugin to work if ( count($voting) && ! isset($this->_article->rating_count) ) { $this->_article->rating_count = 0; $this->_article->rating = 0; } return true; } return true; } /** * Method to load content article parameters * * @access private * @return void * @since 1.5 */ function _loadArticleParams() { global $mainframe; // Get the page/component configuration $params = clone($mainframe->getParams('com_content')); // Merge article parameters into the page configuration $aparams = new JParameter($this->_article->attribs); $params->merge($aparams); // Set the popup configuration option based on the request $pop = JRequest::getVar('pop', 0, '', 'int'); $params->set('popup', $pop); // Are we showing introtext with the article if (!$params->get('show_intro') && !empty($this->_article->fulltext)) { $this->_article->text = $this->_article->fulltext; } else { $this->_article->text = $this->_article->introtext . chr(13).chr(13) . $this->_article->fulltext; } // Set the article object's parameters $this->_article->parameters = & $params; } /** * Method to build the WHERE clause of the query to select a content article * * @access private * @return string WHERE clause * @since 1.5 */ function _buildContentWhere() { global $mainframe; $user =& JFactory::getUser(); $aid = (int) $user->get('aid', 0); $jnow =& JFactory::getDate(); $now = $jnow->toMySQL(); $nullDate = $this->_db->getNullDate(); /* * First thing we need to do is assert that the content article is the one * we are looking for and we have access to it. */ $where = ' WHERE a.id = '. (int) $this->_id; // $where .= ' AND a.access <= '. (int) $aid; if (!$user->authorize('com_content', 'edit', 'content', 'all')) { $where .= ' AND ( '; $where .= ' ( a.created_by = ' . (int) $user->id . ' ) '; $where .= ' OR '; $where .= ' ( a.state = 1' . ' AND ( a.publish_up = '.$this->_db->Quote($nullDate).' OR a.publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( a.publish_down = '.$this->_db->Quote($nullDate).' OR a.publish_down >= '.$this->_db->Quote($now).' )'; $where .= ' ) '; $where .= ' OR '; $where .= ' ( a.state = -1 ) '; $where .= ' ) '; } return $where; } } joomla/joomla/components/com_content/models/category.php0000766000000000000000000003250311234314124025014 0ustar adminadministratorssetId((int)$id); // here we initialize defaults for category model $params = &$mainframe->getParams(); $params->def('filter', 1); $params->def('filter_type', 'title'); } /** * Method to set the category id * * @access public * @param int Category ID number */ function setId($id) { // Set category ID and wipe data $this->_id = $id; $this->_category = null; $this->_siblings = null; $this->_data = array(); $this->_total = null; } /** * Method to get content item data for the current category * * @param int $state The content state to pull from for the current * category * @since 1.5 */ function getData($state = 1) { // Load the Category data if ($this->_loadCategory() && $this->_loadData($state)) { // Initialize some variables $user =& JFactory::getUser(); // Make sure the category is published if (!$this->_category->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_category->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_data[$state]; } /** * Method to get the total number of content items for the frontpage * * @access public * @return integer */ function getTotal($state = 1) { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery($state); $this->_total[$state] = $this->_getListCount($query); } return $this->_total[$state]; } /** * Method to get category data for the current category * * @since 1.5 */ function getCategory() { // Load the Category data if ($this->_loadCategory()) { // Initialize some variables $user = &JFactory::getUser(); // Make sure the category is published if (!$this->_category->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_category->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_category; } /** * Method to get sibling category data for the current category * * @since 1.5 */ function getSiblings() { // Initialize some variables $user =& JFactory::getUser(); // Load the Category data if ($this->_loadCategory() && $this->_loadSiblings()) { // Make sure the category is published if (!$this->_category->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_category->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_siblings; } /** * Method to get archived article data for the current category * * @param int $state The content state to pull from for the current section * @since 1.5 */ function getArchives($state = -1) { return $this->getContent(-1); } /** * Method to load category data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadCategory() { if (empty($this->_category)) { // Lets get the information for the current category $query = 'SELECT c.*, s.id as sectionid, s.title as sectiontitle,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug'. ' FROM #__categories AS c' . ' INNER JOIN #__sections AS s ON s.id = c.section' . ' WHERE c.id = '. (int) $this->_id; $this->_db->setQuery($query, 0, 1); $this->_category = $this->_db->loadObject(); } return true; } /** * Method to load sibling category data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadSiblings() { global $mainframe; if (empty($this->_category)) { return false; // TODO: set error -- can't get siblings when we don't know the category } // Lets load the siblings if they don't already exist if (empty($this->_siblings)) { $user =& JFactory::getUser(); // Get the page/component configuration $params = &$mainframe->getParams(); $noauth = !$params->get('show_noauth'); $gid = (int) $user->get('aid', 0); $now = $mainframe->get('requestTime'); $nullDate = $this->_db->getNullDate(); $section = $this->_category->section; // Get the parameters of the active menu item $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $menu->getParams($item->id); if ($user->authorize('com_content', 'edit', 'content', 'all')) { $xwhere = ''; $xwhere2 = ' AND b.state >= 0'; } else { $xwhere = ' AND c.published = 1'; $xwhere2 = ' AND b.state = 1' . ' AND ( publish_up = '.$this->_db->Quote($nullDate).' OR publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( publish_down = '.$this->_db->Quote($nullDate).' OR publish_down >= '.$this->_db->Quote($now).' )'; } // show/hide empty categories $empty = null; if (!$params->get('empty_cat')) { $empty = ' HAVING COUNT( b.id ) > 0'; } // Get the list of sibling categories [categories with the same parent] $query = 'SELECT c.*, COUNT( b.id ) AS numitems' . ' FROM #__categories AS c' . ' LEFT JOIN #__content AS b ON b.catid = c.id '. $xwhere2. ($noauth ? ' AND b.access <= '. (int) $gid : '') . ' WHERE c.section = '. $this->_db->Quote($section). $xwhere. ($noauth ? ' AND c.access <= '. (int) $gid : ''). ' GROUP BY c.id'.$empty. ' ORDER BY c.ordering'; $this->_db->setQuery($query); $this->_siblings = $this->_db->loadObjectList(); } return true; } /** * Method to load content item data for items in the category if they don't * exist. * * @access private * @return boolean True on success */ function _loadData($state = 1) { if (empty($this->_category)) { return false; // TODO: set error -- can't get siblings when we don't know the category } // Lets load the siblings if they don't already exist if (empty($this->_content[$state])) { // Get the pagination request variables $limit = JRequest::getVar('limit', 0, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $query = $this->_buildQuery(); $Arows = $this->_getList($query, $limitstart, $limit); // special handling required as Uncategorized content does not have a section / category id linkage $i = $limitstart; $rows = array(); foreach ($Arows as $row) { // check to determine if section or category has proper access rights $rows[$i] = $row; $i ++; } $this->_data[$state] = $rows; } return true; } function _buildQuery($state = 1) { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); // If voting is turned on, get voting data as well for the content items $voting = ContentHelperQuery::buildVotingQuery($params); // Get the WHERE and ORDER BY clauses for the query $where = $this->_buildContentWhere($state); $orderby = $this->_buildContentOrderBy($state); $query = 'SELECT cc.title AS category, a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,' . ' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.attribs, a.hits, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'. ' CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups, u.email as author_email'.$voting['select'] . ' FROM #__content AS a' . ' LEFT JOIN #__categories AS cc ON a.catid = cc.id' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' LEFT JOIN #__groups AS g ON a.access = g.id'. $voting['join']. $where. $orderby; return $query; } function _buildContentOrderBy($state = 1) { global $mainframe; // Get the page/component configuration $params = &$mainframe->getParams(); $itemid = JRequest::getInt('id', 0) . ':' . JRequest::getInt('Itemid', 0); $filter_order = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd'); $orderby = ' ORDER BY '; if ($filter_order && $filter_order_Dir) { $orderby .= $filter_order .' '. $filter_order_Dir.', '; } if ($filter_order == 'author') { $orderby .= 'created_by_alias '. $filter_order_Dir.', '; } switch ($state) { case -1: // Special ordering for archive articles $orderby_sec = $params->def('orderby', 'rdate'); $secondary = ContentHelperQuery::orderbySecondary($orderby_sec).', '; $primary = ''; break; case 1: default: $orderby_sec = $params->def('orderby_sec', 'rdate'); $orderby_sec = ($orderby_sec == 'front') ? '' : $orderby_sec; $orderby_pri = $params->def('orderby_pri', ''); $secondary = ContentHelperQuery::orderbySecondary($orderby_sec).', '; $primary = ContentHelperQuery::orderbyPrimary($orderby_pri); break; } $orderby .= $primary .' '. $secondary .' a.created DESC'; return $orderby; } function _buildContentWhere($state = 1) { global $mainframe; $user =& JFactory::getUser(); $gid = $user->get('aid', 0); $jnow =& JFactory::getDate(); $now = $jnow->toMySQL(); // Get the page/component configuration $params = &$mainframe->getParams(); $noauth = !$params->get('show_noauth'); $nullDate = $this->_db->getNullDate(); $where = ' WHERE 1'; // Does the user have access to view the items? if ($noauth) { $where .= ' AND a.access <= '.(int) $gid; } // First thing we need to do is assert that the articles are in the current category if ($this->_id) { $where .= ' AND a.catid = '.(int) $this->_id; } // Regular Published Content switch ($state) { case 1: if ($user->authorize('com_content', 'edit', 'content', 'all')) { $where .= ' AND a.state >= 0'; } else { $where .= ' AND a.state = 1' . ' AND ( publish_up = '.$this->_db->Quote($nullDate).' OR publish_up <= '.$this->_db->Quote($now).' )' . ' AND ( publish_down = '.$this->_db->Quote($nullDate).' OR publish_down >= '.$this->_db->Quote($now).' )'; } break; // Archive Content case -1: // Get some request vars specific to this state $year = JRequest::getInt( 'year', date('Y') ); $month = JRequest::getInt( 'month', date('m') ); $where .= ' AND a.state = -1'; $where .= ' AND YEAR( a.created ) = '.(int) $year; $where .= ' AND MONTH( a.created ) = '.(int) $month; break; default: $where .= ' AND a.state = '.(int) $state; break; } /* * If we have a filter, and this is enabled... lets tack the AND clause * for the filter onto the WHERE clause of the content item query. */ if ($params->get('filter')) { $filter = JRequest::getString('filter', '', 'request'); if ($filter) { // clean filter variable $filter = JString::strtolower($filter); $hitsFilter = intval($filter); $filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false ); switch ($params->get('filter_type')) { case 'author' : $where .= ' AND ( ( LOWER( u.name ) LIKE '.$filter.' ) OR ( LOWER( a.created_by_alias ) LIKE '.$filter.' ) )'; break; case 'hits' : $where .= ' AND a.hits >= '.$hitsFilter. ' '; break; case 'title' : default : // default to 'title' if parameter is not valid $where .= ' AND LOWER( a.title ) LIKE '.$filter; break; } } } return $where; } } joomla/joomla/components/com_content/models/index.html0000766000000000000000000000005411234314124024457 0ustar adminadministratorsjoomla/joomla/components/com_contact/0000777000000000000000000000000011266551250021170 5ustar adminadministratorsjoomla/joomla/components/com_contact/router.php0000766000000000000000000001506311234314130023214 0ustar adminadministratorsgetItems('componentid', $component->id); } // Break up the contact id into numeric and alias values. if (isset($query['id']) && strpos($query['id'], ':')) { list($query['id'], $query['alias']) = explode(':', $query['id'], 2); } // Break up the category id into numeric and alias values. if (isset($query['catid']) && strpos($query['catid'], ':')) { list($query['catid'], $query['catalias']) = explode(':', $query['catid'], 2); } // Search for an appropriate menu item. if (is_array($items)) { // If only the option and itemid are specified in the query, return that item. if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) { $itemid = (int) $query['Itemid']; } // Search for a specific link based on the critera given. if (!$itemid) { foreach ($items as $item) { if (isset($item->id) && isset($query['Itemid']) && $item->id != $query['Itemid']) { continue; } // Check if this menu item links to this view. if (isset($item->query['view']) && $item->query['view'] == 'contact' && isset($query['view']) && $query['view'] == 'contact' && isset($item->query['id']) && $item->query['id'] == $query['id']) { $itemid = $item->id; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($query['view']) && $query['view'] == 'category' && isset($item->query['catid']) && $item->query['catid'] == $query['catid']) { $itemid = $item->id; } } } // If no specific link has been found, search for a general one. if (!$itemid) { foreach ($items as $item) { if (isset($item->id) && isset($query['Itemid']) && $item->id != $query['Itemid']) { continue; } if (isset($query['view']) && $query['view'] == 'contact' && isset($item->query['view']) && $item->query['view'] == 'category') { // Check for an undealt with contact id. if (isset($query['id'])) { // This menu item links to the contact view but we need to append the contact id to it. $itemid = $item->id; $segments[] = isset($query['catalias']) ? $query['catid'].':'.$query['catalias'] : $query['catid']; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } elseif (isset($query['view']) && $query['view'] == 'category' && isset($item->query['view']) && $item->query['view'] == 'category' && isset($item->query['id']) && $item->query['id'] != $query['id']) { // Check for an undealt with category id. if (isset($query['catid'])) { // This menu item links to the category view but we need to append the category id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } } } // Check if the router found an appropriate itemid. if (!$itemid) { // Check if a catid was specified. if (isset($query['catid'])) { if (isset($query['catalias'])) { $query['catid'] .= ':'.$query['catalias']; } $segments[] = $query['catid']; unset($query['view']); unset($query['catid']); unset($query['catalias']); } // Check if a id was specified. if (isset($query['id'])) { if (isset($query['alias'])) { $query['id'] .= ':'.$query['alias']; } // Push the id onto the stack. $segments[] = $query['id']; unset($query['view']); unset($query['id']); unset($query['alias']); } } else { $query['Itemid'] = $itemid; // Remove the unnecessary URL segments. unset($query['view']); unset($query['id']); unset($query['alias']); unset($query['catid']); unset($query['catalias']); } return $segments; } function ContactParseRoute($segments) { $vars = array(); // Get the active menu item. $menu = &JSite::getMenu(); $item = &$menu->getActive(); // Check if we have a valid menu item. if (is_object($item)) { // Proceed through the possible variations trying to match the most specific one. if (isset($item->query['view']) && $item->query['view'] == 'contact' && isset($segments[0])) { // Break up the contact id into numeric and alias values. if (isset($segments[1]) && strpos($segments[1], ':')) { list($id, $alias) = explode(':', $segments[1], 2); } // Contact view. $vars['view'] = 'contact'; $vars['id'] = $id; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && count($segments) == 2) { // Break up the category id into numeric and alias values. if (isset($segments[0]) && strpos($segments[0], ':')) { list($catid, $catalias) = explode(':', $segments[0], 2); } // Break up the contact id into numeric and alias values. if (isset($segments[1]) && strpos($segments[1], ':')) { list($id, $alias) = explode(':', $segments[1], 2); } // Contact view. $vars['view'] = 'contact'; $vars['id'] = $id; $vars['catid'] = $catid; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($segments[0])) { // Break up the category id into numeric and alias values. if (isset($segments[0]) && strpos($segments[0], ':')) { list($catid, $alias) = explode(':', $segments[0], 2); } // Category view. $vars['view'] = 'category'; $vars['catid'] = $catid; } } else { // Count route segments $count = count($segments); // Check if there are any route segments to handle. if ($count) { if ($count == 2) { // We are viewing a contact. $vars['view'] = 'contact'; $vars['id'] = $segments[$count-1]; $vars['catid'] = $segments[$count-2]; } else { // We are viewing a category. $vars['view'] = 'category'; $vars['catid'] = $segments[$count-1]; } } } return $vars; }joomla/joomla/components/com_contact/metadata.xml0000766000000000000000000000017711234314130023465 0ustar adminadministrators joomla/joomla/components/com_contact/views/0000777000000000000000000000000011266551247022333 5ustar adminadministratorsjoomla/joomla/components/com_contact/views/contact/0000777000000000000000000000000011266551246023765 5ustar adminadministratorsjoomla/joomla/components/com_contact/views/contact/tmpl/0000777000000000000000000000000011266551247024742 5ustar adminadministratorsjoomla/joomla/components/com_contact/views/contact/tmpl/default_address.php0000766000000000000000000001033311234314130030564 0ustar adminadministrators contact->params->get( 'address_check' ) > 0 ) && ( $this->contact->address || $this->contact->suburb || $this->contact->state || $this->contact->country || $this->contact->postcode ) ) : ?> contact->params->get( 'address_check' ) > 0 ) : ?> contact->address && $this->contact->params->get( 'show_street_address' ) ) : ?> contact->suburb && $this->contact->params->get( 'show_suburb' ) ) : ?> contact->state && $this->contact->params->get( 'show_state' ) ) : ?> contact->postcode && $this->contact->params->get( 'show_postcode' ) ) : ?> contact->country && $this->contact->params->get( 'show_country' ) ) : ?>
    contact->params->get( 'marker_address' ); ?>
    escape($this->contact->address)); ?>
    escape($this->contact->suburb); ?>
    escape($this->contact->state); ?>
    escape($this->contact->postcode); ?>
    escape($this->contact->country); ?>

    contact->email_to && $this->contact->params->get( 'show_email' )) || ($this->contact->telephone && $this->contact->params->get( 'show_telephone' )) || ($this->contact->fax && $this->contact->params->get( 'show_fax' )) || ($this->contact->mobile && $this->contact->params->get( 'show_mobile' )) || ($this->contact->webpage && $this->contact->params->get( 'show_webpage' )) ) : ?> contact->email_to && $this->contact->params->get( 'show_email' ) ) : ?> contact->telephone && $this->contact->params->get( 'show_telephone' ) ) : ?> contact->fax && $this->contact->params->get( 'show_fax' ) ) : ?> contact->mobile && $this->contact->params->get( 'show_mobile' ) ) :?> contact->webpage && $this->contact->params->get( 'show_webpage' )) : ?>
    contact->params->get( 'marker_email' ); ?> contact->email_to; ?>
    contact->params->get( 'marker_telephone' ); ?> escape($this->contact->telephone)); ?>
    contact->params->get( 'marker_fax' ); ?> escape($this->contact->fax)); ?>
    contact->params->get( 'marker_mobile' ); ?> escape($this->contact->mobile)); ?>
    escape($this->contact->webpage); ?>

    contact->misc && $this->contact->params->get( 'show_misc' ) ) : ?>
    contact->params->get( 'marker_misc' ); ?> contact->misc); ?>

    joomla/joomla/components/com_contact/views/contact/tmpl/default.xml0000766000000000000000000000200011234314130027060 0ustar adminadministrators Standard Contact Layout STANDARD CONTACT LAYOUT DESC joomla/joomla/components/com_contact/views/contact/tmpl/default.php0000766000000000000000000000542611234314130027066 0ustar adminadministrators params->get( 'show_page_title', 1 ) && !$this->contact->params->get( 'popup' ) && $this->params->get('page_title') != $this->contact->name ) : ?>
    params->get( 'page_title' ); ?>
    params->get( 'show_contact_list' ) && count( $this->contacts ) > 1) : ?> contact->name && $this->contact->params->get( 'show_name' ) ) : ?> contact->con_position && $this->contact->params->get( 'show_position' ) ) : ?> contact->params->get( 'allow_vcard' ) ) : ?> contact->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) echo $this->loadTemplate('form'); ?>

    :
    contacts, 'contact_id', 'class="inputbox" onchange="this.form.submit()"', 'id', 'name', $this->contact->id);?>
    escape($this->contact->name); ?>
    escape($this->contact->con_position); ?>

    contact->image && $this->contact->params->get( 'show_image' ) ) : ?>
    contact->image, JText::_( 'Contact' ), array('align' => 'middle')); ?>
    loadTemplate('address'); ?>
     
    joomla/joomla/components/com_contact/views/contact/tmpl/index.html0000766000000000000000000000005411234314130026716 0ustar adminadministratorsjoomla/joomla/components/com_contact/views/contact/tmpl/default_form.php0000766000000000000000000000511111234314130030100 0ustar adminadministrators'; $document =& JFactory::getDocument(); $document->addScriptDeclaration($script); if(isset($this->error)) : ?> error; ?>









    contact->params->get( 'show_email_copy' )) : ?>



    joomla/joomla/components/com_contact/views/contact/metadata.xml0000766000000000000000000000033111234314130026245 0ustar adminadministrators joomla/joomla/components/com_contact/views/contact/view.html.php0000766000000000000000000001626611234314130026407 0ustar adminadministratorsgetPathway(); $document = & JFactory::getDocument(); $model = &$this->getModel(); // Get the parameters of the active menu item $menus = &JSite::getMenu(); $menu = $menus->getActive(); $pparams = &$mainframe->getParams('com_contact'); // Push a model into the view $model = &$this->getModel(); $modelCat = &$this->getModel( 'Category' ); // Selected Request vars // ID may come from the contact switcher if (!($contactId = JRequest::getInt( 'contact_id', 0 ))) { $contactId = JRequest::getInt( 'id', $contactId ); } // query options $options['id'] = $contactId; $options['aid'] = $user->get('aid', 0); $contact = $model->getContact( $options ); // check if we have a contact if (!is_object( $contact )) { JError::raiseError( 404, 'Contact not found' ); return; } // check if access is registered/special if (($contact->access > $user->get('aid', 0)) || ($contact->category_access > $user->get('aid', 0))) { $uri = JFactory::getURI(); $return = $uri->toString(); $url = 'index.php?option=com_user&view=login'; $url .= '&return='.base64_encode($return); $mainframe->redirect($url, JText::_('You must login first') ); } $options['category_id'] = $contact->catid; $options['order by'] = 'cd.default_con DESC, cd.ordering ASC'; $contacts = $modelCat->getContacts( $options ); // Set the document page title // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu ) && isset($menu->query['view']) && $menu->query['view'] == 'contact' && isset($menu->query['id']) && $menu->query['id'] == $contact->id) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $pparams->set('page_title', $contact->name); } } else { $pparams->set('page_title', $contact->name); } $document->setTitle( $pparams->get( 'page_title' ) ); //set breadcrumbs if (isset( $menu ) && isset($menu->query['view']) && $menu->query['view'] != 'contact'){ $pathway->addItem($contact->name, ''); } // Adds parameter handling $contact->params = new JParameter($contact->params); $pparams->merge($contact->params); // Handle component/menu overides for some contact parameters if set /* $contact->params->def('contact_icons', $pparams->get('contact_icons')); $contact->params->def('icon_address', $pparams->get('icon_address')); $contact->params->def('icon_email', $pparams->get('icon_email')); $contact->params->def('icon_telephone', $pparams->get('icon_telephone')); $contact->params->def('icon_fax', $pparams->get('icon_fax')); $contact->params->def('icon_misc', $pparams->get('icon_misc')); $contact->params->def('show_position', $pparams->get('show_position')); $contact->params->def('show_email', $pparams->get('show_email')); $contact->params->def('show_telephone', $pparams->get('show_telephone')); $contact->params->def('show_mobile', $pparams->get('show_mobile')); $contact->params->def('show_fax', $pparams->get('show_fax')); $contact->params->def('allow_vcard', $pparams->get('allow_vcard')); */ // Handle email cloaking if ($contact->email_to && $contact->params->get('show_email')) { $contact->email_to = JHTML::_('email.cloak', $contact->email_to); } if ($contact->params->get('show_street_address') || $contact->params->get('show_suburb') || $contact->params->get('show_state') || $contact->params->get('show_postcode') || $contact->params->get('show_country')) { if (!empty ($contact->address) || !empty ($contact->suburb) || !empty ($contact->state) || !empty ($contact->country) || !empty ($contact->postcode)) { $contact->params->set('address_check', 1); } } else { $contact->params->set('address_check', 0); } // Manage the display mode for contact detail groups switch ($contact->params->get('contact_icons')) { case 1 : // text $contact->params->set('marker_address', JText::_('Address').": "); $contact->params->set('marker_email', JText::_('Email').": "); $contact->params->set('marker_telephone', JText::_('Telephone').": "); $contact->params->set('marker_fax', JText::_('Fax').": "); $contact->params->set('marker_mobile', JText::_('Mobile').": "); $contact->params->set('marker_misc', JText::_('Information').": "); $contact->params->set('column_width', '100'); break; case 2 : // none $contact->params->set('marker_address', ''); $contact->params->set('marker_email', ''); $contact->params->set('marker_telephone', ''); $contact->params->set('marker_mobile', ''); $contact->params->set('marker_fax', ''); $contact->params->set('marker_misc', ''); $contact->params->set('column_width', '0'); break; default : // icons $image1 = JHTML::_('image.site', 'con_address.png', '/images/M_images/', $contact->params->get('icon_address'), '/images/M_images/', JText::_('Address').": "); $image2 = JHTML::_('image.site', 'emailButton.png', '/images/M_images/', $contact->params->get('icon_email'), '/images/M_images/', JText::_('Email').": "); $image3 = JHTML::_('image.site', 'con_tel.png', '/images/M_images/', $contact->params->get('icon_telephone'), '/images/M_images/', JText::_('Telephone').": "); $image4 = JHTML::_('image.site', 'con_fax.png', '/images/M_images/', $contact->params->get('icon_fax'), '/images/M_images/', JText::_('Fax').": "); $image5 = JHTML::_('image.site', 'con_info.png', '/images/M_images/', $contact->params->get('icon_misc'), '/images/M_images/', JText::_('Information').": "); $image6 = JHTML::_('image.site', 'con_mobile.png', '/images/M_images/', $contact->params->get('icon_mobile'), '/images/M_images/', JText::_('Mobile').": "); $contact->params->set('marker_address', $image1); $contact->params->set('marker_email', $image2); $contact->params->set('marker_telephone', $image3); $contact->params->set('marker_fax', $image4); $contact->params->set('marker_misc', $image5); $contact->params->set('marker_mobile', $image6); $contact->params->set('column_width', '40'); break; } JHTML::_('behavior.formvalidation'); $this->assignRef('contact', $contact); $this->assignRef('contacts', $contacts); $this->assignRef('params', $pparams); parent::display($tpl); } } joomla/joomla/components/com_contact/views/contact/index.html0000766000000000000000000000005411234314130025742 0ustar adminadministratorsjoomla/joomla/components/com_contact/views/index.html0000766000000000000000000000005411234314130024307 0ustar adminadministratorsjoomla/joomla/components/com_contact/views/category/0000777000000000000000000000000011266551247024150 5ustar adminadministratorsjoomla/joomla/components/com_contact/views/category/tmpl/0000777000000000000000000000000011266551247025124 5ustar adminadministratorsjoomla/joomla/components/com_contact/views/category/tmpl/default.xml0000766000000000000000000000350311234314130027253 0ustar adminadministrators Contacts Category Layout CONTACT CATEGORY LAYOUT DESC joomla/joomla/components/com_contact/views/category/tmpl/default.php0000766000000000000000000001056611234314130027251 0ustar adminadministrators params->get( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    category->image || $this->category->description) : ?>
    params->get('image') != -1 && $this->params->get('image') != '') : ?> <?php echo JText::_( 'Contacts' ); ?> category->image) : ?> <?php echo JText::_( 'Contacts' ); ?> category->description; ?>
    params->get( 'show_headings' )) : ?> params->get( 'show_position' ) ) : ?> params->get( 'show_email' ) ) : ?> params->get( 'show_telephone' ) ) : ?> params->get( 'show_mobile' ) ) : ?> params->get( 'show_fax' ) ) : ?> loadTemplate('items'); ?>
    params->get('show_limit')) : echo JText::_('Display Num') .' '; echo $this->pagination->getLimitBox(); endif; ?>
    pagination->getPagesLinks(); ?>
    pagination->getPagesCounter(); ?>
    lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?>
    joomla/joomla/components/com_contact/views/category/tmpl/default_items.php0000766000000000000000000000226011234314130030442 0ustar adminadministrators items as $item) : ?> count +1; ?> name; ?> params->get( 'show_position' ) ) : ?> escape($item->con_position); ?> params->get( 'show_email' ) ) : ?> email_to; ?> params->get( 'show_telephone' ) ) : ?> escape($item->telephone); ?> params->get( 'show_mobile' ) ) : ?> escape($item->mobile); ?> params->get( 'show_fax' ) ) : ?> escape($item->fax); ?> joomla/joomla/components/com_contact/views/category/tmpl/index.html0000766000000000000000000000005411234314130027100 0ustar adminadministratorsjoomla/joomla/components/com_contact/views/category/metadata.xml0000766000000000000000000000034311234314130026432 0ustar adminadministrators joomla/joomla/components/com_contact/views/category/view.html.php0000766000000000000000000001112711234314130026560 0ustar adminadministratorsgetModel(); $document =& JFactory::getDocument(); $pparams = &$mainframe->getParams('com_contact'); // Selected Request vars $categoryId = JRequest::getVar('catid', 0, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $filter_order = JRequest::getVar('filter_order', 'cd.ordering', '', 'cmd'); $filter_order_Dir = JRequest::getVar('filter_order_Dir', 'ASC', '', 'word'); $pparams->def('display_num', $mainframe->getCfg('list_limit')); $default_limit = $pparams->def('display_num', 20); $limit = $mainframe->getUserStateFromRequest('com_contact.'.$this->getLayout().'.limit', 'limit', $default_limit, 'int'); // query options $options['aid'] = $user->get('aid', 0); $options['category_id'] = $categoryId; $options['limit'] = $limit; $options['limitstart'] = $limitstart; $options['order by'] = "$filter_order $filter_order_Dir, cd.ordering"; $categories = $model->getCategories( $options ); $contacts = $model->getContacts( $options ); $total = $model->getContactCount( $options ); //add alternate feed link if($pparams->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } //prepare contacts if($pparams->get('show_email', 0) == 1) { jimport('joomla.mail.helper'); } $k = 0; for($i = 0; $i < count( $contacts ); $i++) { $contact =& $contacts[$i]; $contact->link = JRoute::_('index.php?option=com_contact&view=contact&id='.$contact->slug.'&catid='.$contact->catslug); if ($pparams->get('show_email', 0) == 1) { $contact->email_to = trim($contact->email_to); if (!empty($contact->email_to) && JMailHelper::isEmailAddress($contact->email_to)) { $contact->email_to = JHTML::_('email.cloak', $contact->email_to); } else { $contact->email_to = ''; } } $contact->odd = $k; $contact->count = $i; $k = 1 - $k; } // find current category // TODO: Move to model $category = null; foreach ($categories as $i => $_cat) { if ($_cat->id == $categoryId) { $category = &$categories[$i]; break; } } if ($category == null) { $db = &JFactory::getDBO(); $category =& JTable::getInstance( 'category' ); } $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $pparams->set('page_title', $category->title); } } else { $pparams->set('page_title', $category->title); } $document->setTitle( $pparams->get( 'page_title' ) ); // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $selected = ''; jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $this->assignRef('items', $contacts); $this->assignRef('lists', $lists); $this->assignRef('pagination', $pagination); //$this->assignRef('data', $data); $this->assignRef('category', $category); $this->assignRef('params', $pparams); $this->assign('action', str_replace('&', '&', $uri->toString())); parent::display($tpl); } function getItems() { } } joomla/joomla/components/com_contact/views/category/index.html0000766000000000000000000000005411234314130026124 0ustar adminadministratorsjoomla/joomla/components/com_contact/views/category/view.feed.php0000766000000000000000000000545011234314130026521 0ustar adminadministratorslink = JRoute::_('index.php?option=com_contact&view=category&catid='.JRequest::getVar('catid',null, '', 'int')); $siteEmail = $mainframe->getCfg('mailfrom'); $fromName = $mainframe->getCfg('fromname'); $document->editor = $fromName; $document->editorEmail = $siteEmail; $limit = JRequest::getVar('limit', $mainframe->getCfg('feed_limit'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $catid = JRequest::getVar('catid', 0, '', 'int'); $where = ' WHERE a.published = 1'; if ( $catid ) { $where .= ' AND a.catid = '. (int) $catid; } $query = 'SELECT' . ' a.name AS title,' . ' CONCAT( a.con_position, \' - \', a.misc ) AS description,' . ' "" AS date,' . ' c.title AS category,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug' . ' FROM #__contact_details AS a' . ' LEFT JOIN #__categories AS c ON c.id = a.catid' . $where . ' ORDER BY a.catid, a.ordering' ; $db->setQuery( $query, 0, $limit ); $rows = $db->loadObjectList(); foreach ( $rows as $row ) { // strip html from feed item title $title = $this->escape( $row->title ); $title = html_entity_decode( $title ); // url link to article $link = JRoute::_('index.php?option=com_contact&view=contact&id='. $row->slug .'&catid='.$row->catslug ); // strip html from feed item description text $description = $row->description; $date = ( $row->date ? date( 'r', strtotime($row->date) ) : '' ); // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $date; $item->category = $row->category; // loads item info into rss array $document->addItem( $item ); } } } joomla/joomla/components/com_contact/controller.php0000766000000000000000000002642611234314130024064 0ustar adminadministratorsgetType(); // interceptors to support legacy urls switch ($this->getTask()) { //index.php?option=com_contact&task=category&id=0&Itemid=4 case 'category': $viewName = 'category'; $layout = 'default'; break; case 'view': $viewName = 'contact'; $layout = 'default'; break; } // Set the default view name from the Request $view = &$this->getView($viewName, $viewType); // Push a model into the view $model = &$this->getModel( $viewName ); if (!JError::isError( $model )) { $view->setModel( $model, true ); } // Workaround for the item view if ($viewName == 'contact') { $modelCat = &$this->getModel( 'category' ); $view->setModel( $modelCat ); } // Display the view $view->assign('error', $this->getError()); $view->display(); } /** * Method to send an email to a contact * * @static * @since 1.0 */ function submit() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db = & JFactory::getDBO(); $SiteName = $mainframe->getCfg('sitename'); $default = JText::sprintf( 'MAILENQUIRY', $SiteName ); $contactId = JRequest::getInt( 'id', 0, 'post' ); $name = JRequest::getVar( 'name', '', 'post' ); $email = JRequest::getVar( 'email', '', 'post' ); $subject = JRequest::getVar( 'subject', $default, 'post' ); $body = JRequest::getVar( 'text', '', 'post' ); $emailCopy = JRequest::getInt( 'email_copy', 0, 'post' ); // load the contact details $model = &$this->getModel('contact'); // query options $qOptions['id'] = $contactId; $contact = $model->getContact( $qOptions ); if($contact->email_to == '' && $contact->user_id != 0) { $contact_user = JUser::getInstance($contact->user_id); $contact->email_to = $contact_user->get('email'); } /* * If there is no valid email address or message body then we throw an * error and return false. */ jimport('joomla.mail.helper'); if (!$email || !$body || (JMailHelper::isEmailAddress($email) == false)) { $this->setError(JText::_('CONTACT_FORM_NC')); $this->display(); return false; } // Contact plugins JPluginHelper::importPlugin( 'contact' ); $dispatcher =& JDispatcher::getInstance(); // Input validation if (!$this->_validateInputs( $contact, $email, $subject, $body ) ) { JError::raiseWarning( 0, $this->getError() ); return false; } // Custom handlers $post = JRequest::get( 'post' ); $results = $dispatcher->trigger( 'onValidateContact', array( &$contact, &$post ) ); foreach ($results as $result) { if (JError::isError( $result )) { return false; } } // Passed Validation: Process the contact plugins to integrate with other applications $results = $dispatcher->trigger( 'onSubmitContact', array( &$contact, &$post ) ); $pparams = &$mainframe->getParams('com_contact'); if (!$pparams->get( 'custom_reply' )) { $MailFrom = $mainframe->getCfg('mailfrom'); $FromName = $mainframe->getCfg('fromname'); // Prepare email body $prefix = JText::sprintf('ENQUIRY_TEXT', JURI::base()); $body = $prefix."\n".$name.' <'.$email.'>'."\r\n\r\n".stripslashes($body); $mail = JFactory::getMailer(); $mail->addRecipient( $contact->email_to ); $mail->setSender( array( $email, $name ) ); $mail->setSubject( $FromName.': '.$subject ); $mail->setBody( $body ); $sent = $mail->Send(); /* * If we are supposed to copy the admin, do so. */ // parameter check $params = new JParameter( $contact->params ); $emailcopyCheck = $params->get( 'show_email_copy', 0 ); // check whether email copy function activated if ( $emailCopy && $emailcopyCheck ) { $copyText = JText::sprintf('Copy of:', $contact->name, $SiteName); $copyText .= "\r\n\r\n".$body; $copySubject = JText::_('Copy of:')." ".$subject; $mail = JFactory::getMailer(); $mail->addRecipient( $email ); $mail->setSender( array( $MailFrom, $FromName ) ); $mail->setSubject( $copySubject ); $mail->setBody( $copyText ); $sent = $mail->Send(); } } $msg = JText::_( 'Thank you for your e-mail'); $link = JRoute::_('index.php?option=com_contact&view=contact&id='.$contact->slug.'&catid='.$contact->catslug, false); $this->setRedirect($link, $msg); } /** * Method to output a vCard * * @static * @since 1.0 */ function vcard() { global $mainframe; // Initialize some variables $db = & JFactory::getDBO(); $SiteName = $mainframe->getCfg('sitename'); $contactId = JRequest::getVar('contact_id', 0, '', 'int'); // Get a Contact table object and load the selected contact details JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_contact'.DS.'tables'); $contact =& JTable::getInstance('contact', 'Table'); $contact->load($contactId); $user =& JFactory::getUser(); // Get the contact detail parameters $params = new JParameter($contact->params); // Show the Vcard if contact parameter indicates (prevents direct access) if (($params->get('allow_vcard', 0)) && ($user->get('aid', 0) >= $contact->access)) { // Parse the contact name field and build the nam information for the vcard. $firstname = null; $middlename = null; $surname = null; // How many parts do we have? $parts = explode(' ', $contact->name); $count = count($parts); switch ($count) { case 1 : // only a first name $firstname = $parts[0]; break; case 2 : // first and last name $firstname = $parts[0]; $surname = $parts[1]; break; default : // we have full name info $firstname = $parts[0]; $surname = $parts[$count -1]; for ($i = 1; $i < $count -1; $i ++) { $middlename .= $parts[$i].' '; } break; } // quick cleanup for the middlename value $middlename = trim($middlename); // Create a new vcard object and populate the fields require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_contact'.DS.'helpers'.DS.'vcard.php'); $v = new JvCard(); $v->setPhoneNumber($contact->telephone, 'PREF;WORK;VOICE'); $v->setPhoneNumber($contact->fax, 'WORK;FAX'); $v->setName($surname, $firstname, $middlename, ''); $v->setAddress('', '', $contact->address, $contact->suburb, $contact->state, $contact->postcode, $contact->country, 'WORK;POSTAL'); $v->setEmail($contact->email_to); $v->setNote($contact->misc); $v->setURL( JURI::base(), 'WORK'); $v->setTitle($contact->con_position); $v->setOrg(html_entity_decode($SiteName, ENT_COMPAT, 'UTF-8')); $filename = str_replace(' ', '_', $contact->name); $v->setFilename($filename); $output = $v->getVCard(html_entity_decode($SiteName, ENT_COMPAT, 'UTF-8')); $filename = $v->getFileName(); // Send vCard file headers header('Content-Disposition: attachment; filename='.$filename); header('Content-Length: '.strlen($output)); header('Connection: close'); header('Content-Type: text/x-vCard; name='.$filename); header('Cache-Control: store, cache'); header('Pragma: cache'); print $output; } else { JError::raiseWarning('SOME_ERROR_CODE', 'ContactController::vCard: '.JText::_('ALERTNOTAUTH')); return false; } } /** * Validates some inputs based on component configuration * * @param Object $contact JTable Object * @param String $email Email address * @param String $subject Email subject * @param String $body Email body * @return Boolean * @access protected * @since 1.5 */ function _validateInputs( $contact, $email, $subject, $body ) { global $mainframe; $session =& JFactory::getSession(); // Get params and component configurations $params = new JParameter($contact->params); $pparams = &$mainframe->getParams('com_contact'); // check for session cookie $sessionCheck = $pparams->get( 'validate_session', 1 ); $sessionName = $session->getName(); if ( $sessionCheck ) { if ( !isset($_COOKIE[$sessionName]) ) { $this->setError( JText::_('ALERTNOTAUTH') ); return false; } } // Determine banned e-mails $configEmail = $pparams->get( 'banned_email', '' ); $paramsEmail = $params->get( 'banned_mail', '' ); $bannedEmail = $configEmail . ($paramsEmail ? ';'.$paramsEmail : ''); // Prevent form submission if one of the banned text is discovered in the email field if(false === $this->_checkText($email, $bannedEmail )) { $this->setError( JText::sprintf('MESGHASBANNEDTEXT', JText::_('Email')) ); return false; } // Determine banned subjects $configSubject = $pparams->get( 'banned_subject', '' ); $paramsSubject = $params->get( 'banned_subject', '' ); $bannedSubject = $configSubject . ( $paramsSubject ? ';'.$paramsSubject : ''); // Prevent form submission if one of the banned text is discovered in the subject field if(false === $this->_checkText($subject, $bannedSubject)) { $this->setError( JText::sprintf('MESGHASBANNEDTEXT',JText::_('Subject')) ); return false; } // Determine banned Text $configText = $pparams->get( 'banned_text', '' ); $paramsText = $params->get( 'banned_text', '' ); $bannedText = $configText . ( $paramsText ? ';'.$paramsText : '' ); // Prevent form submission if one of the banned text is discovered in the text field if(false === $this->_checkText( $body, $bannedText )) { $this->setError( JText::sprintf('MESGHASBANNEDTEXT', JText::_('Message')) ); return false; } // test to ensure that only one email address is entered $check = explode( '@', $email ); if ( strpos( $email, ';' ) || strpos( $email, ',' ) || strpos( $email, ' ' ) || count( $check ) > 2 ) { $this->setError( JText::_( 'You cannot enter more than one email address', true ) ); return false; } return true; } /** * Checks $text for values contained in the array $array, and sets error message if true... * * @param String $text Text to search against * @param String $list semicolon (;) seperated list of banned values * @return Boolean * @access protected * @since 1.5.4 */ function _checkText($text, $list) { if(empty($list) || empty($text)) return true; $array = explode(';', $list); foreach ($array as $value) { $value = trim($value); if(empty($value)) continue; if ( JString::stristr($text, $value) !== false ) { return false; } } return true; } } joomla/joomla/components/com_contact/index.html0000766000000000000000000000005411234314130023152 0ustar adminadministratorsjoomla/joomla/components/com_contact/models/0000777000000000000000000000000011266551250022453 5ustar adminadministratorsjoomla/joomla/components/com_contact/models/category.php0000766000000000000000000001025611234314130024773 0ustar adminadministratorsQuote( 'com_contact_details' ); $wheres[] = 'cc.published = 1'; if ($aid !== null) { $wheres[] = 'a.access <= ' . (int) $aid; $wheres[] = 'cc.access <= ' . (int) $aid; } $groupBy = 'cc.id'; $orderBy = 'cc.ordering' ; /* * Query to retrieve all categories that belong under the contacts * section and that are published. */ $query = 'SELECT cc.*, COUNT( a.id ) AS numlinks, a.id as cid'. ' FROM #__categories AS cc'. ' LEFT JOIN #__contact_details AS a ON a.catid = cc.id'. ' WHERE ' . implode( ' AND ', $wheres ) . ' GROUP BY ' . $groupBy . ' ORDER BY ' . $orderBy; //echo $query; return $query; } /** * Builds the query to select contact items * @param array * @return string * @access protected */ function _getContactsQuery( &$options ) { // TODO: Cache on the fingerprint of the arguments $db =& JFactory::getDBO(); $aid = @$options['aid']; $catId = @$options['category_id']; $groupBy = @$options['group by']; $orderBy = @$options['order by']; $select = 'cd.*, ' . 'cc.name AS category_name, cc.description AS category_description, cc.image AS category_image,'. ' CASE WHEN CHAR_LENGTH(cd.alias) THEN CONCAT_WS(\':\', cd.id, cd.alias) ELSE cd.id END as slug, '. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug '; $from = '#__contact_details AS cd'; $joins[] = 'INNER JOIN #__categories AS cc on cd.catid = cc.id'; if ($catId) { $wheres[] = 'cd.catid = ' . (int) $catId; } $wheres[] = 'cc.published = 1'; $wheres[] = 'cd.published = 1'; if ($aid !== null) { $wheres[] = 'cc.access <= ' . (int) $aid; $wheres[] = 'cd.access <= ' . (int) $aid; } /* * Query to retrieve all categories that belong under the contacts * section and that are published. */ $query = 'SELECT ' . $select . ' FROM ' . $from . ' ' . implode ( ' ', $joins ) . ' WHERE ' . implode( ' AND ', $wheres ) . ($groupBy ? ' GROUP BY ' . $groupBy : ''). ($orderBy ? ' ORDER BY ' . $orderBy : ''); return $query; } /** * Gets a list of categories * @param array * @return array */ function getCategories( $options=array() ) { $query = $this->_getCatgoriesQuery( $options ); return $this->_getList( $query, @$options['limitstart'], @$options['limit'] ); } /** * Gets the count of the categories for the given options * @param array * @return int */ function getCategoryCount( $options=array() ) { $query = $this->_getCatgoriesQuery( $options ); return $this->_getListCount( $query ); } /** * Gets a list of categories * @param array * @return array */ function getContacts( $options=array() ) { $query = $this->_getContactsQuery( $options ); return $this->_getList( $query, @$options['limitstart'], @$options['limit'] ); } /** * Gets the count of the categories for the given options * @param array * @return int */ function getContactCount( $options=array() ) { $query = $this->_getContactsQuery( $options ); return $this->_getListCount( $query ); } }joomla/joomla/components/com_contact/models/index.html0000766000000000000000000000005411234314130024435 0ustar adminadministratorsjoomla/joomla/components/com_contact/models/contact.php0000766000000000000000000000422011234314130024603 0ustar adminadministrators_getContactQuery( $options ); $result = $this->_getList( $query ); return @$result[0]; } }joomla/joomla/components/com_contact/contact.php0000766000000000000000000000170611234314130023326 0ustar adminadministratorsexecute(JRequest::getVar('task', null, 'default', 'cmd')); // Redirect if set by the controller $controller->redirect();joomla/joomla/components/com_newsfeeds/0000777000000000000000000000000011266551233021521 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/router.php0000766000000000000000000001630711234314126023553 0ustar adminadministratorsgetItems('componentid', $component->id); } // Search for an appropriate menu item. if (is_array($items)) { // If only the option and itemid are specified in the query, return that item. if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) { $itemid = (int) $query['Itemid']; } // Search for a specific link based on the critera given. if (!$itemid) { foreach ($items as $item) { // Check if this menu item links to this view. if (isset($item->query['view']) && $item->query['view'] == 'newsfeed' && isset($query['view']) && $query['view'] != 'category' && isset($item->query['id']) && isset($query['id']) && $item->query['id'] == $query['id']) { $itemid = $item->id; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($query['view']) && $query['view'] != 'newsfeed' && isset($item->query['catid']) && $item->query['catid'] == $query['catid']) { $itemid = $item->id; } } } // If no specific link has been found, search for a general one. if (!$itemid) { foreach ($items as $item) { //var_dump($item->query); if (isset($query['view']) && $query['view'] == 'newsfeed' && isset($item->query['view']) && $item->query['view'] == 'category' && isset($item->query['id']) && isset($query['catid']) && $query['catid'] == $item->query['id']) { // This menu item links to the newsfeed view but we need to append the newsfeed id to it. $itemid = $item->id; $segments[] = isset($query['catalias']) ? $query['catid'].':'.$query['catalias'] : $query['catid']; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } elseif (isset($query['view']) && $query['view'] == 'category' && isset($item->query['view']) && $item->query['view'] == 'category' && isset($item->query['id']) && isset($query['id']) && $item->query['id'] != $query['id']) { // This menu item links to the category view but we need to append the category id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } // Search for an even more general link. if (!$itemid) { foreach ($items as $item) { if (isset($query['view']) && $query['view'] == 'newsfeed' && isset($item->query['view']) && $item->query['view'] == 'categories' && isset($query['catid']) && isset($query['id'])) { // This menu item links to the categories view but we need to append the category and newsfeed id to it. $itemid = $item->id; $segments[] = isset($query['catalias']) ? $query['catid'].':'.$query['catalias'] : $query['catid']; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } elseif (isset($query['view']) && $query['view'] == 'category' && isset($item->query['view']) && $item->query['view'] == 'categories' && !isset($query['catid'])) { // This menu item links to the categories view but we need to append the category id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } } // Check if the router found an appropriate itemid. if (!$itemid) { // Check if a id was specified. if (isset($query['id'])) { if (isset($query['alias'])) { $query['id'] .= ':'.$query['alias']; } // Push the id onto the stack. $segments[] = $query['id']; unset($query['view']); unset($query['id']); unset($query['alias']); } elseif (isset($query['catid'])) { if (isset($query['alias'])) { $query['catid'] .= ':'.$query['catalias']; } // Push the catid onto the stack. $segments[] = 'category'; $segments[] = $query['catid']; unset($query['view']); unset($query['catid']); unset($query['catalias']); unset($query['alias']); } else { // Categories view. unset($query['view']); } } else { $query['Itemid'] = $itemid; // Remove the unnecessary URL segments. unset($query['view']); unset($query['id']); unset($query['alias']); unset($query['catid']); unset($query['catalias']); } return $segments; } function NewsfeedsParseRoute($segments) { $vars = array(); // Get the active menu item. $menu = &JSite::getMenu(); $item = &$menu->getActive(); // Check if we have a valid menu item. if (is_object($item)) { // Proceed through the possible variations trying to match the most specific one. if (isset($item->query['view']) && $item->query['view'] == 'newsfeed' && isset($segments[0])) { // Contact view. $vars['view'] = 'newsfeed'; $vars['id'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && count($segments) == 2) { // Newsfeed view. $vars['view'] = 'newsfeed'; $vars['id'] = $segments[1]; $vars['catid'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($segments[0])) { // Category view. $vars['view'] = 'category'; $vars['id'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'categories' && count($segments) == 2) { // Newsfeed view. $vars['view'] = 'newsfeed'; $vars['id'] = $segments[1]; $vars['catid'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'categories' && isset($segments[0])) { // Category view. $vars['view'] = 'category'; $vars['id'] = $segments[0]; } } else { // Count route segments $count = count($segments); // Check if there are any route segments to handle. if ($count) { if (count($segments[0]) == 2) { // We are viewing a newsfeed. $vars['view'] = 'newsfeed'; $vars['id'] = $segments[$count-2]; $vars['catid'] = $segments[$count-1]; } else { // We are viewing a category. $vars['view'] = 'category'; $vars['catid'] = $segments[$count-1]; } } } return $vars; } ?> joomla/joomla/components/com_newsfeeds/metadata.xml0000766000000000000000000000007711234314126024021 0ustar adminadministrators joomla/joomla/components/com_newsfeeds/views/0000777000000000000000000000000011266551233022656 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/categories/0000777000000000000000000000000011266551233025003 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/categories/tmpl/0000777000000000000000000000000011266551233025757 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/categories/tmpl/default.xml0000766000000000000000000000246011234314126030121 0ustar adminadministrators Newsfeed category List Layout NEWSFEED CATEGORY LIST LAYOUT DESC joomla/joomla/components/com_newsfeeds/views/categories/tmpl/default.php0000766000000000000000000000267511234314126030120 0ustar adminadministrators params->get( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    params->get('image') != -1) || $this->params->get('show_comp_description') ) : ?>
    image) ) : echo $this->image; endif; echo $this->escape($this->params->get('comp_description')); ?>
    joomla/joomla/components/com_newsfeeds/views/categories/tmpl/index.html0000766000000000000000000000005411234314126027745 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/categories/metadata.xml0000766000000000000000000000023611234314126027300 0ustar adminadministrators joomla/joomla/components/com_newsfeeds/views/categories/view.html.php0000766000000000000000000000445211234314126027430 0ustar adminadministratorsgetParams(); $categories =& $this->get('data'); for($i = 0; $i < count($categories); $i++) { $category =& $categories[$i]; $category->link = JRoute::_('index.php?view=category&id='. $category->slug ); // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); } // Define image tag attributes if ($params->get('image') != -1) { $attribs['align'] = $params->get('image_align'); $attribs['hspace'] = 6; // Use the static HTML library to build the image tag $image = JHTML::_('image', 'images/stories/'.$params->get('image'), JText::_('NEWS_FEEDS'), $attribs); } $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Newsfeeds' )); } } else { $params->set('page_title', JText::_( 'Newsfeeds' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); $this->assignRef('image', $image); $this->assignRef('params', $params); $this->assignRef('categories', $categories); parent::display($tpl); } } ?> joomla/joomla/components/com_newsfeeds/views/categories/index.html0000766000000000000000000000005411234314126026771 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/index.html0000766000000000000000000000005411234314126024644 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/category/0000777000000000000000000000000011266551232024472 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/category/tmpl/0000777000000000000000000000000011266551233025447 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/category/tmpl/default.xml0000766000000000000000000000132211234314126027605 0ustar adminadministrators Newsfeed Category Layout NEWSFEED CATEGORY LAYOUT DESC joomla/joomla/components/com_newsfeeds/views/category/tmpl/default.php0000766000000000000000000000160511234314126027600 0ustar adminadministrators params->get( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    image || @$this->category->description ) : ?>
    image) ) : echo $this->image; endif; echo $this->category->description; ?>
    loadTemplate('items'); ?>
    joomla/joomla/components/com_newsfeeds/views/category/tmpl/default_items.php0000766000000000000000000000412011234314126030774 0ustar adminadministrators
    params->get('show_limit')) : ?> params->get( 'show_headings' ) ) : ?> params->get( 'show_name' ) ) : ?> params->get( 'show_articles' ) ) : ?> items as $item) : ?> params->get( 'show_articles' ) ) : ?>
    pagination->getLimitBox(); ?>
    count + 1; ?> escape($item->name); ?> numarticles; ?>
    pagination->getPagesLinks(); ?>
    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_newsfeeds/views/category/tmpl/index.html0000766000000000000000000000005411234314126027435 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/category/metadata.xml0000766000000000000000000000024111234314126026764 0ustar adminadministrators joomla/joomla/components/com_newsfeeds/views/category/view.html.php0000766000000000000000000000533611234314126027122 0ustar adminadministratorsgetPathway(); $document = & JFactory::getDocument(); // Get the parameters of the active menu item $menus = &JSite::getMenu(); $menu = $menus->getActive(); $params = &$mainframe->getParams(); $category = $this->get('category'); $items = $this->get('data'); $total = $this->get('total'); $pagination = &$this->get('pagination'); // Set page title $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $category->title); } } else { $params->set('page_title', $category->title); } $document->setTitle( $params->get( 'page_title' ) ); //set breadcrumbs $pathway->addItem($category->title, ''); // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); $k = 0; for($i = 0; $i < count($items); $i++) { $item =& $items[$i]; $item->link = JRoute::_('index.php?view=newsfeed&catid='.$category->slug.'&id='. $item->slug ); $item->odd = $k; $item->count = $i; $k = 1 - $k; } // Define image tag attributes if (!empty ($category->image)) { $attribs['align'] = $category->image_position; $attribs['hspace'] = 6; // Use the static HTML library to build the image tag $image = JHTML::_('image', 'images/stories/'.$category->image, JText::_('NEWS_FEEDS'), $attribs); } $this->assignRef('image', $image); $this->assignRef('params', $params); $this->assignRef('items', $items); $this->assignRef('category', $category); $this->assignRef('pagination', $pagination); parent::display($tpl); } } ?> joomla/joomla/components/com_newsfeeds/views/category/index.html0000766000000000000000000000005411234314126026461 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/newsfeed/0000777000000000000000000000000011266551232024455 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/newsfeed/tmpl/0000777000000000000000000000000011266551232025431 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/newsfeed/tmpl/default.xml0000766000000000000000000000073011234314126027572 0ustar adminadministrators Newsfeed Layout NEWSFEED SINGLE LAYOUT DESC joomla/joomla/components/com_newsfeeds/views/newsfeed/tmpl/default.php0000766000000000000000000000544111234314126027565 0ustar adminadministrators newsfeed->rtl; if ($lang->isRTL() && $myrtl==0){ $direction= "direction:rtl !important;"; $align= "text-align:right !important;"; } else if ($lang->isRTL() && $myrtl==1){ $direction= "direction:ltr !important;"; $align= "text-align:left !important;"; } else if ($lang->isRTL() && $myrtl==2){ $direction= "direction:rtl !important;"; $align= "text-align:right !important;"; } else if ($myrtl==0) { $direction= "direction:ltr !important;"; $align= "text-align:left !important;"; } else if ($myrtl==1) { $direction= "direction:ltr !important;"; $align= "text-align:left !important;"; } else if ($myrtl==2) { $direction= "direction:rtl !important;"; $align= "text-align:right !important;"; } ?>
    params->get('show_page_title', 1)) : ?>
    escape($this->params->get('page_title')); ?>
    params->get( 'show_feed_description' ) ) : ?> newsfeed->image['url']) && isset($this->newsfeed->image['title']) && $this->params->get( 'show_feed_image' ) ) : ?>
    newsfeed->channel['title']); ?>
    newsfeed->channel['description']); ?>

    <?php echo $this->newsfeed->image['title']; ?>
      newsfeed->items as $item ) : ?>
    • get_link() ) ) : ?> get_title(); ?> params->get( 'show_item_description' ) && $item->get_description()) : ?>
      limitText($item->get_description(), $this->params->get( 'feed_word_count' )); echo str_replace(''', "'", $text); ?>

    joomla/joomla/components/com_newsfeeds/views/newsfeed/tmpl/index.html0000766000000000000000000000005411234314126027420 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/views/newsfeed/metadata.xml0000766000000000000000000000025711234314126026756 0ustar adminadministrators joomla/joomla/components/com_newsfeeds/views/newsfeed/view.html.php0000766000000000000000000000716711234314126027111 0ustar adminadministratorsgetPathway(); $document =& JFactory::getDocument(); // Get the current menu item $menus = &JSite::getMenu(); $menu = $menus->getActive(); $params = &$mainframe->getParams(); //get the newsfeed $newsfeed =& $this->get('data'); // get RSS parsed object $options = array(); $options['rssUrl'] = $newsfeed->link; $options['cache_time'] = $newsfeed->cache_time; $rssDoc =& JFactory::getXMLparser('RSS', $options); if ( $rssDoc == false ) { $msg = JText::_('Error: Feed not retrieved'); $mainframe->redirect('index.php?option=com_newsfeeds&view=category&id='. $newsfeed->catslug, $msg); return; } $lists = array(); // channel header and link $newsfeed->channel['title'] = $rssDoc->get_title(); $newsfeed->channel['link'] = $rssDoc->get_link(); $newsfeed->channel['description'] = $rssDoc->get_description(); $newsfeed->channel['language'] = $rssDoc->get_language(); // channel image if exists $newsfeed->image['url'] = $rssDoc->get_image_url(); $newsfeed->image['title'] = $rssDoc->get_image_title(); $newsfeed->image['link'] = $rssDoc->get_image_link(); $newsfeed->image['height'] = $rssDoc->get_image_height(); $newsfeed->image['width'] = $rssDoc->get_image_width(); // items $newsfeed->items = $rssDoc->get_items(); // feed elements $newsfeed->items = array_slice($newsfeed->items, 0, $newsfeed->numarticles); // Set page title // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $newsfeed->name); } } else { $params->set('page_title', $newsfeed->name); } $document->setTitle( $params->get( 'page_title' ) ); //set breadcrumbs $viewname = JRequest::getString('view'); if ( $viewname == 'categories' ) { $pathway->addItem($newsfeed->category, 'index.php?view=category&id='.$newsfeed->catslug); } $pathway->addItem($newsfeed->name, ''); $this->assignRef('params' , $params ); $this->assignRef('newsfeed', $newsfeed ); parent::display($tpl); } function limitText($text, $wordcount) { if(!$wordcount) { return $text; } $texts = explode( ' ', $text ); $count = count( $texts ); if ( $count > $wordcount ) { $text = ''; for( $i=0; $i < $wordcount; $i++ ) { $text .= ' '. $texts[$i]; } $text .= '...'; } return $text; } } ?> joomla/joomla/components/com_newsfeeds/views/newsfeed/index.html0000766000000000000000000000005411234314126026444 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/controller.php0000766000000000000000000000217111234314124024406 0ustar adminadministrators joomla/joomla/components/com_newsfeeds/index.html0000766000000000000000000000005411234314126023507 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/models/0000777000000000000000000000000011266551234023005 5ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/models/categories.php0000766000000000000000000000465611234314126025647 0ustar adminadministrators_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query); } return $this->_data; } /** * Method to get the total number of newsfeed items for the categories * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } function _buildQuery() { $user =& JFactory::getUser(); $gid = $user->get('aid', 0); /* Query to retrieve all categories that belong under the newsfeeds section and that are published. */ $query = 'SELECT cc.*, a.catid, COUNT(a.id) AS numlinks,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug' . ' FROM #__categories AS cc' . ' LEFT JOIN #__newsfeeds AS a ON a.catid = cc.id' . ' WHERE a.published = 1' . ' AND cc.section = \'com_newsfeeds\'' . ' AND cc.published = 1' . ' AND cc.access <= '.(int) $gid . ' GROUP BY cc.id' . ' ORDER BY cc.ordering' ; return $query; } } ?> joomla/joomla/components/com_newsfeeds/models/category.php0000766000000000000000000001106411234314126025326 0ustar adminadministratorssetState('limit', $mainframe->getUserStateFromRequest('com_newsfeeds.limit', 'limit', $config->getValue('config.list_limit'), 'int')); $this->setState('limitstart', JRequest::getVar('limitstart', 0, '', 'int')); $id = JRequest::getVar('id', 0, '', 'int'); $this->setId((int)$id); } /** * Method to set the category id * * @access public * @param int Category ID number */ function setId($id) { // Set category ID and wipe data $this->_id = $id; $this->_category = null; } /** * Method to get newsfeed item data for the category * * @access public * @return array */ function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $total = count($this->_data); for($i = 0; $i < $total; $i++) { $item =& $this->_data[$i]; $item->slug = $item->id.'-'.$item->alias; } } return $this->_data; } /** * Method to get the total number of newsfeed items for the category * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } /** * Method to get a pagination object of the newsfeeds items for the category * * @access public * @return integer */ function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { jimport('joomla.html.pagination'); $this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') ); } return $this->_pagination; } /** * Method to get category data for the current category * * @since 1.5 */ function getCategory() { // Load the Category data if ($this->_loadCategory()) { // Initialize some variables $user = &JFactory::getUser(); // Make sure the category is published if (!$this->_category->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_category->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_category; } /** * Method to load category data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadCategory() { if (empty($this->_category)) { // current category info $query = 'SELECT c.*,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug '. ' FROM #__categories AS c' . ' WHERE c.id = '. (int) $this->_id . ' AND c.section = "com_newsfeeds"'; $this->_db->setQuery($query, 0, 1); $this->_category = $this->_db->loadObject(); } return true; } function _buildQuery() { // We need to get a list of all weblinks in the given category $query = 'SELECT *' . ' FROM #__newsfeeds' . ' WHERE catid = '.(int) $this->_id. ' AND published = 1' . ' ORDER BY ordering'; return $query; } } ?>joomla/joomla/components/com_newsfeeds/models/newsfeed.php0000766000000000000000000000545611234314126025321 0ustar adminadministratorssetId((int)$id); } /** * Method to set the newsfeed identifier * * @access public * @param int Newsfeed identifier */ function setId($id) { // Set weblink id and wipe data $this->_id = $id; $this->_data = null; } /** * Method to get the newsfeed data * * @since 1.5 */ function &getData() { // Load the weblink data if ($this->_loadData()) { // Initialize some variables $user = &JFactory::getUser(); // Make sure the category is published if (!$this->_data->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // Check to see if the category is published if (!$this->_data->cat_pub) { JError::raiseError( 404, JText::_("Resource Not Found") ); return; } // Check whether category access level allows access if ($this->_data->cat_access > $user->get('aid', 0)) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } } return $this->_data; } /** * Method to load newsfeed data * * @access private * @return boolean True on success * @since 1.5 */ function _loadData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = 'SELECT f.*, cc.title AS category,'. ' cc.published AS cat_pub, cc.access AS cat_access,'. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug'. ' FROM #__newsfeeds AS f' . ' LEFT JOIN #__categories AS cc ON cc.id = f.catid' . ' WHERE f.id = '.$this->_id; $this->_db->setQuery($query); $this->_data = $this->_db->loadObject(); return (boolean) $this->_data; } return true; } } ?> joomla/joomla/components/com_newsfeeds/models/index.html0000766000000000000000000000005411234314126024772 0ustar adminadministratorsjoomla/joomla/components/com_newsfeeds/newsfeeds.php0000766000000000000000000000172411234314126024213 0ustar adminadministratorsexecute(''); // Redirect if set by the controller $controller->redirect(); ?>joomla/joomla/components/com_search/0000777000000000000000000000000011266551227021006 5ustar adminadministratorsjoomla/joomla/components/com_search/router.php0000766000000000000000000000254711234314122023032 0ustar adminadministratorsgetCfg('sef')) && ($app->getCfg('sef_rewrite')) && !($app->getCfg('sef_suffix'))) { $segments[] .= '/'; } if (isset($query['view'])) { unset($query['view']); } return $segments; } /** * @param array * @return array */ function SearchParseRoute( $segments ) { $vars = array(); $searchword = array_shift($segments); $vars['searchword'] = $searchword; $vars['view'] = 'search'; return $vars; }joomla/joomla/components/com_search/views/0000777000000000000000000000000011266551226022142 5ustar adminadministratorsjoomla/joomla/components/com_search/views/search/0000777000000000000000000000000011266551226023407 5ustar adminadministratorsjoomla/joomla/components/com_search/views/search/tmpl/0000777000000000000000000000000011266551227024364 5ustar adminadministratorsjoomla/joomla/components/com_search/views/search/tmpl/default_error.php0000766000000000000000000000036611234314122027722 0ustar adminadministrators
    escape($this->error); ?>
    joomla/joomla/components/com_search/views/search/tmpl/default.xml0000766000000000000000000000127611234314122026523 0ustar adminadministrators Search STANDARD SEARCH LAYOUT DESC joomla/joomla/components/com_search/views/search/tmpl/default.php0000766000000000000000000000073611234314122026512 0ustar adminadministrators params->get( 'show_page_title', 1 ) ) : ?>
    params->get( 'page_title' ); ?>
    loadTemplate('form'); ?> error && count($this->results) > 0) : echo $this->loadTemplate('results'); else : echo $this->loadTemplate('error'); endif; ?> joomla/joomla/components/com_search/views/search/tmpl/index.html0000766000000000000000000000005411234314122026343 0ustar adminadministratorsjoomla/joomla/components/com_search/views/search/tmpl/default_results.php0000766000000000000000000000274211234314122030272 0ustar adminadministrators
    results as $result ) : ?>
    pagination->limitstart + $result->count.'. ';?> href ) : if ($result->browsernav == 1 ) : ?> escape($result->title); if ( $result->href ) : ?> section ) : ?>
    (escape($result->section); ?>)
    text; ?>
    params->get( 'show_date' )) : ?>
    created; ?>
    pagination->getPagesLinks( ); ?>
    joomla/joomla/components/com_search/views/search/tmpl/default_form.php0000766000000000000000000000440411234314122027531 0ustar adminadministrators
    lists['searchphrase']; ?>
    lists['ordering'];?>
    params->get( 'search_areas', 1 )) : ?> : searchareas['search'] as $val => $txt) : $checked = is_array( $this->searchareas['active'] ) && in_array( $val, $this->searchareas['active'] ) ? 'checked="checked"' : ''; ?> />

    '. $this->escape($this->searchword) .''; ?>

    result; ?>

    total > 0) : ?>
    pagination->getLimitBox( ); ?>
    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_search/views/search/metadata.xml0000766000000000000000000000022211234314122025671 0ustar adminadministrators joomla/joomla/components/com_search/views/search/view.html.php0000766000000000000000000001243111234314122026022 0ustar adminadministratorsgetPathway(); $uri =& JFactory::getURI(); $error = ''; $rows = null; $total = 0; // Get some data from the model $areas = &$this->get('areas'); $state = &$this->get('state'); $searchword = $state->get('keyword'); $params = &$mainframe->getParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Search' )); } } else { $params->set('page_title', JText::_( 'Search' )); } $document = &JFactory::getDocument(); $document->setTitle( $params->get( 'page_title' ) ); // Get the parameters of the active menu item $params = &$mainframe->getParams(); // built select lists $orders = array(); $orders[] = JHTML::_('select.option', 'newest', JText::_( 'Newest first' ) ); $orders[] = JHTML::_('select.option', 'oldest', JText::_( 'Oldest first' ) ); $orders[] = JHTML::_('select.option', 'popular', JText::_( 'Most popular' ) ); $orders[] = JHTML::_('select.option', 'alpha', JText::_( 'Alphabetical' ) ); $orders[] = JHTML::_('select.option', 'category', JText::_( 'Section/Category' ) ); $lists = array(); $lists['ordering'] = JHTML::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text', $state->get('ordering') ); $searchphrases = array(); $searchphrases[] = JHTML::_('select.option', 'all', JText::_( 'All words' ) ); $searchphrases[] = JHTML::_('select.option', 'any', JText::_( 'Any words' ) ); $searchphrases[] = JHTML::_('select.option', 'exact', JText::_( 'Exact phrase' ) ); $lists['searchphrase' ]= JHTML::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', $state->get('match') ); // log the search SearchHelper::logSearch( $searchword); //limit searchword if(SearchHelper::limitSearchWord($searchword)) { $error = JText::_( 'SEARCH_MESSAGE' ); } //sanatise searchword if(SearchHelper::santiseSearchWord($searchword, $state->get('match'))) { $error = JText::_( 'IGNOREKEYWORD' ); } if (!$searchword && count( JRequest::get('post') ) ) { //$error = JText::_( 'Enter a search keyword' ); } // put the filtered results back into the model // for next release, the checks should be done in the model perhaps... $state->set('keyword', $searchword); if(!$error) { $results = &$this->get('data' ); $total = &$this->get('total'); $pagination = &$this->get('pagination'); require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php'); for ($i=0; $i < count($results); $i++) { $row = &$results[$i]->text; if ($state->get('match') == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchwords = preg_split("/\s+/u", $searchword); $needle = $searchwords[0]; } $row = SearchHelper::prepareSearchContent( $row, 200, $needle ); $searchwords = array_unique( $searchwords ); $searchRegex = '#('; $x = 0; foreach ($searchwords as $k => $hlword) { $searchRegex .= ($x == 0 ? '' : '|'); $searchRegex .= preg_quote($hlword, '#'); $x++; } $searchRegex .= ')#iu'; $row = preg_replace($searchRegex, '\0', $row ); $result =& $results[$i]; if ($result->created) { $created = JHTML::Date ( $result->created ); } else { $created = ''; } $result->created = $created; $result->count = $i + 1; } } $this->result = JText::sprintf( 'TOTALRESULTSFOUND', $total ); $this->assignRef('pagination', $pagination); $this->assignRef('results', $results); $this->assignRef('lists', $lists); $this->assignRef('params', $params); $this->assign('ordering', $state->get('ordering')); $this->assign('searchword', $searchword); $this->assign('searchphrase', $state->get('match')); $this->assign('searchareas', $areas); $this->assign('total', $total); $this->assign('error', $error); $this->assign('action', $uri->toString()); parent::display($tpl); } } joomla/joomla/components/com_search/views/search/index.html0000766000000000000000000000005411234314122025367 0ustar adminadministratorsjoomla/joomla/components/com_search/views/index.html0000766000000000000000000000005411234314122024122 0ustar adminadministratorsjoomla/joomla/components/com_search/controller.php0000766000000000000000000000517511234314122023675 0ustar adminadministrators get stripped anyway later on. # causes problems. $badchars = array('#','>','<','\\'); $searchword = trim(str_replace($badchars, '', JRequest::getString('searchword', null, 'post'))); // if searchword enclosed in double quotes, strip quotes and do exact match if (substr($searchword,0,1) == '"' && substr($searchword, -1) == '"') { $post['searchword'] = substr($searchword,1,-1); JRequest::setVar('searchphrase', 'exact'); } else { $post['searchword'] = $searchword; } $post['ordering'] = JRequest::getWord('ordering', null, 'post'); $post['searchphrase'] = JRequest::getWord('searchphrase', 'all', 'post'); $post['limit'] = JRequest::getInt('limit', null, 'post'); if($post['limit'] === null) unset($post['limit']); $areas = JRequest::getVar('areas', null, 'post', 'array'); if ($areas) { foreach($areas as $area) { $post['areas'][] = JFilterInput::clean($area, 'cmd'); } } // No need to guess Itemid if it's already present in the URL if (JRequest::getInt('Itemid') > 0) { $post['Itemid'] = JRequest::getInt('Itemid'); } else { // set Itemid id for links $menu = &JSite::getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search&view=search'); if(isset($items[0])) { $post['Itemid'] = $items[0]->id; } } unset($post['task']); unset($post['submit']); $uri = JURI::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search'); $this->setRedirect(JRoute::_('index.php'.$uri->toString(array('query', 'fragment')), false)); } } joomla/joomla/components/com_search/search.php0000766000000000000000000000165211234314122022753 0ustar adminadministratorsexecute(JRequest::getCmd('task')); // Redirect if set by the controller $controller->redirect();joomla/joomla/components/com_search/index.html0000766000000000000000000000005411234314122022765 0ustar adminadministratorsjoomla/joomla/components/com_search/models/0000777000000000000000000000000011266551227022271 5ustar adminadministratorsjoomla/joomla/components/com_search/models/search.php0000766000000000000000000001115111234314122024231 0ustar adminadministratorssetState('limit', $mainframe->getUserStateFromRequest('com_search.limit', 'limit', $config->getValue('config.list_limit'), 'int')); $this->setState('limitstart', JRequest::getVar('limitstart', 0, '', 'int')); // Set the search parameters $keyword = urldecode(JRequest::getString('searchword')); $match = JRequest::getWord('searchphrase', 'all'); $ordering = JRequest::getWord('ordering', 'newest'); $this->setSearch($keyword, $match, $ordering); //Set the search areas $areas = JRequest::getVar('areas'); $this->setAreas($areas); } /** * Method to set the search parameters * * @access public * @param string search string * @param string mathcing option, exact|any|all * @param string ordering option, newest|oldest|popular|alpha|category */ function setSearch($keyword, $match = 'all', $ordering = 'newest') { if(isset($keyword)) { $this->setState('keyword', $keyword); } if(isset($match)) { $this->setState('match', $match); } if(isset($ordering)) { $this->setState('ordering', $ordering); } } /** * Method to set the search areas * * @access public * @param array Active areas * @param array Search areas */ function setAreas($active = array(), $search = array()) { $this->_areas['active'] = $active; $this->_areas['search'] = $search; } /** * Method to get weblink item data for the category * * @access public * @return array */ function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $areas = $this->getAreas(); JPluginHelper::importPlugin( 'search'); $dispatcher =& JDispatcher::getInstance(); $results = $dispatcher->trigger( 'onSearch', array( $this->getState('keyword'), $this->getState('match'), $this->getState('ordering'), $areas['active']) ); $rows = array(); foreach($results AS $result) { $rows = array_merge( (array) $rows, (array) $result); } $this->_total = count($rows); if($this->getState('limit') > 0) { $this->_data = array_splice($rows, $this->getState('limitstart'), $this->getState('limit')); } else { $this->_data = $rows; } } return $this->_data; } /** * Method to get the total number of weblink items for the category * * @access public * @return integer */ function getTotal() { return $this->_total; } /** * Method to get a pagination object of the weblink items for the category * * @access public * @return integer */ function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { jimport('joomla.html.pagination'); $this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') ); } return $this->_pagination; } /** * Method to get the search areas * * @since 1.5 */ function getAreas() { global $mainframe; // Load the Category data if (empty($this->_areas['search'])) { $areas = array(); JPluginHelper::importPlugin( 'search'); $dispatcher =& JDispatcher::getInstance(); $searchareas = $dispatcher->trigger( 'onSearchAreas' ); foreach ($searchareas as $area) { $areas = array_merge( $areas, $area ); } $this->_areas['search'] = $areas; } return $this->_areas; } } joomla/joomla/components/com_search/models/index.html0000766000000000000000000000005411234314122024250 0ustar adminadministratorsjoomla/joomla/components/index.html0000766000000000000000000000005711234314116020670 0ustar adminadministrators joomla/joomla/components/com_media/0000777000000000000000000000000011266551234020616 5ustar adminadministratorsjoomla/joomla/components/com_media/assets/0000777000000000000000000000000011266551235022121 5ustar adminadministratorsjoomla/joomla/components/com_media/assets/arrow.png0000766000000000000000000000054211234314126023752 0ustar adminadministratorsPNG  IHDR ?sBITOEPLTE[ܶuVْt~Sw_wThQޖuvTOtRNS 5 pHYs  ~tEXtCreation Time02/08/06{tEXtSoftwareMacromedia Fireworks 8hxDIDATcge~^.8Ga0Eln&03ExxY! xa Am"ЕIENDB`joomla/joomla/components/com_media/assets/popup-imagelist.css0000766000000000000000000000244411234314126025746 0ustar adminadministrators/** * @version $Id: popup-imagelist.css 3997 2006-06-12 03:59:51Z spacemonkey $ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * JImageManager imagelist styling * * @author Johan Janssens * @package Joomla * @since 1.5 * @version 1.0 */ html, body { margin: 0; padding: 0; font: 10px Tahoma, Verdana, sans-serif; } .item { float: left; border: 1px solid #ccc; margin: 3px; position: relative; } .item a { display: table-cell; _display: block; width: 80px; height: 80px; vertical-align:middle; text-align: center; text-decoration: none; color: black; } .item a:hover { background-color: white; } .item img { border: 0 none; margin-top: expression(( 80 - this.height ) / 2); } .item span { display: block; width: 76px; position: absolute; bottom: 0; padding: 2px; background-color: #ddd; filter:alpha(opacity=70); -moz-opacity: 0.70; opacity: 0.70; } joomla/joomla/components/com_media/assets/popup-imagemanager.css0000766000000000000000000000444011234314126026403 0ustar adminadministrators/** * @version $Id: popup-imagemanager.css 6668 2007-02-18 19:13:36Z hackwar $ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * ImageManager javascript behavior styling * * @author Johan Janssens * @package Joomla * @since 1.5 * @version 1.0 */ html, body { background-color: #F0F0F0; color: ButtonText; font: 11px Tahoma, Verdana, sans-serif; margin: 0; padding: 0; } img { border: 0 none; } form { padding: 0px; margin: 0 auto; width: 550px; padding-top: 5px; } fieldset { margin-top: 0.5em; border: 1px solid #CCCCCC; padding-top: 10px; } button { padding: 3px; border: 1px solid #CCCCCC; font-weight: bold; color: #0B55C4; background-color: white; } button:hover { border: 1px solid #0B55C4; } select,input,button { font: 11px Tahoma, Verdana, sans-serif; } iframe { width: 100%; overflow-x: false; border: 0 none; margin: 0; padding: 0; margin-top: 0.5em;} iframe#imageframe { height: 175px; } iframe#uploadview { height: 40px; } a { padding: 5px; border: 1px solid ButtonFace; } a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } .buttons { width: 70px; text-align: center; } #f_alt, #f_url, #f_title { width: 22em; } #messages { position: relative; left: 175px; top: 115px; background-color: white; width: 200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; } #message { font-size: 15px; font-weight: bold; color: #69c; } #uploadpanel { border: 1px solid #ccc; margin: 5px 2px 0 2px;} #uploadpanel .title { padding: 4px; margin: 0; cursor: pointer;} #uploadpane { } #uploadpanel .toggler span { background: transparent url(arrow.png) 0 50% no-repeat; padding-left: 20px;} #uploadpanel .toggler-down span { background: transparent url(arrow-down.png) 0 50% no-repeat; padding-left: 20px;} #uploadpanel .toggler-down { border-bottom: 1px solid #ccc; }joomla/joomla/components/com_media/assets/arrow-down.png0000766000000000000000000000053511234314126024721 0ustar adminadministratorsPNG  IHDR ?sBITOHPLTE[ȒZR؋egewfUc~Rgk·iSctRNSVs pHYs  ~tEXtCreation Time02/08/06{tEXtSoftwareMacromedia Fireworks 8hx;IDATcLN!vnn66a>!.0*`dSfaIENDB`joomla/joomla/components/com_media/assets/index.html0000766000000000000000000000005711234314126024110 0ustar adminadministrators joomla/joomla/components/com_media/assets/popup-imagemanager.js0000766000000000000000000001365511234314126026237 0ustar adminadministrators/** * @version $Id: popup-imagemanager.js 8656 2007-08-30 22:40:39Z louis $ * @package Joomla * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * JImageManager behavior for media component * * @package Joomla.Extensions * @subpackage Media * @since 1.5 */ var ImageManager = { initialize: function() { o = this._getUriObject(window.self.location.href); //console.log(o); q = $H(this._getQueryObject(o.query)); this.editor = decodeURIComponent(q.get('e_name')); // Setup image manager fields object this.fields = new Object(); this.fields.url = $("f_url"); this.fields.alt = $("f_alt"); this.fields.align = $("f_align"); this.fields.title = $("f_title"); this.fields.caption = $("f_caption"); // Setup image listing objects this.folderlist = $('folderlist'); this.frame = window.frames['imageframe']; this.frameurl = this.frame.location.href; // Setup imave listing frame this.imageframe = $('imageframe'); this.imageframe.manager = this; this.imageframe.addEvent('load', function(){ ImageManager.onloadimageview(); }); // Setup folder up button this.upbutton = $('upbutton'); this.upbutton.removeEvents('click'); this.upbutton.addEvent('click', function(){ ImageManager.upFolder(); }); }, onloadimageview: function() { // Update the frame url this.frameurl = this.frame.location.href; var folder = this.getImageFolder(); for(var i = 0; i < this.folderlist.length; i++) { if(folder == this.folderlist.options[i].value) { this.folderlist.selectedIndex = i; break; } } a = this._getUriObject($('uploadForm').getProperty('action')); //console.log(a); q = $H(this._getQueryObject(a.query)); q.set('folder', folder); var query = []; q.each(function(v, k){ if ($chk(v)) { this.push(k+'='+v); } }, query); a.query = query.join('&'); $('uploadForm').setProperty('action', a.scheme+'://'+a.domain+a.path+'?'+a.query); }, getImageFolder: function() { var url = this.frame.location.search.substring(1); var args = this.parseQuery(url); return args['folder']; }, onok: function() { extra = ''; // Get the image tag field information var url = this.fields.url.getValue(); var alt = this.fields.alt.getValue(); var align = this.fields.align.getValue(); var title = this.fields.title.getValue(); var caption = this.fields.caption.getValue(); if (url != '') { // Set alt attribute if (alt != '') { extra = extra + 'alt="'+alt+'" '; } else { extra = extra + 'alt="" '; } // Set align attribute if (align != '') { extra = extra + 'align="'+align+'" '; } // Set align attribute if (title != '') { extra = extra + 'title="'+title+'" '; } // Set align attribute if (caption != '') { extra = extra + 'class="caption" '; } var tag = ""; } window.parent.jInsertEditorText(tag, this.editor); return false; }, setFolder: function(folder) { //this.showMessage('Loading'); for(var i = 0; i < this.folderlist.length; i++) { if(folder == this.folderlist.options[i].value) { this.folderlist.selectedIndex = i; break; } } this.frame.location.href='index.php?option=com_media&view=imagesList&tmpl=component&folder=' + folder; }, getFolder: function() { return this.folderlist.getValue(); }, upFolder: function() { var currentFolder = this.getFolder(); if(currentFolder.length < 2) { return false; } var folders = currentFolder.split('/'); var search = ''; for(var i = 0; i < folders.length - 1; i++) { search += folders[i]; search += '/'; } // remove the trailing slash search = search.substring(0, search.length - 1); for(var i = 0; i < this.folderlist.length; i++) { var thisFolder = this.folderlist.options[i].value; if(thisFolder == search) { this.folderlist.selectedIndex = i; var newFolder = this.folderlist.options[i].value; this.setFolder(newFolder); break; } } }, populateFields: function(file) { $("f_url").value = image_base_path+file; }, showMessage: function(text) { var message = $('message'); var messages = $('messages'); if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(document.createTextNode(text)); messages.style.display = "block"; }, parseQuery: function(query) { var params = new Object(); if (!query) { return params; } var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var KeyVal = pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) { continue; } var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ).replace(/\+ /g, ' '); params[key] = val; } return params; }, refreshFrame: function() { this._setFrameUrl(); }, _setFrameUrl: function(url) { if ($chk(url)) { this.frameurl = url; } this.frame.location.href = this.frameurl; }, _getQueryObject: function(q) { var vars = q.split(/[&;]/); var rs = {}; if (vars.length) vars.each(function(val) { var keys = val.split('='); if (keys.length && keys.length == 2) rs[encodeURIComponent(keys[0])] = encodeURIComponent(keys[1]); }); return rs; }, _getUriObject: function(u){ var bits = u.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/); return (bits) ? bits.associate(['uri', 'scheme', 'authority', 'domain', 'port', 'path', 'directory', 'file', 'query', 'fragment']) : null; } }; window.addEvent('domready', function(){ ImageManager.initialize(); }); joomla/joomla/components/com_media/helpers/0000777000000000000000000000000011266551234022260 5ustar adminadministratorsjoomla/joomla/components/com_media/helpers/index.html0000766000000000000000000000005711234314126024250 0ustar adminadministrators joomla/joomla/components/com_media/helpers/media.php0000766000000000000000000000633311234314126024046 0ustar adminadministratorsget( 'upload_extensions' )); if (!in_array($format, $allowable)) { $err = 'This file type is not supported'; return false; } $maxSize = (int) $params->get( 'upload_maxsize', 0 ); if ($maxSize > 0 && (int) $file['size'] > $maxSize) { $err = 'This file is too large to upload'; return false; } return true; } function parseSize($size) { if ($size < 1024) { return $size . ' bytes'; } else { if ($size >= 1024 && $size < 1024 * 1024) { return sprintf('%01.2f', $size / 1024.0) . ' Kb'; } else { return sprintf('%01.2f', $size / (1024.0 * 1024)) . ' Mb'; } } } function imageResize($width, $height, $target) { //takes the larger size of the width and height and applies the //formula accordingly...this is so this script will work //dynamically with any size image if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } //gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); //returns the new sizes in html image tag format...this is so you //can plug this function inside an image tag and just get the return "width=\"$width\" height=\"$height\""; } function countFiles( $dir ) { $total_file = 0; $total_dir = 0; if (is_dir($dir)) { $d = dir($dir); while (false !== ($entry = $d->read())) { if (substr($entry, 0, 1) != '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) && strpos($entry, '.html') === false && strpos($entry, '.php') === false) { $total_file++; } if (substr($entry, 0, 1) != '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry)) { $total_dir++; } } $d->close(); } return array ( $total_file, $total_dir ); } } ?>joomla/joomla/components/com_media/controller.php0000766000000000000000000000355111234314126023507 0ustar adminadministratorsgetType(); // Get/Create the view $view = &$this->getView( $vName, $vType); $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.strtolower($vName).DS.'tmpl'); // Get/Create the model if ($model = &$this->getModel($mName)) { // Push the model into the view (as default) $view->setModel($model, true); } // Set the layout $view->setLayout($vLayout); // Display the view $view->display(); } function ftpValidate() { // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); } } joomla/joomla/components/com_media/images/0000777000000000000000000000000011266551234022063 5ustar adminadministratorsjoomla/joomla/components/com_media/images/dots.gif0000766000000000000000000000026511234314126023517 0ustar adminadministratorsGIF89a 挵f! NETSCAPE2.0!, 0I8MC` BrN!,  8CL3! , H0I8M`BrN;joomla/joomla/components/com_media/images/folder.gif0000766000000000000000000000241511234314126024020 0ustar adminadministratorsGIF89aPPm4aqqq٪fcY̙߿SוhؿrߪxlEҍtѫ9f߹Ч+yIՂٳA篯ݷܼ] ͝o恡by$ٱ:ѲSlfRK{u֬1̉棣Ô}ߨp]ӣ9|||Tٳ+޵Rݞs'rҡŞ9#ҥܶGDpgJϝֹdZ~]0٫)Tvfffl~s1Hӭ;x!~,PP~?@YnE؏@c&*%XDB6٤E+%Òe\rRGoaChIOH Hix' ™Jrj衆jQ¤Vj饖*:G C*j 7Y 葂꫰z*뮼jjf0ő)`B&¡jApG,J*9hp_( 0B\ Y+YZ(@0P@4a* 7jA {F{> A~/.' gk1Th164@(#` K! DrOWmXg\w`-dmhv ;joomla/joomla/components/com_media/index.html0000766000000000000000000000005711234314126022606 0ustar adminadministrators joomla/joomla/components/com_media/media.php0000766000000000000000000000477411234314126022413 0ustar adminadministratorsauthorize( 'com_media', 'popup' )) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } // Set the path definitions define('COM_MEDIA_BASE', JPATH_ROOT.DS.$params->get('image_path', 'images'.DS.'stories')); define('COM_MEDIA_BASEURL', JURI::root(true).'/'.$params->get('image_path', 'images/stories')); // Load the admin HTML view require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'media.php' ); // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); $cmd = JRequest::getCmd('task', null); if (strpos($cmd, '.') != false) { // We have a defined controller/task pair -- lets split them out list($controllerName, $task) = explode('.', $cmd); // Define the controller name and path $controllerName = strtolower($controllerName); $controllerPath = JPATH_COMPONENT_ADMINISTRATOR.DS.'controllers'.DS.$controllerName.'.php'; // If the controller file path exists, include it ... else lets die with a 500 error if (file_exists($controllerPath)) { require_once($controllerPath); } else { JError::raiseError(500, 'Invalid Controller'); } } else { // Base controller, just set the task :) $controllerName = null; $task = $cmd; } // Set the name for the controller and instantiate it $controllerClass = 'MediaController'.ucfirst($controllerName); if (class_exists($controllerClass)) { $controller = new $controllerClass(); } else { JError::raiseError(500, 'Invalid Controller Class'); } // Set the model and view paths to the administrator folders $controller->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'); $controller->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models'); // Perform the Request task $controller->execute($task); // Redirect if set by the controller $controller->redirect(); joomla/joomla/components/com_weblinks/0000777000000000000000000000000011266551217021356 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/router.php0000766000000000000000000001727311234314126023411 0ustar adminadministratorsgetItems('componentid', $component->id); } // Search for an appropriate menu item. if (is_array($items)) { // If only the option and itemid are specified in the query, return that item. if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) { $itemid = (int) $query['Itemid']; } // Search for a specific link based on the critera given. if (!$itemid) { foreach ($items as $item) { // Check if this menu item links to this view. if (isset($item->query['view']) && $item->query['view'] == 'weblink' && isset($query['view']) && $query['view'] != 'category' && isset($item->query['id']) && $item->query['id'] == $query['id']) { $itemid = $item->id; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($query['view']) && $query['view'] != 'weblink' && isset($item->query['catid']) && $item->query['catid'] == $query['catid']) { $itemid = $item->id; } } } // If no specific link has been found, search for a general one. if (!$itemid) { foreach ($items as $item) { if (isset($query['view']) && $query['view'] == 'weblink' && isset($item->query['view']) && $item->query['view'] == 'category' && isset($item->query['id']) && isset($query['catid']) && $query['catid'] == $item->query['id']) { // This menu item links to the weblink view but we need to append the weblink id to it. $itemid = $item->id; $segments[] = isset($query['catalias']) ? $query['catid'].':'.$query['catalias'] : $query['catid']; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } elseif (isset($query['view']) && $query['view'] == 'category' && isset($item->query['view']) && $item->query['view'] == 'category' && isset($item->query['id']) && isset($query['id']) && $item->query['id'] == $query['id']) { // This menu item links to the category view but we need to append the category id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } // Search for an even more general link. if (!$itemid) { foreach ($items as $item) { if (isset($query['view']) && $query['view'] == 'weblink' && isset($item->query['view']) && $item->query['view'] == 'categories' && isset($query['catid']) && isset($query['id'])) { // This menu item links to the categories view but we need to append the category and weblink id to it. $itemid = $item->id; $segments[] = isset($query['catalias']) ? $query['catid'].':'.$query['catalias'] : $query['catid']; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } elseif (isset($query['view']) && $query['view'] == 'category' && isset($item->query['view']) && $item->query['view'] == 'categories' && !isset($query['catid'])) { // This menu item links to the categories view but we need to append the category id to it. $itemid = $item->id; $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; break; } } } } // Check if the router found an appropriate itemid. if (!$itemid) { // Check if a category was specified if (isset($query['view']) && $query['view'] == 'category' && isset($query['id'])) { if (isset($query['alias'])) { $query['id'] .= ':'.$query['alias']; } // Push the catid onto the stack. $segments[] = $query['id']; unset($query['view']); unset($query['id']); unset($query['alias']); } // Check if a id was specified. elseif (isset($query['id'])) { if (isset($query['catalias'])) { $query['catid'] .= ':'.$query['catalias']; } // Push the catid onto the stack. $segments[] = $query['catid']; if (isset($query['alias'])) { $query['id'] .= ':'.$query['alias']; } // Push the id onto the stack. $segments[] = $query['id']; unset($query['view']); unset($query['id']); unset($query['alias']); unset($query['catid']); unset($query['catalias']); } elseif (isset($query['catid'])) { if (isset($query['alias'])) { $query['catid'] .= ':'.$query['catalias']; } // Push the catid onto the stack. $segments[] = 'category'; $segments[] = $query['catid']; unset($query['view']); unset($query['catid']); unset($query['catalias']); unset($query['alias']); } else { // Categories view. unset($query['view']); } } else { $query['Itemid'] = $itemid; // Remove the unnecessary URL segments. unset($query['view']); unset($query['id']); unset($query['alias']); unset($query['catid']); unset($query['catalias']); } return $segments; } function WeblinksParseRoute($segments) { $vars = array(); // Get the active menu item. $menu = &JSite::getMenu(); $item = &$menu->getActive(); // Check if we have a valid menu item. if (is_object($item)) { // Proceed through the possible variations trying to match the most specific one. if (isset($item->query['view']) && $item->query['view'] == 'weblink' && isset($segments[0])) { // Contact view. $vars['view'] = 'weblink'; $vars['id'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && count($segments) == 2) { // Weblink view. $vars['view'] = 'weblink'; $vars['id'] = $segments[1]; $vars['catid'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'category' && isset($segments[0])) { // Category view. $vars['view'] = 'category'; $vars['id'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'categories' && count($segments) == 2) { // Weblink view. $vars['view'] = 'weblink'; $vars['id'] = $segments[1]; $vars['catid'] = $segments[0]; } elseif (isset($item->query['view']) && $item->query['view'] == 'categories' && isset($segments[0])) { // Category view. $vars['view'] = 'category'; $vars['id'] = $segments[0]; } } else { // Count route segments $count = count($segments); // Check if there are any route segments to handle. if ($count) { if ($count == 2) { // We are viewing a weblink. $vars['view'] = 'weblink'; $vars['catid'] = $segments[$count-2]; $vars['id'] = $segments[$count-1]; } else { // We are viewing a category. $vars['view'] = 'category'; $vars['id'] = $segments[$count-1]; } } } return $vars; } joomla/joomla/components/com_weblinks/metadata.xml0000766000000000000000000000007711234314130023647 0ustar adminadministrators joomla/joomla/components/com_weblinks/helpers/0000777000000000000000000000000011266551217023020 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/helpers/index.html0000766000000000000000000000005411234314130024777 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/helpers/route.php0000766000000000000000000000340411234314130024653 0ustar adminadministrators (int) $catid, 'categories' => null ); //Find the itemid $itemid = WeblinksHelperRoute::_findItem($needles); $itemid = $itemid ? '&Itemid='.$itemid : ''; //Create the link $link = 'index.php?option=com_weblinks&view=weblink&id='. $id . '&catid='.$catid . $itemid; return $link; } function _findItem($needles) { static $items; if (!$items) { $component =& JComponentHelper::getComponent('com_weblinks'); $menu = &JSite::getMenu(); $items = $menu->getItems('componentid', $component->id); } if (!is_array($items)) { return null; } $match = null; foreach($needles as $needle => $id) { foreach($items as $item) { if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id)) { $match = $item->id; break; } } if(isset($match)) { break; } } return $match; } } ?> joomla/joomla/components/com_weblinks/weblinks.php0000766000000000000000000000227511234314126023703 0ustar adminadministratorsexecute(JRequest::getCmd('task')); // Redirect if set by the controller $controller->redirect(); joomla/joomla/components/com_weblinks/controllers/0000777000000000000000000000000011266551217023724 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/controllers/index.html0000766000000000000000000000005411234314126025710 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/controllers/weblink.php0000766000000000000000000000633111234314126026063 0ustar adminadministratorsget('aid', 0) < 1) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } JRequest::setVar('view', 'weblink'); JRequest::setVar('layout', 'form'); $model =& $this->getModel('weblink'); $model->checkout(); parent::display(); } /** * Saves the record on an edit form submit * * @acces public * @since 1.5 */ function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some objects from the JApplication $db =& JFactory::getDBO(); $user =& JFactory::getUser(); // Must be logged in if ($user->get('id') < 1) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } //get data from the request $post = JRequest::getVar('jform', array(), 'post', 'array'); $model = $this->getModel('weblink'); if ($model->store($post)) { $msg = JText::_( 'Weblink Saved' ); } else { $msg = JText::_( 'Error Saving Weblink' ); } // Check the table in so it can be edited.... we are done with it anyway $model->checkin(); // admin users gid $gid = 25; // list of admins $query = 'SELECT email, name' . ' FROM #__users' . ' WHERE gid = ' . $gid . ' AND sendEmail = 1'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->stderr(true)); return; } $adminRows = $db->loadObjectList(); // send email notification to admins foreach ($adminRows as $adminRow) { JUtility::sendAdminMail($adminRow->name, $adminRow->email, '', JText::_('Web Link'), $post['title']." URL link ".$post[url], $user->get('username'), JURI::base()); } $this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=category&id='.$post['catid'], false), $msg); } /** * Cancel the editing of a web link * * @access public * @since 1.5 */ function cancel() { // Get some objects from the JApplication $user = & JFactory::getUser(); // Must be logged in if ($user->get('id') < 1) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } // Checkin the weblink $model = $this->getModel('weblink'); $model->checkin(); $this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=categories', false)); } } ?> joomla/joomla/components/com_weblinks/views/0000777000000000000000000000000011266551215022511 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/weblink/0000777000000000000000000000000011266551214024143 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/weblink/tmpl/0000777000000000000000000000000011266551215025120 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/weblink/tmpl/default.xml0000766000000000000000000000050511234314130027253 0ustar adminadministrators Weblink Layout This layout shows a single weblink. joomla/joomla/components/com_weblinks/views/weblink/tmpl/form.php0000766000000000000000000000632411234314130026566 0ustar adminadministrators
    params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    lists['catid']; ?>
    lists['published']; ?>
    lists['ordering']; ?>
    joomla/joomla/components/com_weblinks/views/weblink/tmpl/form.xml0000766000000000000000000000052611234314130026575 0ustar adminadministrators WEBLINK SUBMISSION LAYOUT WEBLINK SUBMISSION LAYOUT DESC joomla/joomla/components/com_weblinks/views/weblink/tmpl/index.html0000766000000000000000000000005411234314130027101 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/weblink/view.html.php0000766000000000000000000001150611234314130026562 0ustar adminadministratorsgetLayout() == 'form') { $this->_displayForm($tpl); return; } //get the weblink $weblink =& $this->get('data'); if ($weblink->url) { // redirects to url if matching id found $mainframe->redirect($weblink->url); } parent::display($tpl); } function _displayForm($tpl) { global $mainframe; // Get some objects from the JApplication $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $model =& $this->getModel(); $user =& JFactory::getUser(); $uri =& JFactory::getURI(); $params = &$mainframe->getParams(); // Make sure you are logged in and have the necessary access rights if ($user->get('gid') < 19) { JResponse::setHeader('HTTP/1.0 403',true); JError::raiseWarning( 403, JText::_('ALERTNOTAUTH') ); return; } //get the weblink $weblink =& $this->get('data'); $isNew = ($weblink->id < 1); // Edit or Create? if (!$isNew) { // Is this link checked out? If not by me fail //if ($model->isCheckedOut($user->get('id'))) { // $mainframe->redirect("index.php?option=$option", "The weblink $weblink->title is currently being edited by another administrator."); //} // Set page title $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Web Links'.' - '.JText::_('Edit') )); } } else { $params->set('page_title', JText::_( 'Web Links'.' - '.JText::_('Edit') )); } $document->setTitle( $params->get( 'page_title' ) ); //set breadcrumbs if($item->query['view'] != 'weblink') { switch ($item->query['view']) { case 'categories': $pathway->addItem($weblink->category, 'index.php?view=category&id='.$weblink->catid); $pathway->addItem(JText::_('Edit').' '.$weblink->title, ''); break; case 'category': $pathway->addItem(JText::_('Edit').' '.$weblink->title, ''); break; } } } else { /* * The web link does not already exist so we are creating a new one. Here * we want to manipulate the pathway and pagetitle to indicate this. Also, * we need to initialize some values. */ $weblink->published = 0; $weblink->approved = 1; $weblink->ordering = 0; // Set page title // Set page title $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_('Submit a Web Link') ); } } else { $params->set('page_title', JText::_('Submit a Web Link') ); } $document->setTitle( $params->get( 'page_title' ) ); // Add pathway item $pathway->addItem(JText::_('New'), ''); } // build list of categories $lists['catid'] = JHTML::_('list.category', 'jform[catid]', 'com_weblinks', intval($weblink->catid)); // build the html select list for ordering $query = 'SELECT ordering AS value, title AS text' . ' FROM #__weblinks' . ' WHERE catid = ' . (int) $weblink->catid . ' ORDER BY ordering'; $lists['ordering'] = JHTML::_('list.specificordering', $weblink, $weblink->id, $query ); // Radio Buttons: Should the article be published $lists['published'] = JHTML::_('select.booleanlist', 'jform[published]', 'class="inputbox"', $weblink->published ); JFilterOutput::objectHTMLSafe( $weblink, ENT_QUOTES, 'description' ); $this->assign('action', $uri->toString()); $this->assignRef('lists' , $lists); $this->assignRef('weblink' , $weblink); $this->assignRef('params' , $params); parent::display($tpl); } } ?> joomla/joomla/components/com_weblinks/views/weblink/index.html0000766000000000000000000000005411234314130026125 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/categories/0000777000000000000000000000000011266551216024637 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/categories/tmpl/0000777000000000000000000000000011266551217025614 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/categories/tmpl/default.xml0000766000000000000000000000156411234314130027753 0ustar adminadministrators WEBLINK CATEGORY LIST LAYOUT WEBLINK CATEGORY LIST LAYOUT DESC joomla/joomla/components/com_weblinks/views/categories/tmpl/default.php0000766000000000000000000000231311234314130027733 0ustar adminadministrators params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    params->def('image', -1) != -1) || $this->params->def('show_comp_description', 1) ) : ?>
    image) ) : echo $this->image; endif; echo $this->params->get('comp_description'); ?>
    joomla/joomla/components/com_weblinks/views/categories/tmpl/index.html0000766000000000000000000000005411234314130027573 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/categories/metadata.xml0000766000000000000000000000023611234314130027126 0ustar adminadministrators joomla/joomla/components/com_weblinks/views/categories/view.html.php0000766000000000000000000000507311234314130027256 0ustar adminadministratorsget('data'); $total =& $this->get('total'); $state =& $this->get('state'); // Get the page/component configuration $params = &$mainframe->getParams(); $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', JText::_( 'Web Links' )); } } else { $params->set('page_title', JText::_( 'Web Links' )); } $document->setTitle( $params->get( 'page_title' ) ); // Set some defaults if not set for params $params->def('comp_description', JText::_('WEBLINKS_DESC')); // Define image tag attributes if ($params->get('image') != -1) { if($params->get('image_align')!="") $attribs['align'] = $params->get('image_align'); else $attribs['align'] = ''; $attribs['hspace'] = 6; // Use the static HTML library to build the image tag $image = JHTML::_('image', 'images/stories/'.$params->get('image'), JText::_('Web Links'), $attribs); } for($i = 0; $i < count($categories); $i++) { $category =& $categories[$i]; $category->link = JRoute::_('index.php?option=com_weblinks&view=category&id='. $category->slug); // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); } $this->assignRef('image', $image); $this->assignRef('params', $params); $this->assignRef('categories', $categories); parent::display($tpl); } } ?> joomla/joomla/components/com_weblinks/views/categories/index.html0000766000000000000000000000005411234314130026617 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/index.html0000766000000000000000000000005411234314130024472 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/category/0000777000000000000000000000000011266551215024326 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/category/tmpl/0000777000000000000000000000000011266551215025302 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/category/tmpl/default.xml0000766000000000000000000000126311234314130027437 0ustar adminadministrators WEBLINK STANDARD CATEGORY LAYOUT WEBLINK STANDARD CATEGORY LAYOUT DESC joomla/joomla/components/com_weblinks/views/category/tmpl/default.php0000766000000000000000000000261311234314130027426 0ustar adminadministrators params->def( 'show_page_title', 1 ) ) : ?>
    escape($this->params->get('page_title')); ?>
    category->image || @$this->category->description ) : ?> params->get('show_other_cats', 1)): ?>
    category->image) ) : echo $this->category->image; endif; echo $this->category->description; ?>
    loadTemplate('items'); ?>
    joomla/joomla/components/com_weblinks/views/category/tmpl/default_items.php0000766000000000000000000000513611234314130030632 0ustar adminadministrators
    params->def( 'show_headings', 1 ) ) : ?> params->get( 'show_link_hits' ) ) : ?> items as $item) : ?> params->get( 'show_link_hits' ) ) : ?>
    pagination->getLimitBox(); ?>
    lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?>
    pagination->getRowOffset( $item->count ); ?> image ) : ?>   image;?>   link; ?> params->get( 'show_link_description' ) ) : ?>
    escape($item->description)); ?>
    hits; ?>
    pagination->getPagesLinks(); ?>
    pagination->getPagesCounter(); ?>
    joomla/joomla/components/com_weblinks/views/category/tmpl/index.html0000766000000000000000000000005411234314130027263 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/category/metadata.xml0000766000000000000000000000022611234314130026615 0ustar adminadministrators joomla/joomla/components/com_weblinks/views/category/view.html.php0000766000000000000000000001237511234314130026751 0ustar adminadministratorsgetPathway(); // Get the parameters of the active menu item $menus = &JSite::getMenu(); $menu = $menus->getActive(); // Get some data from the model $items = &$this->get('data' ); $total = &$this->get('total'); $pagination = &$this->get('pagination'); $category = &$this->get('category' ); $state = &$this->get('state'); $model =& JModel::getInstance('categories', 'weblinksmodel'); $categories =& $model->getData(); // Get the page/component configuration $params = &$mainframe->getParams(); $category->total = $total; // Add alternate feed link if($params->get('show_feed_link', 1) == 1) { $link = '&view=category&id='.$category->slug.'&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } $menus = &JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object( $menu )) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $category->title); } } else { $params->set('page_title', $category->title); } $document->setTitle( $params->get( 'page_title' ) ); //set breadcrumbs if(is_object($menu) && $menu->query['view'] != 'category') { $pathway->addItem($category->title, ''); } // Prepare category description $category->description = JHTML::_('content.prepare', $category->description); // table ordering $lists['order_Dir'] = $state->get('filter_order_dir'); $lists['order'] = $state->get('filter_order'); // Set some defaults if not set for params $params->def('comp_description', JText::_('WEBLINKS_DESC')); // Define image tag attributes if (isset( $category->image ) && $category->image != '') { $attribs['align'] = $category->image_position; $attribs['hspace'] = 6; // Use the static HTML library to build the image tag $category->image = JHTML::_('image', 'images/stories/'.$category->image, JText::_('Web Links'), $attribs); } // icon in table display if ( $params->get( 'link_icons' ) <> -1 ) { $image = JHTML::_('image.site', $params->get('link_icons', 'weblink.png'), '/images/M_images/', $params->get( 'weblink_icons' ), '/images/M_images/', 'Link' ); } $k = 0; $count = count($items); for($i = 0; $i < $count; $i++) { $item =& $items[$i]; $link = JRoute::_( 'index.php?view=weblink&catid='.$category->slug.'&id='. $item->slug); $menuclass = 'category'.$this->escape($params->get( 'pageclass_sfx' )); $itemParams = new JParameter($item->params); switch ($itemParams->get('target', $params->get('target'))) { // cases are slightly different case 1: // open in a new window $item->link = ''. $this->escape($item->title) .''; break; case 2: // open in a popup window $item->link = "". $this->escape($item->title) ."\n"; break; default: // formerly case 2 // open in parent window $item->link = ''. $this->escape($item->title) .''; break; } $item->image = $image; $item->odd = $k; $item->count = $i; $k = 1 - $k; } $count = count($categories); for($i = 0; $i < $count; $i++) { $cat =& $categories[$i]; $cat->link = JRoute::_('index.php?option=com_weblinks&view=category&id='. $cat->slug); } $this->assignRef('lists', $lists); $this->assignRef('params', $params); $this->assignRef('category', $category); $this->assignRef('categories', $categories); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assign('action', $uri->toString()); parent::display($tpl); } } joomla/joomla/components/com_weblinks/views/category/index.html0000766000000000000000000000005411234314130026307 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/views/category/view.feed.php0000766000000000000000000000423411234314130026703 0ustar adminadministratorslink = JRoute::_('index.php?option=com_weblinks&view=category&id='.JRequest::getVar('id',null, '', 'int')); JRequest::setVar('limit', $mainframe->getCfg('feed_limit')); $siteEmail = $mainframe->getCfg('mailfrom'); $fromName = $mainframe->getCfg('fromname'); $document->editor = $fromName; $document->editorEmail = $siteEmail; // Get some data from the model $items =& $this->get( 'data' ); $category =& $this->get( 'category' ); foreach ( $items as $item ) { // strip html from feed item title $title = $this->escape( $item->title ); $title = html_entity_decode( $title ); // url link to article $link = JRoute::_('index.php?option=com_weblinks&view=weblink&id='. $item->id ); // strip html from feed item description text $description = $item->description; $date = ( $item->date ? date( 'r', strtotime($item->date) ) : '' ); // load individual item creator class $feeditem = new JFeedItem(); $feeditem->title = $title; $feeditem->link = $link; $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = 'Weblinks'; // loads item info into rss array $document->addItem( $feeditem ); } } } ?> joomla/joomla/components/com_weblinks/controller.php0000766000000000000000000000241111234314126024240 0ustar adminadministratorsgetModel('weblink'); $model->hit(); } parent::display(); } }joomla/joomla/components/com_weblinks/index.html0000766000000000000000000000005411234314126023342 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/models/0000777000000000000000000000000011266551217022641 5ustar adminadministratorsjoomla/joomla/components/com_weblinks/models/categories.php0000766000000000000000000000461311234314130025466 0ustar adminadministrators_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query); } return $this->_data; } /** * Method to get the total number of weblink items for the category * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } function _buildQuery() { $user =& JFactory::getUser(); $aid = $user->get('aid', 0); //Query to retrieve all categories that belong under the web links section and that are published. $query = 'SELECT cc.*, COUNT(a.id) AS numlinks,' .' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug' .' FROM #__categories AS cc' .' LEFT JOIN #__weblinks AS a ON a.catid = cc.id' .' WHERE a.published = 1' .' AND section = \'com_weblinks\'' .' AND cc.published = 1' .' AND cc.access <= '.(int) $aid .' GROUP BY cc.id' .' ORDER BY cc.ordering'; return $query; } } ?> joomla/joomla/components/com_weblinks/models/category.php0000766000000000000000000001254311234314130025157 0ustar adminadministratorssetState('limit', $mainframe->getUserStateFromRequest('com_weblinks.limit', 'limit', $config->getValue('config.list_limit'), 'int')); $this->setState('limitstart', JRequest::getVar('limitstart', 0, '', 'int')); // In case limit has been changed, adjust limitstart accordingly $this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0)); // Get the filter request variables $this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering')); $this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC')); $id = JRequest::getVar('id', 0, '', 'int'); $this->setId((int)$id); } /** * Method to set the category id * * @access public * @param int Category ID number */ function setId($id) { // Set category ID and wipe data $this->_id = $id; $this->_category = null; } /** * Method to get weblink item data for the category * * @access public * @return array */ function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $total = count($this->_data); for($i = 0; $i < $total; $i++) { $item =& $this->_data[$i]; $item->slug = $item->id.':'.$item->alias; } } return $this->_data; } /** * Method to get the total number of weblink items for the category * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } /** * Method to get a pagination object of the weblink items for the category * * @access public * @return integer */ function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { jimport('joomla.html.pagination'); $this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') ); } return $this->_pagination; } /** * Method to get category data for the current category * * @since 1.5 */ function getCategory() { // Load the Category data if ($this->_loadCategory()) { // Initialize some variables $user = &JFactory::getUser(); // Make sure the category is published if (!$this->_category->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // check whether category access level allows access if ($this->_category->access > $user->get('aid', 0)) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); return false; } } return $this->_category; } /** * Method to load category data if it doesn't exist. * * @access private * @return boolean True on success */ function _loadCategory() { if (empty($this->_category)) { // current category info $query = 'SELECT c.*, ' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug '. ' FROM #__categories AS c' . ' WHERE c.id = '. (int) $this->_id . ' AND c.section = "com_weblinks"'; $this->_db->setQuery($query, 0, 1); $this->_category = $this->_db->loadObject(); } return true; } function _buildQuery() { $filter_order = $this->getState('filter_order'); $filter_order_dir = $this->getState('filter_order_dir'); $filter_order = JFilterInput::clean($filter_order, 'cmd'); $filter_order_dir = JFilterInput::clean($filter_order_dir, 'word'); // We need to get a list of all weblinks in the given category $query = 'SELECT *' . ' FROM #__weblinks' . ' WHERE catid = '. (int) $this->_id. ' AND published = 1' . ' AND archived = 0'. ' ORDER BY '. $filter_order .' '. $filter_order_dir .', ordering'; return $query; } } joomla/joomla/components/com_weblinks/models/index.html0000766000000000000000000000005411234314130024620 0ustar adminadministratorsjoomla/joomla/components/com_weblinks/models/weblink.php0000766000000000000000000001377111234314130025001 0ustar adminadministratorssetId((int)$id); } /** * Method to set the weblink identifier * * @access public * @param int Weblink identifier */ function setId($id) { // Set weblink id and wipe data $this->_id = $id; $this->_data = null; } /** * Method to get a weblink * * @since 1.5 */ function &getData() { // Load the weblink data if ($this->_loadData()) { // Initialize some variables $user = &JFactory::getUser(); // Make sure the weblink is published if (!$this->_data->published) { JError::raiseError(404, JText::_("Resource Not Found")); return false; } // Check to see if the category is published if (!$this->_data->cat_pub) { JError::raiseError( 404, JText::_("Resource Not Found") ); return; } // Check whether category access level allows access if ($this->_data->cat_access > $user->get('aid', 0)) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } } else $this->_initData(); return $this->_data; } /** * Method to increment the hit counter for the weblink * * @access public * @return boolean True on success * @since 1.5 */ function hit() { global $mainframe; if ($this->_id) { $weblink = & $this->getTable(); $weblink->hit($this->_id); return true; } return false; } /** * Tests if weblink is checked out * * @access public * @param int A user id * @return boolean True if checked out * @since 1.5 */ function isCheckedOut( $uid=0 ) { if ($this->_loadData()) { if ($uid) { return ($this->_data->checked_out && $this->_data->checked_out != $uid); } else { return $this->_data->checked_out; } } } /** * Method to checkin/unlock the weblink * * @access public * @return boolean True on success * @since 1.5 */ function checkin() { if ($this->_id) { $weblink = & $this->getTable(); if(! $weblink->checkin($this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } return false; } /** * Method to checkout/lock the weblink * * @access public * @param int $uid User ID of the user checking the article out * @return boolean True on success * @since 1.5 */ function checkout($uid = null) { if ($this->_id) { // Make sure we have a user id to checkout the article with if (is_null($uid)) { $user =& JFactory::getUser(); $uid = $user->get('id'); } // Lets get to it and checkout the thing... $weblink = & $this->getTable(); if(!$weblink->checkout($uid, $this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } return false; } /** * Method to store the weblink * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { $row =& $this->getTable(); // Bind the form fields to the web link table if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } // Create the timestamp for the date $row->date = gmdate('Y-m-d H:i:s'); // if new item, order last in appropriate group if (!$row->id) { $where = 'catid = ' . (int) $row->catid ; $row->ordering = $row->getNextOrder( $where ); } // Make sure the web link table is valid if (!$row->check()) { $this->setError($this->_db->getErrorMsg()); return false; } // Store the web link table to the database if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } /** * Method to load content weblink data * * @access private * @return boolean True on success * @since 1.5 */ function _loadData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = 'SELECT w.*, cc.title AS category,' . ' cc.published AS cat_pub, cc.access AS cat_access'. ' FROM #__weblinks AS w' . ' LEFT JOIN #__categories AS cc ON cc.id = w.catid' . ' WHERE w.id = '. (int) $this->_id; $this->_db->setQuery($query); $this->_data = $this->_db->loadObject(); return (boolean) $this->_data; } return true; } /** * Method to initialise the weblink data * * @access private * @return boolean True on success * @since 1.5 */ function _initData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $weblink = new stdClass(); $weblink->id = 0; $weblink->catid = 0; $weblink->sid = 0; $weblink->title = null; $weblink->url = null; $weblink->description = null; $weblink->date = null; $weblink->hits = 0; $weblink->published = 0; $weblink->checked_out = 0; $weblink->checked_out_time = 0; $weblink->ordering = 0; $weblink->archived = 0; $weblink->approved = 0; $weblink->params = null; $weblink->category = null; $this->_data = $weblink; return (boolean) $this->_data; } return true; } } joomla/joomla/administrator/0000777000000000000000000000000011266551211017367 5ustar adminadministratorsjoomla/joomla/administrator/help/0000777000000000000000000000000011266551111020316 5ustar adminadministratorsjoomla/joomla/administrator/help/en-GB/0000777000000000000000000000000011266551116021213 5ustar adminadministratorsjoomla/joomla/administrator/help/en-GB/screen.banners.edit.html0000766000000000000000000000142211234314116025723 0ustar adminadministrators Banner Manager - New/Edit

    Banner Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.banner.categories.edit.html0000766000000000000000000000145611234314116027673 0ustar adminadministrators Banner Category Manager - New/Edit

    Banner Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.modulesadministrator.edit.html0000766000000000000000000000142711234314116030551 0ustar adminadministrators Modules Administrator

    Modules Administrator

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.messages.read.html0000766000000000000000000000141711234314114026072 0ustar adminadministrators Private Messages - Read

    Private Messages - Read

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.mediamanager.html0000766000000000000000000000137011234314116025763 0ustar adminadministrators Media Manager

    Media Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/css/0000777000000000000000000000000011266551117022004 5ustar adminadministratorsjoomla/joomla/administrator/help/en-GB/css/index.html0000766000000000000000000000005411234314116023770 0ustar adminadministratorsjoomla/joomla/administrator/help/en-GB/css/help.css0000766000000000000000000000055411234314116023442 0ustar adminadministratorsbody { font-family: verdana, arial, sans-serif; font-size: 9pt; } h1 { color: #6D9D2E; font-size: 1.5em; border-left: 25px solid #6D9D2E; border-bottom: 1px solid #6D9D2E; padding: 0 0 2px 5px; } h2 { color: #6D9D2E; font-size: 1.3em; margin: 1ex 0; } pre { text-align: left; background-color: #fff; border-left: 1px solid #aaa; padding: 5px; }joomla/joomla/administrator/help/en-GB/css/docbook.css0000766000000000000000000005070411234314116024134 0ustar adminadministratorsa:hover { text-decoration: none; } /* ===================================== Article structure ===================================== */ article { display: block; } article > title { font-size: 2em; margin: 0.5ex 0; border-width: 1px; border-style: solid; border-color: transparent transparent #fea540 transparent; } title, subtitle, titleabbrev { display: block; color: #fea540; margin: 1.33ex 0; } title, subtitle { font-family: tahoma, arial, sans-serif; font-weight: bold; } /* ------------------------------------- Sections ------------------------------------- */ appendix, section { font-family: verdana, arial, sans-serif; font-size: 10pt; } section, sect1, sect2, sect3, sect4, sect5, simplesect { display: block; margin: 5px; } section > title, sect1 > title { font-size: 1.5em; margin: .83ex 0; } section > title:before, sect1 > title:before { content: counter(n-) " "; } section section > title, sect2 > title { font-size: 1.3em; margin: 1ex 0; } section * section > title { font-size: 1em; margin: 1.33ex 0; } section section > title:before, sect2 > title:before { content: counter(nn-) " "; } section section section > title:before, sect3 > title:before { content: counter(nnn-) " "; } section section section section > title:before, sect4 > title:before { content: counter(nnnn-) " "; } section section section * section > title:before { content: ""; } /* ------------------------------------- Appendix ------------------------------------- */ appendix { display: block; } appendix > title { /* in a book or in a part */ font-size: 2em; margin: 0.5ex 0; border-width: 1px; border-style: solid; border-color: transparent transparent #fea540 transparent; } article > appendix > title { font-size: 1.5em; margin: 0.83ex 0; border-width: 0; border-style: none; } appendix > title:before { content: "Appendix " counter(n-, upper-alpha) ": "; } /* ===================================== Paragraphs ===================================== */ para, simpara { display: block; margin: 1.33ex 0; font-size: 0.8em; } /* ===================================== Lists ===================================== */ /* ------------------------------------- itemizedlist ------------------------------------- */ itemizedlist { display: block; margin-left: 2ex; /* all lists are slightly indented */ margin-top: 1.33ex; margin-bottom: 1.33ex; } listitem { margin-bottom: 1.33ex; display: list-item; list-style-type: disc; } listitem > *:first-child { margin-top: 0; margin-bottom: 0; } itemizedlist > listitem { margin-left: 2.5ex; } itemizedlist > listitem:before { display: marker; content: disc; color: #fea540; padding-top: .6ex; } itemizedlist > listitem itemizedlist > listitem:before { content: square; } itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem:before { content: icon(diamond); } itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem itemizedlist > listitem:before { content: circle; } /* ------------------------------------- orderedlist ------------------------------------- */ orderedlist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } orderedlist > listitem { margin-left: 6ex; } orderedlist > listitem:before { display: marker; content: counter(n, decimal) "."; font-weight: bold; color: #fea540; } orderedlist[numeration=loweralpha] > listitem:before { content: counter(n, lower-alpha) "."; } orderedlist[numeration=upperalpha] > listitem:before { content: counter(n, upper-alpha) "."; } orderedlist[numeration=lowerroman] > listitem:before { content: counter(n, lower-roman) "."; } orderedlist[numeration=upperroman] > listitem:before { content: counter(n, upper-roman) "."; } /* ------------------------------------- variablelist ------------------------------------- */ variablelist { display: block; margin-left: 2ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } varlistentry { display: block; } term { display: block; font-weight: bold; } varlistentry > listitem { margin-left: 4ex; } /* ===================================== Figures ===================================== */ programlisting, screen, literallayout, synopsis { display: block; white-space: pre; font-family: monospace; font-size: 1.5em; margin: 1.33ex 0; } programlisting { background-color: rgb(255,255,221); border: thin solid gray; padding: 2px; color: #00f; } screen { background-color: #EEEEFF; border: thin solid #8888FF; padding: 2px; } figure, informalfigure, example, informalexample { display: block; margin: 1.33ex auto; } figure > title, example > title { font-style: italic; font-weight: normal; text-align: center; margin: 0; /* content of figure generally already has a margin */ } mediaobject { display: table; border-spacing: 2px; margin: 1.33ex auto; } inlinemediaobject { display: inline-table; border-spacing: 2px; } caption { display: table-caption; color: #fea540; font-style: italic; font-weight: normal; text-align: center; /* content of caption already has a margin */ } audioobject, videoobject, imageobject, textobject { display: table-cell; /* this will create one row per cell */ text-align: center; } objectinfo { text-align: left; } mediaobject > objectinfo { display: table-cell; } audiodata { display: inline; content: url(icons/audio.gif); } videodata { display: inline; content: url(icons/video.gif); } imagedata { display: inline; content: image(attr(fileref), -400, -200); } textdata { display: inline; content: url(icons/text.gif); } /* ===================================== Tables ===================================== */ /* * "black" is the color used to draw a border around the table and its cells * based on values of attributes such as frame, rowsep and colsep. * * "rgb(238,238,224)" (a very light gray) is the color used to draw * a border around each cell whether the cell actually has borders or not. * Remove this parameter if this ``cell footprint'' disturbs you. * * For more information about table support for DocBook, see * Power User's Guide. */ @extension "com.xmlmind.xmleditapp.docbook.TableSupport black rgb(238,238,224)"; table, informaltable { display: block; margin: 1.33ex 0; } table > title { display: block; font-style: italic; font-weight: normal; text-align: center; /* keep margin because tgroup has no margin */ } colspec, spanspec { display: table-column; collapsed: yes; } tgroup { display: table; border-style: solid; border-width: 1; } thead, tfoot { display: table-row-group; font-weight: bold; } tbody { display: table-row-group; } row { display: table-row; } entry { display: table-cell; border-style: solid; border-width: 1; padding: 2; } entry > *:first-child { margin-top: 0; margin-bottom: 0; } entrytbl { display: subtable; border-style: solid; border-width: 1; } /* ===================================== Divisions ===================================== */ abstract { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } abstract > *:first-child { margin-top: 0; margin-bottom: 0; } abstract:before { display: marker; content: element-label(); font-weight: bold; color: #fea540; } blockquote, epigraph { display: block; margin: 1.33ex 10ex; } blockquote > title { font-style: italic; font-weight: normal; text-align: center; margin: 0; /* content of blockquote already has a margin */ } attribution { display: block; text-align: right; } attribution:before { content: " -- "; } footnote { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; margin-right: 10ex; font-size: small; padding: 2px; background-color: #F0F0FF; } footnote > *:first-child { margin-top: 0; margin-bottom: 0; } footnote:before { display: marker; content: element-label(); color: #fea540; } footnote[label]:before { content: "[" attr(label) "]"; } note, caution, important, tip, warning { display: block; margin-left: 18ex; margin-top: 1.33ex; margin-bottom: 1.33ex; } note > *:first-child, caution > *:first-child, important > *:first-child, tip > *:first-child, warning > *:first-child { margin-top: 0; margin-bottom: 0; } note:before, caution:before, important:before, tip:before, warning:before { display: marker; content: element-label(); font-weight: bold; color: #fea540; } sidebar { display: block; margin: 1.33ex 0; border: thin solid #00FF00; background-color: #CCFFCC; padding: 2px; } sidebar > title { margin: 0; /* content of sidebar already has a margin */ } /* ===================================== Special sections ===================================== */ /* ------------------------------------- Question-and-answer set ------------------------------------- */ qandaset, qandadiv { display: block; /* content of qandaset has a margin */ } qandaentry { display: block; margin: 1.33ex 0; } question { font-weight: bold; display: block; margin-left: 2ex; margin-bottom: 1.33ex; } answer { font-weight: normal; display: block; margin-left: 4ex; margin-bottom: 1.33ex; } question > *:first-child, answer > *:first-child { margin-top: 0; margin-bottom: 0; } question:before, answer:before { display: marker; color: #004080; font-weight: bold; } question > para:before { color: #004080; content: "Q: "; font-weight: bold; } answer > para:before { color: #004080; content: "A: "; font-weight: bold; } label { display: block; margin: 1.33ex 0; color: #004080; font-weight: bold; } /* ------------------------------------- Meta-information ------------------------------------- */ appendixinfo, articleinfo, bibliographyinfo, blockinfo, bookinfo, chapterinfo, glossaryinfo, indexinfo, objectinfo, partinfo, prefaceinfo, refentryinfo, refmeta, referenceinfo, refsect1info, refsect2info, refsect3info, refsectioninfo, refsynopsisdivinfo, sect1info, sect2info, sect3info, sect4info, sect5info, sectioninfo, setindexinfo, setinfo, sidebarinfo { display: block; margin: 0; border: 0px; padding: 0px; } authorgroup { display: block; /* content of authorgroup has a margin */ } author, editor, othercredit { display: block; /* can contain authorblurb, address */ margin: 1.33ex 0; } personname { display: inline; } honorific, firstname, surname, lineage, othername { display: inline; } honorific:after, firstname:after, surname:after, lineage:after, othername:after { content: " "; } contrib { display: inline; } authorblurb, personblurb { display: block; /* content of authorblurb has a margin */ } corpauthor, corpname { /* Could be block but inline is safer when used in strange places and when used in meta-info, display is forced to be block. */ display: inline; } affiliation { display: block; /* can contain address */ margin: 1.33ex 0; } shortaffil, jobtitle, orgname, orgdiv { display: inline; } shortaffil:after, jobtitle:after, orgname:after, orgdiv:after { content: " "; } copyright { display: inline; } year, holder { display: inline; } year:after, holder:after { content: " "; } date, pubdate { display: inline; } edition { display: inline; } issuenum { display: inline; } keywordset, subjectset { display: inline; } keyword, subject, subjectterm { display: inline; } keyword:after, subjectterm:after { content: " "; } legalnotice { display: block; /* content of legalnotice has a margin */ } publishername { display: inline; } releaseinfo { display: inline; } revhistory { display: block; margin: 1.33ex 0; } revision { display: block; margin-left: 2.5ex; } revision:before { display: marker; content: icon(right); color: #fea540; padding-top: .6ex; } authorinitials { display: inline; font-weight: bold; } revnumber, revremark { display: inline; } revnumber:after, revision > date:after, revision > authorinitials:after { content: " "; } revdescription { display: block; /* content of revdescription has a margin */ } volumenum { display: inline; } /* --------------------------------------------------------------------------- Inlined elements other than those belonging to modules Note that default display is inline, so there is no need to specify it. --------------------------------------------------------------------------- */ emphasis { font-style: italic; } emphasis[role=bold] { font-style: normal; font-weight: bold; } emphasis[role=underline] { font-style: normal; text-decoration: underline; } emphasis[role=strikethrough] { font-style: normal; text-decoration: line-through; } emphasis > emphasis { font-style: normal; font-weight: normal; text-decoration: none; } literal { font-family: monospace; } link, ulink, email { color: navy; text-decoration: underline; } /* ------------------------------------- Technical ------------------------------------- */ command, computeroutput, filename, option, systemitem, userinput { font-family: monospace; } computeroutput, userinput { background-color: #EEEEEE; } command, option { font-weight: bold; } lineannotation { font-style: italic; font-size: medium; /* occurs in verbatim, fixed font, blocks */ } replaceable { font-style: italic; } /* ------------------------------------- General ------------------------------------- */ abbrev, acronym { font-weight: bold; } citetitle { font-style: italic; } footnoteref { content: "[" attr(linkend) "]"; font-size: small; vertical-align: super; color: navy; } footnoteref[label] { content: "[" attr(label) "]"; } phrase[revisionflag=deleted] { text-decoration: line-through; } phrase[revisionflag=added] { text-decoration: underline; } quote:before { content: open-quote; color: gray; } quote:after { content: close-quote; color: gray; } trademark:after, productname:after { font-size: small; color: gray; } trademark:after, /* also works for class=trade */ productname[class=trade]:after { content: "[tm]"; } trademark[class=copyright]:after, productname[class=copyright]:after { content: "\A9"; font-size: medium; } trademark[class=registered]:after, productname[class=registered]:after { content: "\AE"; font-size: medium; } trademark[class=service]:after, productname[class=service]:after { content: "[sm]"; } xref { content: icon(left-link) attr(linkend); vertical-align: text-top; /* for the icon */ color: navy; } xref[endterm] { content: icon(left-link) attr(endterm); } /* --------------------------------------------------------------------------- Comments and processing instructions --------------------------------------------------------------------------- */ *::comment, *::processing-instruction { display: block; margin: 2px; white-space: pre; text-align: left; font-family: monospace; font-size: small; font-style: normal; font-weight: normal; } *::comment { background-color: #FFFFCC; color: #808000; } *::processing-instruction { background-color: #CCFFCC; color: #008000; } /* --------------------------------------------------------------------------- Other --------------------------------------------------------------------------- */ xi\:include { display: tree; } *:read-only { background-color: #F0F0F0; } /* ------------------------------------- Meta-information ------------------------------------- */ appendixinfo > *, articleinfo > *, bibliographyinfo > *, blockinfo > *, bookinfo > *, chapterinfo > *, glossaryinfo > *, indexinfo > *, objectinfo > *, partinfo > *, prefaceinfo > *, refentryinfo > *, refmeta > *, referenceinfo > *, refsect1info > *, refsect2info > *, refsect3info > *, refsectioninfo > *, refsynopsisdivinfo > *, sect1info > *, sect2info > *, sect3info > *, sect4info > *, sect5info > *, sectioninfo > *, setindexinfo > *, setinfo > *, sidebarinfo > * { display: block; text-align: right; /* Reset paragraph styles */ font: normal normal 1em sans-serif; color: #777; font-size: 0.8em; } appendixinfo > *:first-child, articleinfo > *:first-child, bibliographyinfo > *:first-child, blockinfo > *:first-child, bookinfo > *:first-child, chapterinfo > *:first-child, glossaryinfo > *:first-child, indexinfo > *:first-child, objectinfo > *:first-child, partinfo > *:first-child, prefaceinfo > *:first-child, refentryinfo > *:first-child, refmeta > *:first-child, referenceinfo > *:first-child, refsect1info > *:first-child, refsect2info > *:first-child, refsect3info > *:first-child, refsectioninfo > *:first-child, refsynopsisdivinfo > *:first-child, sect1info > *:first-child, sect2info > *:first-child, sect3info > *:first-child, sect4info > *:first-child, sect5info > *:first-child, sectioninfo > *:first-child, setindexinfo > *:first-child, setinfo > *:first-child, sidebarinfo > *:first-child { /* nicer */ margin-top: 0; margin-bottom: 0; } appendixinfo > *:before, articleinfo > *:before, bibliographyinfo > *:before, blockinfo > *:before, bookinfo > *:before, chapterinfo > *:before, glossaryinfo > *:before, indexinfo > *:before, objectinfo > *:before, partinfo > *:before, prefaceinfo > *:before, refentryinfo > *:before, refmeta > *:before, referenceinfo > *:before, refsect1info > *:before, refsect2info > *:before, refsect3info > *:before, refsectioninfo > *:before, refsynopsisdivinfo > *:before, sect1info > *:before, sect2info > *:before, sect3info > *:before, sect4info > *:before, sect5info > *:before, sectioninfo > *:before, setindexinfo > *:before, setinfo > *:before, sidebarinfo > *:before { display: marker; content: element-label(); font: normal normal small sans-serif; color: #fea540; } appendixinfo > *:after, articleinfo > *:after, bibliographyinfo > *:after, blockinfo > *:after, bookinfo > *:after, chapterinfo > *:after, glossaryinfo > *:after, indexinfo > *:after, objectinfo > *:after, partinfo > *:after, prefaceinfo > *:after, refentryinfo > *:after, refmeta > *:after, referenceinfo > *:after, refsect1info > *:after, refsect2info > *:after, refsect3info > *:after, refsectioninfo > *:after, refsynopsisdivinfo > *:after, sect1info > *:after, sect2info > *:after, sect3info > *:after, sect4info > *:after, sect5info > *:after, sectioninfo > *:after, setindexinfo > *:after, setinfo > *:after, sidebarinfo > *:after { content: ""; } appendixinfo > title, articleinfo > title, bibliographyinfo > title, blockinfo > title, bookinfo > title, chapterinfo > title, glossaryinfo > title, indexinfo > title, objectinfo > title, partinfo > title, prefaceinfo > title, refentryinfo > title, /* refmeta has no title */ referenceinfo > title, refsect1info > title, refsect2info > title, refsect3info > title, refsectioninfo > title, refsynopsisdivinfo > title, sect1info > title, sect2info > title, sect3info > title, sect4info > title, sect5info > title, sectioninfo > title, setindexinfo > title, setinfo > title, sidebarinfo > title { font-size: 1.3em; font-weight: bold; color: #fea540; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 1ex; } appendixinfo > title:before, articleinfo > title:before, bibliographyinfo > title:before, blockinfo > title:before, bookinfo > title:before, chapterinfo > title:before, glossaryinfo > title:before, indexinfo > title:before, objectinfo > title:before, partinfo > title:before, prefaceinfo > title:before, refentryinfo > title:before, referenceinfo > title:before, refsect1info > title:before, refsect2info > title:before, refsect3info > title:before, refsectioninfo > title:before, refsynopsisdivinfo > title:before, sect1info > title:before, sect2info > title:before, sect3info > title:before, sect4info > title:before, sect5info > title:before, sectioninfo > title:before, setindexinfo > title:before, setinfo > title:before, sidebarinfo > title:before { content: ""; } graphic, inlinegraphic { content: image(attr(fileref)); } graphic { display: block; margin: 1.33ex auto; }joomla/joomla/administrator/help/en-GB/screen.content.categories.html0000766000000000000000000000142611234314116027151 0ustar adminadministrators Content Category Manager

    Content Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.modules.edit.html0000766000000000000000000000137111234314114025744 0ustar adminadministrators Module - Edit

    Module - Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.checkin.html0000766000000000000000000000136711234314116024763 0ustar adminadministrators Global Check-in

    Global Check-in

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.users.massmail.html0000766000000000000000000000137611234314116026325 0ustar adminadministrators Mass Mail Users

    Mass Mail Users

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.banners.client.html0000766000000000000000000000141411234314114026253 0ustar adminadministrators Banner Client Manager

    Banner Client Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.cpanel.html0000766000000000000000000000136211234314114024612 0ustar adminadministrators Control Panel

    Control Panel

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.newsfeeds.edit.html0000766000000000000000000000143411234314116026261 0ustar adminadministrators News Feeds Manager - New/Edit

    News Feeds Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.plugins.edit.html0000766000000000000000000000140411234314116025754 0ustar adminadministrators Plugins - New/Edit

    Plugins - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.users.edit.html0000766000000000000000000000143411234314114025435 0ustar adminadministrators User Manager - Add or Edit Users

    User Manager - Add or Edit Users

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.trashmanager.html0000766000000000000000000000137011234314116026025 0ustar adminadministrators Trash Manager

    Trash Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.sections.edit.html0000766000000000000000000000142711234314114026125 0ustar adminadministrators Sections Manager - New/Edit

    Sections Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.menus.html0000766000000000000000000000137311234314116024503 0ustar adminadministrators Menu Item Manager

    Menu Item Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.system.info.html0000766000000000000000000000140111234314116025622 0ustar adminadministrators System Information

    System Information

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/joomla.glossary.html0000766000000000000000000000127211234314114025215 0ustar adminadministrators Glossary

    Glossary

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.modulessite.edit.html0000766000000000000000000000137411234314114026634 0ustar adminadministrators Modules Site

    Modules Site

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.banners.html0000766000000000000000000000136511234314114025003 0ustar adminadministrators Banner Manager

    Banner Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.stats.searches.html0000766000000000000000000000140211234314114026275 0ustar adminadministrators Search Statistics

    Search Statistics

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.categories.html0000766000000000000000000000137411234314116025502 0ustar adminadministrators Category Manager

    Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.banner.categories.html0000766000000000000000000000142311234314114026737 0ustar adminadministrators Banner Category Manager

    Banner Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.config.html0000766000000000000000000000140011234314114024606 0ustar adminadministrators Global Configuration

    Global Configuration

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.polls.html0000766000000000000000000000135711234314114024505 0ustar adminadministrators Poll Manager

    Poll Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.menumanager.new.html0000766000000000000000000000142111234314114026433 0ustar adminadministrators Menu Manager - New/Edit

    Menu Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.content.edit.html0000766000000000000000000000142411234314114025745 0ustar adminadministrators Article Manager - New/Edit

    Article Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.templates.html0000766000000000000000000000137311234314114025350 0ustar adminadministrators Template Manager

    Template Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.banners.client.edit.html0000766000000000000000000000144711234314114027205 0ustar adminadministrators Banner Client Manager - New/Edit

    Banner Client Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.messages.edit.html0000766000000000000000000000141711234314116026106 0ustar adminadministrators Private Messages - Edit

    Private Messages - Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.newsfeeds.categories.edit.html0000766000000000000000000000147111234314116030406 0ustar adminadministrators News Feeds Category Manager - New/Edit

    News Feeds Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/joomla.credits.html0000766000000000000000000000130111234314116025002 0ustar adminadministrators Credits

    Credits

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.content.categories.edit.html0000766000000000000000000000146111234314116030074 0ustar adminadministrators Content Category Manager - New/Edit

    Content Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.menumanager.html0000766000000000000000000000136511234314116025654 0ustar adminadministrators Menu Manager

    Menu Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.contactmanager.edit.html0000766000000000000000000000143311234314116027263 0ustar adminadministrators Contact Manager - New/Edit

    Contact Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/joomla.whatsnew15.html0000766000000000000000000001115611234314116025364 0ustar adminadministrators What's New in Version 1.5

    What's New in Version 1.5

    The following outlines the highlights of the second major release of Joomla!

    As with previous releases, Joomla! provides a unified and easy-to-use framework for delivering content for websites of all kinds. To support the changing nature of the Internet and emerging web technologies, Joomla! required substantial restructuring of its core functionality and we also used this effort to simplify many challenges within the current user interface. Joomla! 1.5 has many new features.

    The goals for the Joomla! 1.5 release are to:

    • Substantially improve usability, manageability, and scalability far beyond the original Mambo foundations.
    • Expand accessibility to support internationalisation, double-byte characters and Right-to-Left support for Arabic and Hebrew languages.
    • Extend the integration of external applications through Web Services and remote authentication such as the Lightweight Directory Access Protocol (LDAP).
    • Enhance the content delivery, template and presentation capabilities to support accessibility standards and content delivery to any destination.
    • Achieve a more sustainable and flexible framework for component and extension developers.
    • Deliver backwards compatibility with previous releases of components, templates, modules and other extensions.

    What are "extensions"?

    Components, languages, modules, plugins and templates are now collectively known as Extensions.

    Where did the installer go?

    The improved installer can be found under the extensions option. With versions prior to 1.5 you needed to select a specific extension type when you wanted to install it. With Joomla! 1.5 you just select the extension you want to upload, and click on install. The installer will do all the hard work for you.

    What happened to the locale setting?

    This is now defined in the language .xml file in the language metadata settings. If you are having locale problems (dates don't appear in your language, for example) you might want to check/edit the entries in the locale tag. Note that multiple locale strings can be set and the host will usually accept the first one recognised.

    Only one edit window! How do I create "Read more..."?

    This is now implemented by inserting a tag (button is in the editor area) a dotted line appears in the edited text showing the split location for the "Read more...". A new bot takes care of the rest.

    It is worth mentioning that this does not have a negative effect on migrated data from older sites. The new implementation is fully backwards compatible.

    Where did the Mambots go?

    Mambots have been renamed as "Plugins". Mambots were introduced in Mambo and offered possibilities to add plugin logic to your site mainly for the purpose of manipulating content. In Joomla!, Plugins will now have much broader capabilities than Mambots. Plugins are able to extend functionality at the framework layer as well.

    Where is the static content?

    In Joomla! versions prior to 1.5 there was a distinct difference between static and normal content. Both content types are still around, but are not handled as separate items. If you want to create static content, just select "uncategorised" as section and category and the content is handled as static content.

    What about developers?

    This is the release that developers' have been waiting for. A massive effort has been made to refactor and reorganise the core of Joomla! into a true extendable framework. The new features in the framework are too many to list here but additional documentation can be found on the Joomla! Developer Network site.

    Compatibility

    We have made every effort to make this version backwards compatible with Joomla 1.0. In order to install 1.0 extensions you will probably need to activate the legacy code plugin. This can be found in the Plugin Manager (it's called "System - Legacy") and you just need to enable it.

    joomla/joomla/administrator/help/en-GB/screen.weblink.html0000766000000000000000000000137111234314114025003 0ustar adminadministrators Web Link Manager

    Web Link Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.installer.html0000766000000000000000000000142311234314114025343 0ustar adminadministrators Extension Manager - Install

    Extension Manager - Install

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.weblinks.categories.edit.html0000766000000000000000000000146411234314114030241 0ustar adminadministrators Web Link Category Manager - New/Edit

    Web Link Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.menus.edit.html0000766000000000000000000000142611234314114025424 0ustar adminadministrators Menu Item Manager - New/Edit

    Menu Item Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.plugins.html0000766000000000000000000000136611234314116025037 0ustar adminadministrators Plugin Manager

    Plugin Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.modules.new.html0000766000000000000000000000136611234314114025614 0ustar adminadministrators Module - New

    Module - New

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.weblink.edit.html0000766000000000000000000000143011234314114025723 0ustar adminadministrators Web Link Manager : New / Edit

    Web Link Manager : New / Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.languages.html0000766000000000000000000000137311234314116025322 0ustar adminadministrators Language Manager

    Language Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.messages.inbox.html0000766000000000000000000000142211234314114026272 0ustar adminadministrators Private Messages - Inbox

    Private Messages - Inbox

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/index.html0000766000000000000000000000005411234314114023176 0ustar adminadministratorsjoomla/joomla/administrator/help/en-GB/screen.contact_details.categories.html0000766000000000000000000000143611234314114030636 0ustar adminadministrators Contact Category Manager

    Contact Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.cache.html0000766000000000000000000000135711234314114024417 0ustar adminadministrators Clean Cache

    Clean Cache

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.users.html0000766000000000000000000000136111234314116024512 0ustar adminadministrators User Manager

    User Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.weblinks.categories.html0000766000000000000000000000143111234314116027311 0ustar adminadministrators Web Link Category Manager

    Web Link Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.newsfeeds.html0000766000000000000000000000137711234314116025343 0ustar adminadministrators News Feeds Manager

    News Feeds Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.contact_details.categories.edit.html0000766000000000000000000000147111234314114031561 0ustar adminadministrators Contact Category Manager - New/Edit

    Contact Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.content.html0000766000000000000000000000136711234314114025027 0ustar adminadministrators Article Manager

    Article Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.frontpage.html0000766000000000000000000000137511234314114025341 0ustar adminadministrators Frontpage Manager

    Frontpage Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.newsfeeds.categories.html0000766000000000000000000000143611234314114027461 0ustar adminadministrators News Feeds Category Manager

    News Feeds Category Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.sections.html0000766000000000000000000000137011234314114025176 0ustar adminadministrators Section Manager

    Section Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.modules.html0000766000000000000000000000136611234314116025026 0ustar adminadministrators Module Manager

    Module Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/joomla.whatsnew10.html0000766000000000000000000001603211234314114025353 0ustar adminadministrators What's New in Version 1.0

    What's New in Version 1.0

    The following outlines the highlights of this debut version of Joomla!  All comments are made in reference to Mambo 4.5.2.3 with regard to changes and improvements made.

    Bug Fixes

    Several crucial fixes have been applied to this version:

    •  You can now properly login to different sites even if they share the same domain and are nested in sub-directories.
    • Slow queries in the User Manager have been corrected.  This bug affected sites with thousands of registered users.  Registered users (that don't have edit rights) are also excluded from the Author select list shown when editing content pages.
    • Variable references that caused notices in PHP 4.4 have been fixed.

    Check the CHANGELOG.php file for more information.

     

     Security Fixes

     Several important vulnerabilities have been patched in this version:

    • Known vulnerabilities in the phpMailer class
    • SQL injection vulnerability via the user activation feature
    • SQL injection vulnerability via the polls component
    • Files such as the CHANGELOG have been converted to PHP files to prevent them being visible.
    • The "Email from Friend" form has been hardened to reduce the risk of it being used as a gateway for spam
    • The mosGetParam has been hardened by using phpInputFilter for NO_HTML mode
    • An alternative version of globals.php has been provided.  If you rename globals.php-off to globals.php Joomla! will emulate the php setting register_globals=off.  This affords some protection against certainly types of malicious attacks but may prevent some third party applications from working correctly.

     

    Joomla! Site (Front End)

    •  The site is now visibile to Administrators even when the site is in Offline mode.
    • Frontend Users can select the WYSIWYG editor they want to use rather than having to use the default.

     

     Joomla! Administrator (Back End)

    • The System Information link has been added back to the System Menu.
    • "Force Logout" in the User Manager toolbar has been renamed to simply "Logout".
    • "Submit - Content" is a new menu type available
    • HTML output is now buffered to improve performance of non-display actions (like saving content)
    • Users can select the WYSIWYG editor they want to use rather than having to use the default.
    • Contact component: added parameter to define a certain category for a contact menu.

     

    Templates 

     The Solar Flare 2 template has been freshened with the new name.  Andy Miller joined forces with Robert Deutz to deliver a stunning new Adminstrator Template for Joomla!

    Toolbar icons in the Administrator toolbar are now shown in full colour rather than greyed out (which would normally indicate they were unavailable). 

     

    Miscellaneous Bits

    • A "check again" button has been added to the first page of the web installer. 

     

    Support for MySQL 4.1.x

     Joomla! will support installation and use with PHP 5 and MySQL 4.1.  An alternative database file is provided in the /includes directory.  SImply copy database.mysqli.php over the existing databased.php file.  Following this you can use the web installer normally to install Joomla!.

    Library Upgrades

     The following developer libraries have been upgraded:

    • patTemplate (this version now supports the short tag modifiers)
    • Overlib
    • TinyMCE
    • Walter Zorn tooltips
    • JSCookMenu
    • DOMIT!
    • DOMIT! RSS

     

    Useability and Accessibility

    A huge thrust is being made to make Joomla! compliant with web standards for useability and accessibility.  While much more will be done in future versions, the following first steps have been taken to achieve this goal:

    • Label tags have been added to Site module and component output
    • mosHTML::selectList and mosHTML::radioList automatically provide the correct label tags 

     

    Developer Extras

    A number of new things are available for developers.  These include:

    •  patHTML class provides several utility methods for handling selection lists
    • mosAbstractTasker class now auto-maps public methods to tasks
    • setTemplateVars method has been added to both the Site and Administrator page navigation classes
    • mosHash function provides a convenient method for producing secure hashes
    • A <span class="article_separator"></span> now separates content items in lists
    • mosParameter::_mos_filelist has been added to supportXML params
    • Paramater files can now use the root element <mosparams>.  This enables you to have more than one XML params file in your component installation files.
    • A number of new mambot triggers have been included: onStart, onAfterMainframe
    • A number of new toolbar icons have been added
    • The mosToolBar::help method now correctly supports local help files in a components /help folder.
    • mosDBTable::isCheckedOut method has been added
    • CSS styles have been added to the administrator template to support Joomla! 1.5-like (Mambo 4.5.3-like) screen layouts.
    • The dTree javascript tree library has been added
    • database:setQuery now takes arguments for query limit offset and number of records to be returned.

     


     Compatibility

    We have made every effort to make this version backwardly compatible with Mambo 4.5.2.3 but there are a few changes that may affect a small selection of existing addons.  If you are a developer of Mambo addons (and soon to be Joomla! developer) then your attention should be drawn to the following points:

    • patTemplate::createTemplate arguments have changed
    • database:setQuery arguments have changed but this is unlikely to affect most sites

     

     

    joomla/joomla/administrator/help/en-GB/joomla.support.html0000766000000000000000000000130111234314116025061 0ustar adminadministrators Support

    Support

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.categories.edit.html0000766000000000000000000000143111234314116026420 0ustar adminadministrators Category Manager - New/Edit

    Category Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.polls.edit.html0000766000000000000000000000141411234314114025423 0ustar adminadministrators Poll Manager - New/Edit

    Poll Manager - New/Edit

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/en-GB/screen.contactmanager.html0000766000000000000000000000137711234314116026346 0ustar adminadministrators Contact Manager

    Contact Manager

    The local copy of this help file is no longer maintained. Please use the online version.

    joomla/joomla/administrator/help/helpsites-15.xml0000766000000000000000000000126511234314114023263 0ustar adminadministrators English (GB) - help.joomla.org Spanish -comunidadjoomla.org Italian - joomla.it Hungarian -joomla.org.hu German -hilfe.jgerman.de Dutch(NL) - help.joomlacommunity.eu Catalan - joomla.cat joomla/joomla/administrator/help/index.html0000766000000000000000000000005411234314116022310 0ustar adminadministratorsjoomla/joomla/administrator/index3.php0000766000000000000000000000112111234314114021260 0ustar adminadministratorsjoomla/joomla/administrator/components/0000777000000000000000000000000011266551210021553 5ustar adminadministratorsjoomla/joomla/administrator/components/com_massmail/0000777000000000000000000000000011266551156024230 5ustar adminadministratorsjoomla/joomla/administrator/components/com_massmail/toolbar.massmail.php0000766000000000000000000000141011234314112030165 0ustar adminadministrators
    authorize( 'com_massmail', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JApplicationHelper::getPath( 'admin_html' ) ); switch ($task) { case 'send': sendMail(); break; case 'cancel': $mainframe->redirect( 'index.php' ); break; default: messageForm( $option ); break; } function messageForm( $option ) { $acl =& JFactory::getACL(); $gtree = array( JHTML::_('select.option', 0, '- '. JText::_( 'All User Groups' ) .' -' ) ); // get list of groups $lists = array(); $gtree = array_merge( $gtree, $acl->get_group_children_tree( null, 'users', false ) ); $lists['gid'] = JHTML::_('select.genericlist', $gtree, 'mm_group', 'size="10"', 'value', 'text', 0 ); HTML_massmail::messageForm( $lists, $option ); } function sendMail() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $acl =& JFactory::getACL(); $mode = JRequest::getVar( 'mm_mode', 0, 'post', 'int' ); $subject = JRequest::getVar( 'mm_subject', '', 'post', 'string' ); $gou = JRequest::getVar( 'mm_group', '0', 'post', 'int' ); $recurse = JRequest::getVar( 'mm_recurse', 'NO_RECURSE', 'post', 'word' ); $bcc = JRequest::getVar( 'mm_bcc', 0, 'post', 'int' ); // pulls message inoformation either in text or html format if ( $mode ) { $message_body = JRequest::getVar( 'mm_message', '', 'post', 'string', JREQUEST_ALLOWRAW ); } else { // automatically removes html formatting $message_body = JRequest::getVar( 'mm_message', '', 'post', 'string' ); } // Check for a message body and subject if (!$message_body || !$subject) { $mainframe->redirect( 'index.php?option=com_massmail', JText::_( 'Please fill in the form correctly' ) ); } // get users in the group out of the acl $to = $acl->get_group_objects( $gou, 'ARO', $recurse ); JArrayHelper::toInteger($to['users']); // Get sending email address /* $query = 'SELECT email' . ' FROM #__users' . ' WHERE id = '.(int) $user->get('id') ; $db->setQuery( $query ); $user->set( 'email', $db->loadResult() ); */ // Get all users email and group except for senders $query = 'SELECT email' . ' FROM #__users' . ' WHERE id != '.(int) $user->get('id') . ( $gou !== 0 ? ' AND id IN (' . implode( ',', $to['users'] ) . ')' : '' ) ; $db->setQuery( $query ); $rows = $db->loadObjectList(); // Check to see if there are any users in this group before we continue if ( ! count($rows) ) { $msg = JText::_('No users could be found in this group.'); $mainframe->redirect( 'index.php?option=com_massmail', $msg ); } $mailer =& JFactory::getMailer(); $params =& JComponentHelper::getParams( 'com_massmail' ); // Build e-mail message format $mailer->setSender(array($mainframe->getCfg('mailfrom'), $mainframe->getCfg('fromname'))); $mailer->setSubject($params->get('mailSubjectPrefix') . stripslashes( $subject)); $mailer->setBody($message_body . $params->get('mailBodySuffix')); $mailer->IsHTML($mode); // Add recipients if ( $bcc ) { foreach ($rows as $row) { $mailer->addBCC($row->email); } $mailer->addRecipient($mainframe->getCfg('mailfrom')); }else { foreach ($rows as $row) { $mailer->addRecipient($row->email); } } // Send the Mail $rs = $mailer->Send(); // Check for an error if ( JError::isError($rs) ) { $msg = $rs->getError(); } else { $msg = $rs ? JText::sprintf( 'E-mail sent to', count( $rows ) ) : JText::_('The mail could not be sent'); } // Redirect with the message $mainframe->redirect( 'index.php?option=com_massmail', $msg ); } joomla/joomla/administrator/components/com_massmail/toolbar.massmail.html.php0000766000000000000000000000205611234314112031137 0ustar adminadministratorsjoomla/joomla/administrator/components/com_massmail/config.xml0000766000000000000000000000050611234314112026201 0ustar adminadministrators joomla/joomla/administrator/components/com_massmail/massmail.xml0000766000000000000000000000100411234314112026534 0ustar adminadministrators Mass Mail Joomla! Project April 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 DESCMASSMAIL joomla/joomla/administrator/components/com_cache/0000777000000000000000000000000011266551206023461 5ustar adminadministratorsjoomla/joomla/administrator/components/com_cache/toolbar.cache.html.php0000766000000000000000000000235711234314074027644 0ustar adminadministrators
    " >
    getListFooter(); ?>
    getRowOffset( $i ); ?> group; ?> count; ?> size ?>

    _path = $path; $this->_parse(); } /** * Parse $path for cache file groups. Any files identifided as cache are logged * in a group and stored in $this->items. * * @access private * @param String $path */ function _parse() { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $folders = JFolder::folders($this->_path); foreach ($folders as $folder) { $files = array(); $files = JFolder::files($this->_path.DS.$folder); $this->_items[$folder] = new CacheItem( $folder ); foreach ($files as $file) { $this->_items[$folder]->updateSize( filesize( $this->_path.DS.$folder.DS.$file )/ 1024 ); } } } /** * Get the number of current Cache Groups * * @access public * @return int */ function getGroupCount() { return count($this->_items); } /** * Retrun an Array containing a sub set of the total * number of Cache Groups as defined by the params. * * @access public * @param Int $start * @param Int $limit * @return Array */ function getRows( $start, $limit ) { $i = 0; $rows = array(); if (!is_array($this->_items)) { return null; } foreach ($this->_items as $item) { if ( (($i >= $start) && ($i < $start+$limit)) || ($limit == 0) ) { $rows[] = $item; } $i++; } return $rows; } /** * Clean out a cache group as named by param. * If no param is passed clean all cache groups. * * @param String $group */ function cleanCache( $group='' ) { $cache =& JFactory::getCache('', 'callback', 'file'); $cache->clean( $group ); } function cleanCacheList( $array ) { foreach ($array as $group) { $this->cleanCache( $group ); } } } /** * This Class is used by CacheData to store group cache data. * * @package Joomla * @subpackage Cache * @since 1.5 */ class CacheItem { var $group = ""; var $size = 0; var $count = 0; function CacheItem ( $group ) { $this->group = $group; } function updateSize( $size ) { $this->size = number_format( $this->size + $size, 2 ); $this->count++; } }joomla/joomla/administrator/components/com_cache/index.html0000766000000000000000000000005411234314074025451 0ustar adminadministratorsjoomla/joomla/administrator/components/com_cache/admin.cache.php0000766000000000000000000000646711234314074026335 0ustar adminadministratorsauthorize( 'com_cache', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Load the html output class and the model class require_once (JApplicationHelper::getPath('admin_html')); require_once (JApplicationHelper::getPath('class')); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); /* * This is our main control structure for the component * * Each view is determined by the $task variable */ switch ( JRequest::getVar( 'task' ) ) { case 'delete': CacheController::deleteCache($cid); CacheController::showCache(); break; case 'purgeadmin': CacheController::showPurgeCache(); break; case 'purge': CacheController::purgeCache(); break; default : CacheController::showCache(); break; } /** * Static class to hold controller functions for the Cache component * * @static * @package Joomla * @subpackage Weblinks * @since 1.5 */ class CacheController { /** * Show the cache * * @since 1.5 */ function showCache() { global $mainframe, $option; $submenu = JRequest::getVar('client', '0', '', 'int'); $client =& JApplicationHelper::getClientInfo($submenu); if ($submenu == 1) { JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_cache&client=0'); JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_cache&client=1', true); } else { JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_cache&client=0', true); JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_cache&client=1'); } $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit')); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0 ); $cmData = new CacheData($client->path.DS.'cache'); jimport('joomla.html.pagination'); $pageNav = new JPagination( $cmData->getGroupCount(), $limitstart, $limit ); CacheView::displayCache( $cmData->getRows( $limitstart, $limit ), $client, $pageNav ); } function deleteCache($cid) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $cmData = new CacheData($client->path.DS.'cache'); $cmData->cleanCacheList( $cid ); } function showPurgeCache() { // Check for request forgeries CacheView::showPurgeExecute(); } function purgeCache() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cache =& JFactory::getCache(''); $cache->gc(); CacheView::purgeSuccess(); } } joomla/joomla/administrator/components/com_cache/cache.xml0000766000000000000000000000100311234314074025234 0ustar adminadministrators Cache Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Cache Manager joomla/joomla/administrator/components/com_messages/0000777000000000000000000000000011266551133024224 5ustar adminadministratorsjoomla/joomla/administrator/components/com_messages/admin.messages.html.php0000766000000000000000000002074011234314102030566 0ustar adminadministrators
    :
    state ? 'tick.png' : 'publish_x.png'; $alt = $row->state ? JText::_( 'Read' ) : JText::_( 'Read' ); if ( $user->authorize( 'com_users', 'manage' ) ) { $linkA = 'index.php?option=com_users&view=user&task=edit&cid[]='. $row->user_id_from; $author = ''. $row->user_from .''; } else { $author = $row->user_from; } ?> ">
    getListFooter(); ?>
    limitstart;?> message_id ); ?> subject; ?> <?php echo $alt; ?> date_time, JText::_('DATE_FORMAT_LC2')); ?>
    :
    :
    :
    : user_from;?>
    : date_time;?>
    : subject;?>
    :
    message, ENT_COMPAT, 'UTF-8' );?>
    :
    :
    :
    Messaging Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Messaging joomla/joomla/administrator/components/com_messages/toolbar.messages.html.php0000766000000000000000000000340311234314102031135 0ustar adminadministratorsgetUserStateFromRequest( $context.'.filter_order', 'filter_order', 'a.date_time', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'.filter_order_Dir','filter_order_Dir', 'DESC', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $context.'.filter_state', 'filter_state', '', 'word' ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $context.'.limitstart', 'limitstart', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $where = array(); $where[] = ' a.user_id_to='.(int) $user->get('id'); if ($search != '') { $searchEscaped = $db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); $where[] = '( a.subject LIKE '.$searchEscaped.' OR a.message LIKE '.$searchEscaped.' )'; } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'a.state = 1'; } else if ($filter_state == 'U' ) { $where[] = 'a.state = 0'; } } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', a.date_time DESC'; $query = 'SELECT COUNT(*)' . ' FROM #__messages AS a' . ' INNER JOIN #__users AS u ON u.id = a.user_id_from' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT a.*, u.name AS user_from' . ' FROM #__messages AS a' . ' INNER JOIN #__users AS u ON u.id = a.user_id_from' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // state filter $lists['state'] = JHTML::_('grid.state', $filter_state, 'Read', 'Unread' ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; HTML_messages::showMessages( $rows, $pageNav, $option, $lists ); } function editConfig( $option ) { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $query = 'SELECT cfg_name, cfg_value' . ' FROM #__messages_cfg' . ' WHERE user_id = '.(int) $user->get('id') ; $db->setQuery( $query ); $data = $db->loadObjectList( 'cfg_name' ); // initialize values if they do not exist if (!isset($data['lock']->cfg_value)) { $data['lock']->cfg_value = 0; } if (!isset($data['mail_on_new']->cfg_value)) { $data['mail_on_new']->cfg_value = 0; } if (!isset($data['auto_purge']->cfg_value)) { $data['auto_purge']->cfg_value = 7; } $vars = array(); $vars['lock'] = JHTML::_('select.booleanlist', "vars[lock]", '', $data['lock']->cfg_value, 'yes', 'no', 'varslock' ); $vars['mail_on_new'] = JHTML::_('select.booleanlist', "vars[mail_on_new]", '', $data['mail_on_new']->cfg_value, 'yes', 'no', 'varsmail_on_new' ); $vars['auto_purge'] = $data['auto_purge']->cfg_value; HTML_messages::editConfig( $vars, $option ); } function saveConfig( $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $query = 'DELETE FROM #__messages_cfg' . ' WHERE user_id = '.(int) $user->get('id') ; $db->setQuery( $query ); $db->query(); $vars = JRequest::getVar( 'vars', array(), 'post', 'array' ); foreach ($vars as $k=>$v) { $v = $db->getEscaped( $v ); $query = 'INSERT INTO #__messages_cfg' . ' ( user_id, cfg_name, cfg_value )' . ' VALUES ( '.(int) $user->get('id').', '.$db->Quote($k).', '.$db->Quote($v).' )' ; $db->setQuery( $query ); $db->query(); } $mainframe->redirect( "index.php?option=$option" ); } function newMessage( $option, $user, $subject ) { $db =& JFactory::getDBO(); $acl =& JFactory::getACL(); // get available backend user groups $gid = $acl->get_group_id( 'Public Backend', 'ARO' ); $gids = $acl->get_group_children( $gid, 'ARO', 'RECURSE' ); JArrayHelper::toInteger($gids, array(0)); $gids = implode( ',', $gids ); // get list of usernames $recipients = array( JHTML::_('select.option', '0', '- '. JText::_( 'Select User' ) .' -' ) ); $query = 'SELECT id AS value, username AS text FROM #__users' . ' WHERE gid IN ( '.$gids.' )' . ' ORDER BY name' ; $db->setQuery( $query ); $recipients = array_merge( $recipients, $db->loadObjectList() ); $recipientslist = JHTML::_('select.genericlist', $recipients, 'user_id_to', 'class="inputbox" size="1"', 'value', 'text', $user); HTML_messages::newMessage($option, $recipientslist, $subject ); } function saveMessage( $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); require_once(dirname(__FILE__).DS.'tables'.DS.'message.php'); $db =& JFactory::getDBO(); $row = new TableMessage( $db ); if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError() ); } if (!$row->check()) { JError::raiseError(500, $row->getError() ); } if (!$row->send()) { $mainframe->redirect( "index.php?option=com_messages", $row->getError() ); } $mainframe->redirect( "index.php?option=com_messages" ); } function viewMessage( $uid='0', $option ) { $db =& JFactory::getDBO(); $query = 'SELECT a.*, u.name AS user_from' . ' FROM #__messages AS a' . ' INNER JOIN #__users AS u ON u.id = a.user_id_from' . ' WHERE a.message_id = '.(int) $uid . ' ORDER BY date_time DESC' ; $db->setQuery( $query ); $row = $db->loadObject(); $query = 'UPDATE #__messages' . ' SET state = 1' . ' WHERE message_id = '.(int) $uid ; $db->setQuery( $query ); $db->query(); HTML_messages::viewMessage( $row, $option ); } function removeMessage( $cid, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to delete' ) ); } if (count( $cid )) { $cids = implode( ',', $cid ); $query = 'DELETE FROM #__messages' . ' WHERE message_id IN ( '. $cids .' )' ; $db->setQuery( $query ); if (!$db->query()) { echo "\n"; } } $limit = JRequest::getVar( 'limit', 10, '', 'int' ); $limitstart = JRequest::getVar( 'limitstart', 0, '', 'int' ); $mainframe->redirect( 'index.php?option='.$option.'&limit='.$limit.'&limitstart='.$limitstart ); } joomla/joomla/administrator/components/com_messages/tables/0000777000000000000000000000000011266551133025476 5ustar adminadministratorsjoomla/joomla/administrator/components/com_messages/tables/index.html0000766000000000000000000000005411234314102027457 0ustar adminadministratorsjoomla/joomla/administrator/components/com_messages/tables/message.php0000766000000000000000000000756511234314102027635 0ustar adminadministratorsuser_id_from; $toId = $toId ? $toId : $this->user_id_to; $subject = $subject ? $subject : $this->subject; $message = $message ? $message : $this->message; } $query = 'SELECT cfg_name, cfg_value' . ' FROM #__messages_cfg' . ' WHERE user_id = '.(int) $toId; $db->setQuery($query); $config = $db->loadObjectList('cfg_name'); $locked = @ $config['lock']->cfg_value; $domail = @ $config['mail_on_new']->cfg_value; if (!$locked) { $this->user_id_from = $fromId; $this->user_id_to = $toId; $this->subject = $subject; $this->message = $message; $date =& JFactory::getDate(); $this->date_time = $date->toMySQL(); if ($this->store()) { if ($domail) { $query = 'SELECT name, email' . ' FROM #__users' . ' WHERE id = '.(int) $fromId; $db->setQuery($query); $fromObject = $db->loadObject(); $fromname = $fromObject->name; $mailfrom = $fromObject->email; $siteURL = JURI::base(); $sitename = $mainframe->getCfg( 'sitename' ); $query = 'SELECT email' . ' FROM #__users' . ' WHERE id = '.(int) $toId; $db->setQuery($query); $recipient = $db->loadResult(); $subject = sprintf (JText::_('A new private message has arrived'), $sitename); $msg = sprintf (JText::_('Please login to read your message'), $siteURL); JUtility::sendMail($mailfrom, $fromname, $recipient, $subject, $msg); } return true; } } else { if (is_object($this)) { $this->setError(JText::_('MESSAGE_FAILED')); } } return false; } } joomla/joomla/administrator/components/com_messages/index.html0000766000000000000000000000005411234314102026205 0ustar adminadministratorsjoomla/joomla/administrator/components/com_languages/0000777000000000000000000000000011266551156024370 5ustar adminadministratorsjoomla/joomla/administrator/components/com_languages/admin.languages.php0000766000000000000000000001065211234314110030121 0ustar adminadministratorsauthorize( 'com_languages', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JApplicationHelper::getPath( 'admin_html' ) ); $task = strtolower( JRequest::getCmd( 'task' ) ); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); $cid = array(JFilterInput::clean(@$cid[0], 'cmd')); $client = JRequest::getVar('client', 0, '', 'int'); if ($client == 1) { JSubMenuHelper::addEntry(JText::_('Site'),'#" onclick="javascript:document.adminForm.client.value=\'0\';submitbutton(\'\');'); JSubMenuHelper::addEntry(JText::_('Administrator'), '#" onclick="javascript:document.adminForm.client.value=\'1\';submitbutton(\'\');', true ); } else { JSubMenuHelper::addEntry(JText::_('Site'), '#" onclick="javascript:document.adminForm.client.value=\'0\';submitbutton(\'\');', true ); JSubMenuHelper::addEntry(JText::_('Administrator'), '#" onclick="javascript:document.adminForm.client.value=\'1\';submitbutton(\'\');'); } switch ($task) { case 'publish': publishLanguage( $cid[0]); break; default: viewLanguages(); break; } /** * Compiles a list of installed languages */ function viewLanguages() { global $mainframe, $option; // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $rows = array (); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $rowid = 0; // Set FTP credentials, if given jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); //load folder filesystem class jimport('joomla.filesystem.folder'); $path = JLanguage::getLanguagePath($client->path); $dirs = JFolder::folders( $path ); foreach ($dirs as $dir) { $files = JFolder::files( $path.DS.$dir, '^([-_A-Za-z]*)\.xml$' ); foreach ($files as $file) { $data = JApplicationHelper::parseXMLLangMetaFile($path.DS.$dir.DS.$file); $row = new StdClass(); $row->id = $rowid; $row->language = substr($file,0,-4); if (!is_array($data)) { continue; } foreach($data as $key => $value) { $row->$key = $value; } // if current than set published $params = JComponentHelper::getParams('com_languages'); if ( $params->get($client->name, 'en-GB') == $row->language) { $row->published = 1; } else { $row->published = 0; } $row->checked_out = 0; $row->mosname = JString::strtolower( str_replace( " ", "_", $row->name ) ); $rows[] = $row; $rowid++; } } jimport('joomla.html.pagination'); $pageNav = new JPagination( $rowid, $limitstart, $limit ); $rows = array_slice( $rows, $pageNav->limitstart, $pageNav->limit ); HTML_languages::showLanguages( $rows, $pageNav, $option, $client, $ftp ); } /** * Publish, or make current, the selected language */ function publishLanguage( $language ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $params = JComponentHelper::getParams('com_languages'); $params->set($client->name, $language); $table =& JTable::getInstance('component'); $table->loadByOption( 'com_languages' ); $table->params = $params->toString(); // pre-save checks if (!$table->check()) { JError::raiseWarning( 500, $table->getError() ); return false; } // save the changes if (!$table->store()) { JError::raiseWarning( 500, $table->getError() ); return false; } $mainframe->redirect('index.php?option=com_languages&client='.$client->id); }joomla/joomla/administrator/components/com_languages/admin.languages.html.php0000766000000000000000000000770511234314110031071 0ustar adminadministrators

    message); ?>

    ">
     
    getListFooter(); ?>
    getRowOffset( $i ); ?> name;?> published == 1) { ?> <?php echo JText::_( 'Default' ); ?>   version; ?> creationdate; ?> author; ?> authorEmail; ?>
    joomla/joomla/administrator/components/com_languages/languages.xml0000766000000000000000000000101111234314110027030 0ustar adminadministrators Language Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Language Manager joomla/joomla/administrator/components/com_trash/0000777000000000000000000000000011266551123023535 5ustar adminadministratorsjoomla/joomla/administrator/components/com_trash/toolbar.trash.php0000766000000000000000000000157111234314074027032 0ustar adminadministrators
    :
    ">
    getListFooter(); ?>
    limitstart;?> id ); ?> title; ?> id; ?> sectname; ?> catname; ?>
    :
    ">
    getListFooter(); ?>
    limitstart;?> name; ?> id; ?> menutype; ?> type; ?>
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->name ."
  • "; } echo ""; ?>



     
     


    "; } ?>
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->name ."
  • "; } echo ""; ?>




     


    "; } ?>
    Trash Joomla! Project Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 PARAMTRASH joomla/joomla/administrator/components/com_trash/admin.trash.php0000766000000000000000000002540411234314074026461 0ustar adminadministratorsauthorize( 'com_trash', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JApplicationHelper::getPath( 'admin_html' ) ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $mid = JRequest::getVar( 'mid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); JArrayHelper::toInteger($mid, array(0)); switch ($task) { case 'deleteconfirm': viewdeleteTrash( $cid, $mid, $option ); break; case 'delete': deleteTrash( $cid, $option ); break; case 'restoreconfirm': viewrestoreTrash( $cid, $mid, $option ); break; case 'restore': restoreTrash( $cid, $option ); break; case 'viewMenu': viewTrashMenu( $option ); break; case 'viewContent': viewTrashContent( $option ); break; default: $return = JRequest::getCmd( 'return', 'viewContent', 'post' ); if ( $return == 'viewMenu' ) { viewTrashMenu( $option ); } else { viewTrashContent( $option ); } break; } /** * Compiles a list of trash items */ function viewTrashContent( $option ) { global $mainframe; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( "$option.viewContent.filter_order", 'filter_order', 'sectname', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.viewContent.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where[] = 'c.state = -2'; if ($search) { $where[] = 'LOWER(c.title) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', s.name, cc.name, c.title'; // get the total number of content $query = 'SELECT count(c.id)' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = "content"' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); // Query articles $query = 'SELECT c.title, c.id, c.sectionid, c.catid, g.name AS groupname, cc.title AS catname, s.title AS sectname' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope="content"' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $contents = $db->loadObjectList(); for ( $i = 0; $i < count($contents); $i++ ) { if ( ( $contents[$i]->sectionid == 0 ) && ( $contents[$i]->catid == 0 ) ) { $contents[$i]->sectname = JText::_('UNCATEGORIZED'); } } // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; HTML_trash::showListContent( $option, $contents, $pageNav, $lists ); } /** * Compiles a list of trash items */ function viewTrashMenu( $option ) { global $mainframe; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( "$option.viewMenu.filter_order", 'filter_order', 'm.menutype', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.viewMenu.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $limit = $mainframe->getUserStateFromRequest( "limit", 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( "$option.viewMenu.limitstart", 'limitstart', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $where[] = 'm.published = -2'; if ($search) { $where[] = 'LOWER(m.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order . ' ' . $filter_order_Dir .', m.menutype, m.ordering, m.ordering, m.name'; $query = 'SELECT count(*)' . ' FROM #__menu AS m' . ' LEFT JOIN #__users AS u ON u.id = m.checked_out' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); // Query menu items $query = 'SELECT m.name, m.id, m.menutype, m.type, com.name AS com_name' . ' FROM #__menu AS m' . ' LEFT JOIN #__users AS u ON u.id = m.checked_out' . ' LEFT JOIN #__components AS com ON com.id = m.componentid AND m.type = "components"' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $menus = $db->loadObjectList(); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; HTML_trash::showListMenu( $option, $menus, $pageNav, $lists ); } /** * Compiles a list of the items you have selected to permanently delte */ function viewdeleteTrash( $cid, $mid, $option ) { global $mainframe; $db =& JFactory::getDBO(); $return = JRequest::getCmd( 'return', 'viewContent', 'post' ); JArrayHelper::toInteger($cid, array(0)); JArrayHelper::toInteger($mid, array(0)); // seperate contentids $cids = implode( ',', $cid ); $mids = implode( ',', $mid ); if ( $cids ) { // Articles query $query = 'SELECT a.title AS name' . ' FROM #__content AS a' . ' WHERE ( a.id IN ( '.$cids.' ) )' . ' ORDER BY a.title' ; $db->setQuery( $query ); $items = $db->loadObjectList(); $id = $cid; $type = "content"; } else if ( $mids ) { // Articles query $query = 'SELECT a.name' . ' FROM #__menu AS a' . ' WHERE ( a.id IN ( '.$mids.' ) )' . ' ORDER BY a.name' ; $db->setQuery( $query ); $items = $db->loadObjectList(); $id = $mid; $type = "menu"; } HTML_trash::showDelete( $option, $id, $items, $type, $return ); } /** * Permanently deletes the selected list of trash items */ function deleteTrash( $cid, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $return = JRequest::getCmd( 'return', 'viewContent', 'post' ); $type = JRequest::getCmd( 'type', '', 'post' ); $total = count( $cid ); if ( $type == 'content' ) { $obj =& JTable::getInstance('content'); require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_frontpage'.DS.'tables'.DS.'frontpage.php'); $fp = new TableFrontPage( $db ); foreach ( $cid as $id ) { $id = intval( $id ); $obj->delete( $id ); $fp->delete( $id ); } } else if ( $type == "menu" ) { $obj =& JTable::getInstance('menu'); foreach ( $cid as $id ) { $id = intval( $id ); $obj->delete( $id ); } } $msg = JText::sprintf( 'Item(s) successfully Deleted', $total ); $mainframe->redirect( 'index.php?option='.$option.'&task='.$return, $msg ); } /** * Compiles a list of the items you have selected to permanently delte */ function viewrestoreTrash( $cid, $mid, $option ) { global $mainframe; $db =& JFactory::getDBO(); $return = JRequest::getCmd( 'return', 'viewContent', 'post' ); JArrayHelper::toInteger($cid, array(0)); JArrayHelper::toInteger($mid, array(0)); // seperate contentids $cids = implode( ',', $cid ); $mids = implode( ',', $mid ); if ( $cids ) { // Articles query $query = 'SELECT a.title AS name' . ' FROM #__content AS a' . ' WHERE ( a.id IN ( '.$cids.' ) )' . ' ORDER BY a.title' ; $db->setQuery( $query ); $items = $db->loadObjectList(); $id = $cid; $type = "content"; } else if ( $mids ) { // Articles query $query = 'SELECT a.name' . ' FROM #__menu AS a' . ' WHERE ( a.id IN ( '.$mids.' ) )' . ' ORDER BY a.name' ; $db->setQuery( $query ); $items = $db->loadObjectList(); $id = $mid; $type = "menu"; } HTML_trash::showRestore( $option, $id, $items, $type, $return ); } /** * Restores items selected to normal - restores to an unpublished state */ function restoreTrash( $cid, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db = & JFactory::getDBO(); $type = JRequest::getCmd( 'type', '', 'post' ); $total = count( $cid ); // restores to an unpublished state $state = 0; $ordering = 9999; if ( $type == 'content' ) { $return = 'viewContent'; //seperate contentids JArrayHelper::toInteger($cid, array(0)); $cids = implode( ',', $cid ); // query to restore article $query = 'UPDATE #__content' . ' SET state = '.(int) $state.', ordering = '.(int) $ordering . ' WHERE id IN ( '.$cids.' )' ; $db->setQuery( $query ); if ( !$db->query() ) { JError::raiseError(500, $db->getErrorMsg() ); } } else if ( $type == 'menu' ) { $return = 'viewMenu'; jimport('joomla.application.component.model'); JModel::addIncludePath(JPATH_BASE.DS.'components'.DS.'com_menus'.DS.'models'); $model =& JModel::getInstance('List', 'MenusModel'); $total = $model->fromTrash($cid); if (!$total) { JError::raiseError(500, $db->getErrorMsg() ); } } $msg = JText::sprintf( 'Item(s) successfully Restored', $total ); $mainframe->redirect( 'index.php?option='.$option.'&task='.$return, $msg ); } function ReadMenuXML( $type, $component=-1 ) { // xml file for module $xmlfile = JPATH_ADMINISTRATOR .'/components/com_menus/'. $type .'/'. $type .'.xml'; $data = JApplicationHelper::parseXMLInstallFile($xmlfile); if ( $data['type'] == 'component' || $data['type'] == 'menu' ) { if ( ( $component <> -1 ) && ( $data['name'] == 'Component') ) { $data['name'] .= ' - '. $component; } $row[0] = $data['name']; } return $row; }joomla/joomla/administrator/components/com_trash/toolbar.trash.html.php0000766000000000000000000000314211234314074027771 0ustar adminadministrators['. JText::_( 'Menu Items' ) .']'; } else { $text = ': ['. JText::_( 'Articles' ) .']'; } JToolBarHelper::title( JText::_( 'Trash Manager' ) . $text, 'trash.png' ); JToolBarHelper::custom('restoreconfirm','restore.png','restore_f2.png', 'Restore', true); JToolBarHelper::custom('deleteconfirm','delete.png','delete_f2.png', 'Delete', true); JToolBarHelper::help( 'screen.trashmanager' ); } function _RESTORE() { JToolBarHelper::title( JText::_( 'Restore Items' ), 'restoredb.png' ); JToolBarHelper::cancel(); } function _DELETE() { JToolBarHelper::title( JText::_( 'Delete Items' ), 'delete_f2.png' ); JToolBarHelper::cancel(); } }joomla/joomla/administrator/components/com_trash/index.html0000766000000000000000000000005411234314074025527 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/0000777000000000000000000000000011266551166024420 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/admin.installer.php0000766000000000000000000000321011234314110030167 0ustar adminadministratorsauthorize('com_installer', 'installer')) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } $ext = JRequest::getWord('type'); $subMenus = array( 'Components' => 'components', 'Modules' => 'modules', 'Plugins' => 'plugins', 'Languages' => 'languages', 'Templates' => 'templates'); JSubMenuHelper::addEntry(JText::_( 'Install' ), '#" onclick="javascript:document.adminForm.type.value=\'\';submitbutton(\'installer\');', !in_array( $ext, $subMenus)); foreach ($subMenus as $name => $extension) { JSubMenuHelper::addEntry(JText::_( $name ), '#" onclick="javascript:document.adminForm.type.value=\''.$extension.'\';submitbutton(\'manage\');', ($extension == $ext)); } require_once( JPATH_COMPONENT.DS.'controller.php' ); $controller = new InstallerController( array('default_task' => 'installform') ); //die(JRequest::getCmd('task')); $controller->execute( JRequest::getCmd('task') ); $controller->redirect(); joomla/joomla/administrator/components/com_installer/helper.php0000766000000000000000000000204511234314110026367 0ustar adminadministrators'.JText::_( 'Writable' ).'' : ''.JText::_( 'Unwritable' ).''; } }joomla/joomla/administrator/components/com_installer/views/0000777000000000000000000000000011266551166025555 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/components/0000777000000000000000000000000011266551166027742 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/components/tmpl/0000777000000000000000000000000011266551166030716 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/components/tmpl/default.php0000766000000000000000000000327411234314110033037 0ustar adminadministrators
    showMessage) : ?> loadTemplate('message'); ?> ftp) : ?> loadTemplate('ftp'); ?> items)) : ?> items), $rc=0; $i < $n; $i++, $rc = 1 - $rc) : ?> loadItem($i); echo $this->loadTemplate('item'); ?>
    pagination->getListFooter(); ?>
    joomla/joomla/administrator/components/com_installer/views/components/tmpl/default_item.php0000766000000000000000000000332511234314110034052 0ustar adminadministrators item->index % 2; ?>" item->style; ?>> pagination->getRowOffset( $this->item->index ); ?> item->cbd; ?> /> item->name; ?> item->option) : ?> X <?php echo $this->item->alt; ?> item->version != '' ? $this->item->version : ' '; ?> item->creationdate != '' ? $this->item->creationdate : ' '; ?> item->author != '' ? $this->item->author : ' '; ?> joomla/joomla/administrator/components/com_installer/views/components/tmpl/index.html0000766000000000000000000000005411234314110032670 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/components/view.php0000766000000000000000000000365411234314110031413 0ustar adminadministratorsget('State'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); parent::display($tpl); } function loadItem($index=0) { $item =& $this->items[$index]; $item->index = $index; $item->img = $item->enabled ? 'tick.png' : 'publish_x.png'; $item->task = $item->enabled ? 'disable' : 'enable'; $item->alt = $item->enabled ? JText::_( 'Enabled' ) : JText::_( 'Disabled' ); $item->action = $item->enabled ? JText::_( 'disable' ) : JText::_( 'enable' ); if ($item->iscore) { $item->cbd = 'disabled'; $item->style = 'style="color:#999999;"'; } else { $item->cbd = null; $item->style = null; } $item->author_info = @$item->authorEmail .'
    '. @$item->authorUrl; $this->assignRef('item', $item); } } joomla/joomla/administrator/components/com_installer/views/components/index.html0000766000000000000000000000005411234314110031714 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/install/0000777000000000000000000000000011266551165027222 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/install/tmpl/0000777000000000000000000000000011266551165030176 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/install/tmpl/default.php0000766000000000000000000000033411234314110032312 0ustar adminadministrators showMessage) : ?> loadTemplate('message'); ?> loadTemplate('form'); ?> joomla/joomla/administrator/components/com_installer/views/install/tmpl/index.html0000766000000000000000000000005411234314110032151 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/install/tmpl/default_form.php0000766000000000000000000000527011234314110033341 0ustar adminadministrators
    ftp) : ?> loadTemplate('ftp'); ?>
    joomla/joomla/administrator/components/com_installer/views/install/view.php0000766000000000000000000000221411234314110030663 0ustar adminadministratorsfirst = ''; $this->assignRef('paths', $paths); $this->assignRef('state', $this->get('state')); parent::display($tpl); } }joomla/joomla/administrator/components/com_installer/views/install/index.html0000766000000000000000000000005411234314110031175 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/modules/0000777000000000000000000000000011266551160027217 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/modules/tmpl/0000777000000000000000000000000011266551161030174 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/modules/tmpl/default.php0000766000000000000000000000340511234314110032316 0ustar adminadministrators
    ftp) : ?> loadTemplate('ftp'); ?>
    lists->client; ?>
    items)) : ?> items), $rc=0; $i < $n; $i++, $rc = 1 - $rc) : ?> loadItem($i); echo $this->loadTemplate('item'); ?>
    pagination->getListFooter(); ?>
    joomla/joomla/administrator/components/com_installer/views/modules/tmpl/default_item.php0000766000000000000000000000255711234314110033343 0ustar adminadministrators item->index % 2; ?>" item->style; ?>> pagination->getRowOffset( $this->item->index ); ?> item->cbd; ?> /> item->module; ?> item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?> item->version != '' ? $this->item->version : ' '; ?> item->creationdate != '' ? $this->item->creationdate : ' '; ?> item->author != '' ? $this->item->author : ' '; ?> joomla/joomla/administrator/components/com_installer/views/modules/tmpl/index.html0000766000000000000000000000005411234314110032153 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/modules/view.php0000766000000000000000000000425111234314110030670 0ustar adminadministratorsget('State'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $lists = new stdClass(); $select[] = JHTML::_('select.option', '-1', JText::_('All')); $select[] = JHTML::_('select.option', '0', JText::_('Site Modules')); $select[] = JHTML::_('select.option', '1', JText::_('Admin Modules')); $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client')); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); JHTML::_('behavior.tooltip'); parent::display($tpl); } function loadItem($index=0) { $item =& $this->items[$index]; $item->index = $index; if ($item->iscore) { $item->cbd = 'disabled'; $item->style = 'style="color:#999999;"'; } else { $item->cbd = null; $item->style = null; } $item->author_info = @$item->authorEmail .'
    '. @$item->authorUrl; $this->assignRef('item', $item); } } joomla/joomla/administrator/components/com_installer/views/modules/index.html0000766000000000000000000000005411234314110031177 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/plugins/0000777000000000000000000000000011266551157027236 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/plugins/tmpl/0000777000000000000000000000000011266551160030204 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/plugins/tmpl/default.php0000766000000000000000000000336211234314110032331 0ustar adminadministrators
    ftp) : ?> loadTemplate('ftp'); ?>
    fields->groups; ?>
    items)) : ?> items), $rc=0; $i < $n; $i++, $rc = 1 - $rc) : ?> loadItem($i); echo $this->loadTemplate('item'); ?>
    pagination->getListFooter(); ?>
    joomla/joomla/administrator/components/com_installer/views/plugins/tmpl/default_item.php0000766000000000000000000000254211234314110033346 0ustar adminadministrators item->index % 2; ?>" item->style; ?>> pagination->getRowOffset( $this->item->index ); ?> item->cbd; ?> /> item->name; ?> item->folder; ?> item->legacy) echo 'class="legacy-mode"'; ?>>item->version != '' ? $this->item->version : ' '; ?> item->creationdate != '' ? $this->item->creationdate : ' '; ?> item->author != '' ? $this->item->author : ' '; ?> joomla/joomla/administrator/components/com_installer/views/plugins/tmpl/index.html0000766000000000000000000000005411234314110032164 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/plugins/view.php0000766000000000000000000000374011234314110030703 0ustar adminadministratorsget('State'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $groups = &$this->get('Groups'); $fields = new stdClass(); $fields->groups = JHTML::_('select.genericlist', $groups, 'group', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $state->get('filter.group') ); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('fields', $fields); parent::display($tpl); } function loadItem($index=0) { $item =& $this->items[$index]; $item->index = $index; if ($item->iscore) { $item->cbd = 'disabled'; $item->style = 'style="color:#999999;"'; } else { $item->cbd = null; $item->style = null; } $item->author_info = @$item->authorEmail .'
    '. @$item->authorUrl; $this->assignRef('item', $item); } } joomla/joomla/administrator/components/com_installer/views/plugins/index.html0000766000000000000000000000005411234314110031210 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/default/0000777000000000000000000000000011266551166027201 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/default/tmpl/0000777000000000000000000000000011266551166030155 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/default/tmpl/default_message.php0000766000000000000000000000071311234314110033775 0ustar adminadministratorsget('State'); $message1 = $state->get('message'); $message2 = $state->get('extension.message'); ?>
    joomla/joomla/administrator/components/com_installer/views/default/tmpl/default_ftp.php0000766000000000000000000000160211234314110033140 0ustar adminadministrators
    ftp)): ?>

    ftp->message); ?>

    joomla/joomla/administrator/components/com_installer/views/default/tmpl/index.html0000766000000000000000000000005411234314110032127 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/default/view.php0000766000000000000000000000347111234314110030647 0ustar adminadministrators_addPath('template', $this->_basePath.DS.'views'.DS.'default'.DS.'tmpl'); } function display($tpl=null) { /* * Set toolbar items for the page */ JToolBarHelper::title( JText::_( 'Extension Manager'), 'install.png' ); // Document $document = & JFactory::getDocument(); $document->setTitle(JText::_('Extension Manager').' : '.JText::_( $this->getName() )); // Get data from the model $state = &$this->get('State'); // Are there messages to display ? $showMessage = false; if ( is_object($state) ) { $message1 = $state->get('message'); $message2 = $state->get('extension.message'); $showMessage = ( $message1 || $message2 ); } $this->assign('showMessage', $showMessage); $this->assignRef('state', $state); JHTML::_('behavior.tooltip'); parent::display($tpl); } /** * Should be overloaded by extending view * * @param int $index */ function loadItem($index=0) { } }joomla/joomla/administrator/components/com_installer/views/default/index.html0000766000000000000000000000005411234314110031153 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/languages/0000777000000000000000000000000011266551164027521 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/languages/tmpl/0000777000000000000000000000000011266551165030476 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/languages/tmpl/default.php0000766000000000000000000000326711234314110032622 0ustar adminadministrators
    ftp) : ?> loadTemplate('ftp'); ?>
    lists->client; ?>
    items)) : ?> items), $rc=0; $i < $n; $i++, $rc = 1 - $rc) : ?> loadItem($i); echo $this->loadTemplate('item'); ?>
    pagination->getListFooter(); ?>
    joomla/joomla/administrator/components/com_installer/views/languages/tmpl/default_item.php0000766000000000000000000000211411234314110033626 0ustar adminadministrators item->index % 2; ?>" item->style; ?>> pagination->getRowOffset( $this->item->index ); ?> item->cbd; ?> /> item->name; ?> item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?> item->version != '' ? $this->item->version : ' '; ?> item->creationdate != '' ? $this->item->creationdate : ' '; ?> item->author != '' ? $this->item->author : ' '; ?> joomla/joomla/administrator/components/com_installer/views/languages/tmpl/index.html0000766000000000000000000000005411234314110032451 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/languages/view.php0000766000000000000000000000424311234314110031167 0ustar adminadministratorsget('State'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $lists = new stdClass(); $select[] = JHTML::_('select.option', '-1', JText::_('All')); $select[] = JHTML::_('select.option', '0', JText::_('Site Languages')); $select[] = JHTML::_('select.option', '1', JText::_('Admin Languages')); $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client')); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); parent::display($tpl); } function loadItem($index=0) { $item =& $this->items[$index]; $item->index = $index; if ($item->published) { $item->cbd = 'disabled'; $item->style = 'style="color:#999999;"'; } else { $item->cbd = null; $item->style = null; } $item->author_info = @$item->authorEmail .'
    '. @$item->authorUrl; $this->assignRef('item', $item); } } joomla/joomla/administrator/components/com_installer/views/languages/index.html0000766000000000000000000000005411234314110031475 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/index.html0000766000000000000000000000005411234314110027527 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/templates/0000777000000000000000000000000011266551157027553 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/templates/tmpl/0000777000000000000000000000000011266551157030527 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/templates/tmpl/default.php0000766000000000000000000000341011234314110032640 0ustar adminadministrators
    ftp) : ?> loadTemplate('ftp'); ?>
    lists->client; ?>
    items)) : ?> items), $rc=0; $i < $n; $i++, $rc = 1 - $rc) : ?> loadItem($i); echo $this->loadTemplate('item'); ?>
    pagination->getListFooter(); ?>
    joomla/joomla/administrator/components/com_installer/views/templates/tmpl/default_item.php0000766000000000000000000000266211234314110033666 0ustar adminadministrators item->index % 2; ?>" item->style; ?>> pagination->getRowOffset( $this->item->index ); ?> item->cbd; ?> /> item->name; ?> item->client_id == "0" ? JText::_( 'Site' ) : JText::_( 'Admin' ); ?> item->legacy) echo 'class="legacy-mode"'; ?>>item->version != '' ? $this->item->version : ' '; ?> item->creationdate != '' ? $this->item->creationdate : ' '; ?> item->author != '' ? $this->item->author : ' '; ?> joomla/joomla/administrator/components/com_installer/views/templates/tmpl/index.html0000766000000000000000000000005411234314110032501 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/views/templates/view.php0000766000000000000000000000421211234314110031213 0ustar adminadministratorsget('State'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $lists = new stdClass(); $select[] = JHTML::_('select.option', '-1', JText::_('All')); $select[] = JHTML::_('select.option', '0', JText::_('Site Templates')); $select[] = JHTML::_('select.option', '1', JText::_('Admin Templates')); $lists->client = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state->get('filter.client')); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); parent::display($tpl); } function loadItem($index=0) { $item =& $this->items[$index]; $item->id = $item->directory; $item->index = $index; if ($item->active) { $item->cbd = 'disabled'; $item->style = 'style="color:#999999;"'; } else { $item->cbd = null; $item->style = null; } $item->author_information = @$item->authorEmail .'
    '. @$item->authorUrl; $this->assignRef('item', $item); } } joomla/joomla/administrator/components/com_installer/views/templates/index.html0000766000000000000000000000005411234314110031525 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/controller.php0000766000000000000000000001105711234314110027276 0ustar adminadministratorsgetModel( 'Install' ); $model->setState( 'install.directory', $mainframe->getCfg( 'config.tmp_path' )); $view = &$this->getView( 'Install'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); $view->setModel( $model, true ); $view->display(); } /** * Install an extension * * @access public * @return void * @since 1.5 */ function doInstall() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = &$this->getModel( 'Install' ); $view = &$this->getView( 'Install' ); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); if ($model->install()) { $cache = &JFactory::getCache('mod_menu'); $cache->clean(); } $view->setModel( $model, true ); $view->display(); } /** * Manage an extension type (List extensions of a given type) * * @access public * @return void * @since 1.5 */ function manage() { $type = JRequest::getWord('type', 'components'); $model = &$this->getModel( $type ); $view = &$this->getView( $type ); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); $view->setModel( $model, true ); $view->display(); } /** * Enable an extension (If supported) * * @access public * @return void * @since 1.5 */ function enable() { // Check for request forgeries JRequest::checkToken( 'request' ) or jexit( 'Invalid Token' ); $type = JRequest::getWord('type', 'components'); $model = &$this->getModel( $type ); $view = &$this->getView( $type ); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); if (method_exists($model, 'enable')) { $eid = JRequest::getVar('eid', array(), '', 'array'); JArrayHelper::toInteger($eid, array()); $model->enable($eid); } $view->setModel( $model, true ); $view->display(); } /** * Disable an extension (If supported) * * @access public * @return void * @since 1.5 */ function disable() { // Check for request forgeries JRequest::checkToken( 'request' ) or jexit( 'Invalid Token' ); $type = JRequest::getWord('type', 'components'); $model = &$this->getModel( $type ); $view = &$this->getView( $type ); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); if (method_exists($model, 'disable')) { $eid = JRequest::getVar('eid', array(), '', 'array'); JArrayHelper::toInteger($eid, array()); $model->disable($eid); } $view->setModel( $model, true ); $view->display(); } /** * Remove an extension (Uninstall) * * @access public * @return void * @since 1.5 */ function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $type = JRequest::getWord('type', 'components'); $model = &$this->getModel( $type ); $view = &$this->getView( $type ); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $view->assignRef('ftp', $ftp); $eid = JRequest::getVar('eid', array(), '', 'array'); // Update to handle components radio box // Checks there is only one extensions, we're uninstalling components // and then checks that the zero numbered item is set (shouldn't be a zero // if the eid is set to the proper format) if((count($eid) == 1) && ($type == 'components') && (isset($eid[0]))) $eid = array($eid[0] => 0); JArrayHelper::toInteger($eid, array()); $result = $model->remove($eid); $view->setModel( $model, true ); $view->display(); } }joomla/joomla/administrator/components/com_installer/installer.xml0000766000000000000000000000102111234314110027107 0ustar adminadministrators Installation Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Installation Manager joomla/joomla/administrator/components/com_installer/index.html0000766000000000000000000000005411234314110026372 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/models/0000777000000000000000000000000011266551167025704 5ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/models/languages.php0000766000000000000000000001465611234314110030354 0ustar adminadministratorssetState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.languages.string", 'filter', '', 'string' )); $this->setState('filter.client', $mainframe->getUserStateFromRequest( "com_installer.languages.client", 'client', -1, 'int' )); } function _loadItems() { global $mainframe, $option; $db = &JFactory::getDBO(); if ($this->_state->get('filter.client') < 0) { $client = 'all'; // Get the site languages $langBDir = JLanguage::getLanguagePath(JPATH_SITE); $langDirs = JFolder::folders($langBDir); for ($i=0; $i < count($langDirs); $i++) { $lang = new stdClass(); $lang->folder = $langDirs[$i]; $lang->client = 0; $lang->baseDir = $langBDir; $languages[] = $lang; } // Get the admin languages $langBDir = JLanguage::getLanguagePath(JPATH_ADMINISTRATOR); $langDirs = JFolder::folders($langBDir); for ($i=0; $i < count($langDirs); $i++) { $lang = new stdClass(); $lang->folder = $langDirs[$i]; $lang->client = 1; $lang->baseDir = $langBDir; $languages[] = $lang; } } else { $clientInfo =& JApplicationHelper::getClientInfo($this->_state->get('filter.client')); $client = $clientInfo->name; $langBDir = JLanguage::getLanguagePath($clientInfo->path); $langDirs = JFolder::folders($langBDir); for ($i=0, $n=count($langDirs); $i < $n; $i++) { $lang = new stdClass(); $lang->folder = $langDirs[$i]; $lang->client = $clientInfo->id; $lang->baseDir = $langBDir; if ($this->_state->get('filter.string')) { if (strpos($lang->folder, $this->_state->get('filter.string')) !== false) { $languages[] = $lang; } } else { $languages[] = $lang; } } } $rows = array(); $rowid = 0; foreach ($languages as $language) { $files = JFolder::files( $language->baseDir.DS.$language->folder, '^([-_A-Za-z]*)\.xml$' ); foreach ($files as $file) { $data = JApplicationHelper::parseXMLLangMetaFile($language->baseDir.DS.$language->folder.DS.$file); $row = new StdClass(); $row->id = $rowid; $row->client_id = $language->client; $row->language = $language->baseDir.DS.$language->folder; // If we didn't get valid data from the xml file, move on... if (!is_array($data)) { continue; } // Populate the row from the xml meta file foreach($data as $key => $value) { $row->$key = $value; } // if current than set published $clientVals =& JApplicationHelper::getClientInfo($row->client_id); $lang = JComponentHelper::getParams('com_languages'); if ( $lang->get($clientVals->name, 'en-GB') == basename( $row->language ) ) { $row->published = 1; } else { $row->published = 0; } $row->checked_out = 0; $row->jname = JString::strtolower( str_replace( " ", "_", $row->name ) ); $rows[] = $row; $rowid++; } } $this->setState('pagination.total', count($rows)); // if the offset is greater than the total, then can the offset if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) { $this->setState('pagination.offset',0); } if($this->_state->get('pagination.limit') > 0) { $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') ); } else { $this->_items = $rows; } } /** * Remove (uninstall) an extension * * @static * @return boolean True on success * @since 1.0 */ function remove($eid=array()) { global $mainframe; $lang =& JFactory::getLanguage(); $lang->load('com_installer'); // Initialize variables $failed = array (); /* * Ensure eid is an array of extension ids * TODO: If it isn't an array do we want to set an error and fail? */ if (!is_array($eid)) { $eid = array ($eid); } // construct the list of all language $this->_loadItems(); // Get a database connector $db =& JFactory::getDBO(); // Get an installer object for the extension type jimport('joomla.installer.installer'); $installer =& JInstaller::getInstance($db, $this->_type); // Uninstall the chosen extensions foreach ($eid as $id) { $item = $this->_items[$id]; // Get client information $client =& JApplicationHelper::getClientInfo($item->client_id); // Don't delete a default ( published language ) $params = JComponentHelper::getParams('com_languages'); $tag = basename($item->language); if ( $params->get($client->name, 'en-GB') == $tag ) { $failed[] = $id; JError::raiseWarning('', JText::_('UNINSTALLLANGPUBLISHEDALREADY')); return; } $result = $installer->uninstall( 'language', $item->language ); // Build an array of extensions that failed to uninstall if ($result === false) { $failed[] = $id; } } if (count($failed)) { // There was an error in uninstalling the package $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Error')); $result = false; } else { // Package uninstalled sucessfully $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Success')); $result = true; } $mainframe->enqueueMessage($msg); $this->setState('action', 'remove'); $this->setState('message', $installer->message); // re-construct the list of all language $this->_loadItems(); return $result; } }joomla/joomla/administrator/components/com_installer/models/extension.php0000766000000000000000000000742211234314110030413 0ustar adminadministratorssetState('pagination.limit', $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int')); $this->setState('pagination.offset',$mainframe->getUserStateFromRequest('com_installer.limitstart.'.$this->_type, 'limitstart', 0, 'int')); $this->setState('pagination.total', 0); } function &getItems() { if (empty($this->_items)) { // Load the items $this->_loadItems(); } return $this->_items; } function &getPagination() { if (empty($this->_pagination)) { // Make sure items are loaded for a proper total if (empty($this->_items)) { // Load the items $this->_loadItems(); } // Load the pagination object jimport('joomla.html.pagination'); $this->_pagination = new JPagination($this->_state->get('pagination.total'), $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit')); } return $this->_pagination; } /** * Remove (uninstall) an extension * * @static * @param array An array of identifiers * @return boolean True on success * @since 1.0 */ function remove($eid=array()) { global $mainframe; // Initialize variables $failed = array (); /* * Ensure eid is an array of extension ids in the form id => client_id * TODO: If it isn't an array do we want to set an error and fail? */ if (!is_array($eid)) { $eid = array($eid => 0); } // Get a database connector $db =& JFactory::getDBO(); // Get an installer object for the extension type jimport('joomla.installer.installer'); $installer = & JInstaller::getInstance(); // Uninstall the chosen extensions foreach ($eid as $id => $clientId) { $id = trim( $id ); $result = $installer->uninstall($this->_type, $id, $clientId ); // Build an array of extensions that failed to uninstall if ($result === false) { $failed[] = $id; } } if (count($failed)) { // There was an error in uninstalling the package $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Error')); $result = false; } else { // Package uninstalled sucessfully $msg = JText::sprintf('UNINSTALLEXT', JText::_($this->_type), JText::_('Success')); $result = true; } $mainframe->enqueueMessage($msg); $this->setState('action', 'remove'); $this->setState('name', $installer->get('name')); $this->setState('message', $installer->message); $this->setState('extension.message', $installer->get('extension.message')); return $result; } function _loadItems() { return JError::raiseError( 500, JText::_('Method Not Implemented')); } }joomla/joomla/administrator/components/com_installer/models/templates.php0000766000000000000000000001153711234314110030377 0ustar adminadministratorssetState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.templates.string", 'filter', '', 'string' )); $this->setState('filter.client', $mainframe->getUserStateFromRequest( "com_installer.templates.client", 'client', -1, 'int' )); } function _loadItems() { global $mainframe, $option; $db = &JFactory::getDBO(); if ($this->_state->get('filter.client') < 0) { $client = 'all'; // Get the site templates $templateDirs = JFolder::folders(JPATH_SITE.DS.'templates'); for ($i=0; $i < count($templateDirs); $i++) { $template = new stdClass(); $template->folder = $templateDirs[$i]; $template->client = 0; $template->baseDir = JPATH_SITE.DS.'templates'; if ($this->_state->get('filter.string')) { if (strpos($template->folder, $this->_state->get('filter.string')) !== false) { $templates[] = $template; } } else { $templates[] = $template; } } // Get the admin templates $templateDirs = JFolder::folders(JPATH_ADMINISTRATOR.DS.'templates'); for ($i=0; $i < count($templateDirs); $i++) { $template = new stdClass(); $template->folder = $templateDirs[$i]; $template->client = 1; $template->baseDir = JPATH_ADMINISTRATOR.DS.'templates'; if ($this->_state->get('filter.string')) { if (strpos($template->folder, $this->_state->get('filter.string')) !== false) { $templates[] = $template; } } else { $templates[] = $template; } } } else { $clientInfo =& JApplicationHelper::getClientInfo($this->_state->get('filter.client')); $client = $clientInfo->name; $templateDirs = JFolder::folders($clientInfo->path.DS.'templates'); for ($i=0; $i < count($templateDirs); $i++) { $template = new stdClass(); $template->folder = $templateDirs[$i]; $template->client = $clientInfo->id; $template->baseDir = $clientInfo->path.DS.'templates'; if ($this->_state->get('filter.string')) { if (strpos($template->folder, $this->_state->get('filter.string')) !== false) { $templates[] = $template; } } else { $templates[] = $template; } } } // Get a list of the currently active templates $query = 'SELECT template' . ' FROM #__templates_menu' . ' WHERE 1'; $db->setQuery($query); $activeList = $db->loadResultArray(); $rows = array(); $rowid = 0; // Check that the directory contains an xml file foreach($templates as $template) { $dirName = $template->baseDir .DS. $template->folder; $xmlFilesInDir = JFolder::files($dirName,'.xml$'); foreach($xmlFilesInDir as $xmlfile) { $data = JApplicationHelper::parseXMLInstallFile($dirName . DS. $xmlfile); $row = new StdClass(); $row->id = $rowid; $row->client_id = $template->client; $row->directory = $template->folder; $row->baseDir = $template->baseDir; // Is the template active? if (in_array($row->directory, $activeList)) { $row->active = true; } else { $row->active = false; } if ($data) { foreach($data as $key => $value) { $row->$key = $value; } } $row->checked_out = 0; $row->jname = JString::strtolower( str_replace( ' ', '_', $row->name ) ); $rows[] = $row; $rowid++; } } $this->setState('pagination.total', count($rows)); // if the offset is greater than the total, then can the offset if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) { $this->setState('pagination.offset',0); } if($this->_state->get('pagination.limit') > 0) { $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') ); } else { $this->_items = $rows; } } }joomla/joomla/administrator/components/com_installer/models/install.php0000766000000000000000000001365411234314110030051 0ustar adminadministratorssetState('action', 'install'); switch(JRequest::getWord('installtype')) { case 'folder': $package = $this->_getPackageFromFolder(); break; case 'upload': $package = $this->_getPackageFromUpload(); break; case 'url': $package = $this->_getPackageFromUrl(); break; default: $this->setState('message', 'No Install Type Found'); return false; break; } // Was the package unpacked? if (!$package) { $this->setState('message', 'Unable to find install package'); return false; } // Get a database connector //$db = & JFactory::getDBO(); // Get an installer instance $installer =& JInstaller::getInstance(); // Install the package if (!$installer->install($package['dir'])) { // There was an error installing the package $msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Error')); $result = false; } else { // Package installed sucessfully $msg = JText::sprintf('INSTALLEXT', JText::_($package['type']), JText::_('Success')); $result = true; } // Set some model state values $mainframe->enqueueMessage($msg); $this->setState('name', $installer->get('name')); $this->setState('result', $result); $this->setState('message', $installer->message); $this->setState('extension.message', $installer->get('extension.message')); // Cleanup the install files if (!is_file($package['packagefile'])) { $config =& JFactory::getConfig(); $package['packagefile'] = $config->getValue('config.tmp_path').DS.$package['packagefile']; } JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']); return $result; } /** * @param string The class name for the installer */ function _getPackageFromUpload() { // Get the uploaded file information $userfile = JRequest::getVar('install_package', null, 'files', 'array' ); // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLFILE')); return false; } // Make sure that zlib is loaded so that the package can be unpacked if (!extension_loaded('zlib')) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLZLIB')); return false; } // If there is no uploaded file, we have a problem... if (!is_array($userfile) ) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('No file selected')); return false; } // Check if there was a problem uploading the file. if ( $userfile['error'] || $userfile['size'] < 1 ) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('WARNINSTALLUPLOADERROR')); return false; } // Build the appropriate paths $config =& JFactory::getConfig(); $tmp_dest = $config->getValue('config.tmp_path').DS.$userfile['name']; $tmp_src = $userfile['tmp_name']; // Move uploaded file jimport('joomla.filesystem.file'); $uploaded = JFile::upload($tmp_src, $tmp_dest); // Unpack the downloaded package file $package = JInstallerHelper::unpack($tmp_dest); return $package; } /** * Install an extension from a directory * * @static * @return boolean True on success * @since 1.0 */ function _getPackageFromFolder() { // Get the path to the package to install $p_dir = JRequest::getString('install_directory'); $p_dir = JPath::clean( $p_dir ); // Did you give us a valid directory? if (!is_dir($p_dir)) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('Please enter a package directory')); return false; } // Detect the package type $type = JInstallerHelper::detectType($p_dir); // Did you give us a valid package? if (!$type) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('Path does not have a valid package')); return false; } $package['packagefile'] = null; $package['extractdir'] = null; $package['dir'] = $p_dir; $package['type'] = $type; return $package; } /** * Install an extension from a URL * * @static * @return boolean True on success * @since 1.5 */ function _getPackageFromUrl() { // Get a database connector $db = & JFactory::getDBO(); // Get the URL of the package to install $url = JRequest::getString('install_url'); // Did you give us a URL? if (!$url) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('Please enter a URL')); return false; } // Download the package at the URL given $p_file = JInstallerHelper::downloadPackage($url); // Was the package downloaded? if (!$p_file) { JError::raiseWarning('SOME_ERROR_CODE', JText::_('Invalid URL')); return false; } $config =& JFactory::getConfig(); $tmp_dest = $config->getValue('config.tmp_path'); // Unpack the downloaded package file $package = JInstallerHelper::unpack($tmp_dest.DS.$p_file); return $package; } }joomla/joomla/administrator/components/com_installer/models/modules.php0000766000000000000000000000642611234314110030052 0ustar adminadministratorssetState('filter.string', $mainframe->getUserStateFromRequest( 'com_installer.modules.string', 'filter', '', 'string' )); $this->setState('filter.client', $mainframe->getUserStateFromRequest( 'com_installer.modules.client', 'client', -1, 'int' )); } function _loadItems() { global $mainframe, $option; $db = &JFactory::getDBO(); $and = null; if ($this->_state->get('filter.client') < 0) { if ($search = $this->_state->get('filter.string')) { $and = ' AND title LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } } else { if ($search = $this->_state->get('filter.string')) { $and = ' AND client_id = '.(int)$this->_state->get('filter.client'); $and .= ' AND title LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } else { $and = ' AND client_id = '.(int)$this->_state->get('filter.client'); } } $query = 'SELECT id, module, client_id, title, iscore' . ' FROM #__modules' . ' WHERE module LIKE "mod_%" ' . $and . ' GROUP BY module, client_id' . ' ORDER BY iscore, client_id, module'; $db->setQuery($query); $rows = $db->loadObjectList(); $n = count($rows); for ($i = 0; $i < $n; $i ++) { $row = & $rows[$i]; // path to module directory if ($row->client_id == "1") { $moduleBaseDir = JPATH_ADMINISTRATOR.DS."modules"; } else { $moduleBaseDir = JPATH_SITE.DS."modules"; } // xml file for module $xmlfile = $moduleBaseDir . DS . $row->module .DS. $row->module.".xml"; if (file_exists($xmlfile)) { if ($data = JApplicationHelper::parseXMLInstallFile($xmlfile)) { foreach($data as $key => $value) { $row->$key = $value; } } } } $this->setState('pagination.total', $n); // if the offset is greater than the total, then can the offset if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) { $this->setState('pagination.offset',0); } if($this->_state->get('pagination.limit') > 0) { $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') ); } else { $this->_items = $rows; } } }joomla/joomla/administrator/components/com_installer/models/index.html0000766000000000000000000000005411234314110027655 0ustar adminadministratorsjoomla/joomla/administrator/components/com_installer/models/plugins.php0000766000000000000000000000713411234314110030060 0ustar adminadministratorssetState('filter.group', $mainframe->getUserStateFromRequest( "com_installer.plugins.group", 'group', '', 'cmd' )); $this->setState('filter.string', $mainframe->getUserStateFromRequest( "com_installer.plugins.string", 'filter', '', 'string' )); } function &getGroups() { // Get a database connector object $db = &$this->getDBO(); // get list of Positions for dropdown filter $query = 'SELECT folder AS value, folder AS text' . ' FROM #__plugins' . ' GROUP BY folder' . ' ORDER BY folder'; $db->setQuery( $query ); $types[] = JHTML::_('select.option', '', JText::_( 'All' ) ); $types = array_merge( $types, $db->loadObjectList() ); return $types; } function _loadItems() { global $mainframe, $option; // Get a database connector $db = & JFactory::getDBO(); $where = null; if ($this->_state->get('filter.group')) { if ($search = $this->_state->get('filter.string')) { $where = ' WHERE folder = "'.$db->getEscaped($this->_state->get('filter.group')).'"'; $where .= ' AND name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } else { $where = ' WHERE folder = "'.$db->getEscaped($this->_state->get('filter.group')).'"'; } } else { if ($search = $this->_state->get('filter.string')) { $where .= ' WHERE name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } } $query = 'SELECT id, name, folder, element, client_id, iscore' . ' FROM #__plugins' . $where . ' ORDER BY iscore, folder, name'; $db->setQuery($query); $rows = $db->loadObjectList(); // Get the plugin base path $baseDir = JPATH_ROOT.DS.'plugins'; $numRows = count($rows); for ($i = 0; $i < $numRows; $i ++) { $row = & $rows[$i]; // Get the plugin xml file $xmlfile = $baseDir.DS.$row->folder.DS.$row->element.".xml"; if (file_exists($xmlfile)) { if ($data = JApplicationHelper::parseXMLInstallFile($xmlfile)) { foreach($data as $key => $value) { $row->$key = $value; } } } } $this->setState('pagination.total', $numRows); // if the offset is greater than the total, then can the offset if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) { $this->setState('pagination.offset',0); } if($this->_state->get('pagination.limit') > 0) { $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') ); } else { $this->_items = $rows; } } }joomla/joomla/administrator/components/com_installer/models/components.php0000766000000000000000000001004411234314110030556 0ustar adminadministrators_type); // Enable the extension in the table and store it in the database foreach ($eid as $id) { $table->load($id); $table->enabled = '1'; $result |= $table->store(); } return $result; } /** * Disable a component * * @return boolean True on success * @since 1.5 */ function disable($eid=array()) { // Initialize variables $result = false; /* * Ensure eid is an array of extension ids * TODO: If it isn't an array do we want to set an error and fail? */ if (!is_array($eid)) { $eid = array ($eid); } // Get a database connector $db =& JFactory::getDBO(); // Get a table object for the extension type $table = & JTable::getInstance($this->_type); // Disable the extension in the table and store it in the database foreach ($eid as $id) { $table->load($id); $table->enabled = '0'; $result |= $table->store(); } return $result; } function _loadItems() { global $mainframe, $option; jimport('joomla.filesystem.folder'); /* Get a database connector */ $db =& JFactory::getDBO(); $query = 'SELECT *' . ' FROM #__components' . ' WHERE parent = 0' . ' ORDER BY iscore, name'; $db->setQuery($query); $rows = $db->loadObjectList(); /* Get the component base directory */ $adminDir = JPATH_ADMINISTRATOR .DS. 'components'; $siteDir = JPATH_SITE .DS. 'components'; $numRows = count($rows); for($i=0;$i < $numRows; $i++) { $row =& $rows[$i]; /* Get the component folder and list of xml files in folder */ $folder = $adminDir.DS.$row->option; if (JFolder::exists($folder)) { $xmlFilesInDir = JFolder::files($folder, '.xml$'); } else { $folder = $siteDir.DS.$row->option; if (JFolder::exists($folder)) { $xmlFilesInDir = JFolder::files($folder, '.xml$'); } else { $xmlFilesInDir = null; } } if (count($xmlFilesInDir)) { foreach ($xmlFilesInDir as $xmlfile) { if ($data = JApplicationHelper::parseXMLInstallFile($folder.DS.$xmlfile)) { foreach($data as $key => $value) { $row->$key = $value; } } $row->jname = JString::strtolower(str_replace(" ", "_", $row->name)); } } } $this->setState('pagination.total', $numRows); // if the offset is greater than the total, then can the offset if($this->_state->get('pagination.offset') > $this->_state->get('pagination.total')) { $this->setState('pagination.offset',0); } if($this->_state->get('pagination.limit') > 0) { $this->_items = array_slice( $rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit') ); } else { $this->_items = $rows; } } }joomla/joomla/administrator/components/com_plugins/0000777000000000000000000000000011266551131024074 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/controllers/0000777000000000000000000000000011266551131026442 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/controllers/index.html0000766000000000000000000000005411234314076030437 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/0000777000000000000000000000000011266551131025231 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugins/0000777000000000000000000000000011266551130026711 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugins/tmpl/0000777000000000000000000000000011266551130027665 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugins/tmpl/default.php0000766000000000000000000001161311234314076032026 0ustar adminadministrators lists['order'] == 'p.folder' || $this->lists['order'] == 'p.ordering'); $rows =& $this->items; ?>
    : lists['type']; echo $this->lists['state']; ?>
    client .'&task=edit&cid[]='. $row->id ); $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> ">
    lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?>
    pagination->getListFooter(); ?>
    pagination->getRowOffset( $i ); ?> user->get ('id'), $row->checked_out ) ) { echo $row->name; } else { ?> name; ?> pagination->orderUpIcon( $i, ($row->folder == @$rows[$i-1]->folder && $row->ordering > -10000 && $row->ordering < 10000), 'orderup', 'Move Up', $ordering ); ?> pagination->orderDownIcon( $i, $n, ($row->folder == @$rows[$i+1]->folder && $row->ordering > -10000 && $row->ordering < 10000), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> folder;?> element;?> id;?>
    joomla/joomla/administrator/components/com_plugins/views/plugins/tmpl/index.html0000766000000000000000000000005411234314076031663 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugins/view.html.php0000766000000000000000000001060711234314076031345 0ustar adminadministratorsgetUserStateFromRequest( "$option.$client.filter_order", 'filter_order', 'p.folder', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.$client.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( "$option.$client.filter_state", 'filter_state', '', 'word' ); $filter_type = $mainframe->getUserStateFromRequest( "$option.$client.filter_type", 'filter_type', 1, 'cmd' ); $search = $mainframe->getUserStateFromRequest( "$option.$client.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where = ''; if ($client == 'admin') { $where[] = 'p.client_id = 1'; $client_id = 1; } else { $where[] = 'p.client_id = 0'; $client_id = 0; } // used by filter if ( $filter_type != 1 ) { $where[] = 'p.folder = '.$db->Quote($filter_type); } if ( $search ) { $where[] = 'LOWER( p.name ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'p.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'p.published = 0'; } } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); if ($filter_order == 'p.ordering') { $orderby = ' ORDER BY p.folder, p.ordering '. $filter_order_Dir; } else { $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', p.ordering ASC'; } // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__plugins AS p' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pagination = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT p.*, u.name AS editor, g.name AS groupname' . ' FROM #__plugins AS p' . ' LEFT JOIN #__users AS u ON u.id = p.checked_out' . ' LEFT JOIN #__groups AS g ON g.id = p.access' . $where . ' GROUP BY p.id' . $orderby ; $db->setQuery( $query, $pagination->limitstart, $pagination->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // get list of Positions for dropdown filter $query = 'SELECT folder AS value, folder AS text' . ' FROM #__plugins' . ' WHERE client_id = '.(int) $client_id . ' GROUP BY folder' . ' ORDER BY folder' ; $types[] = JHTML::_('select.option', 1, '- '. JText::_( 'Select Type' ) .' -' ); $db->setQuery( $query ); $types = array_merge( $types, $db->loadObjectList() ); $lists['type'] = JHTML::_('select.genericlist', $types, 'filter_type', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $filter_type ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; $this->assign('client', $client); $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $rows); $this->assignRef('pagination', $pagination); parent::display($tpl); } }joomla/joomla/administrator/components/com_plugins/views/plugins/index.html0000766000000000000000000000005411234314076030707 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugin/0000777000000000000000000000000011266551131026527 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugin/tmpl/0000777000000000000000000000000011266551131027503 5ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugin/tmpl/form.php0000766000000000000000000001114411234314076031161 0ustar adminadministrators [' .JText::_('Edit'). ']', 'plugin.png' ); JToolBarHelper::save(); JToolBarHelper::apply(); JToolBarHelper::cancel( 'cancel', 'Close' ); JToolBarHelper::help( 'screen.plugins.edit' ); ?> plugin, ENT_QUOTES, '' ); ?> plugin->nameA = ''; if ( $this->plugin->id ) { $row->nameA = '[ '. $this->plugin->name .' ]'; } ?>
    : lists['published']; ?>
    plugin->folder; ?>
    .php
    lists['access']; ?>
    : lists['ordering']; ?>
    : plugin->description ); ?>
    true)); echo $pane->startPane('plugin-pane'); echo $pane->startPanel(JText :: _('Plugin Parameters'), 'param-page'); if($output = $this->params->render('params')) : echo $output; else : echo "
    ".JText::_('There are no parameters for this item')."
    "; endif; echo $pane->endPanel(); if ($this->params->getNumParams('advanced')) { echo $pane->startPanel(JText :: _('Advanced Parameters'), "advanced-page"); if($output = $this->params->render('params', 'advanced')) : echo $output; else : echo "
    ".JText::_('There are no advanced parameters for this item')."
    "; endif; echo $pane->endPanel(); } if ($this->params->getNumParams('legacy')) { echo $pane->startPanel(JText :: _('Legacy Parameters'), "legacy-page"); if($output = $this->params->render('params', 'legacy')) : echo $output; else : echo "
    ".JText::_('There are no legacy parameters for this item')."
    "; endif; echo $pane->endPanel(); } echo $pane->endPane(); ?>
    joomla/joomla/administrator/components/com_plugins/views/plugin/tmpl/index.html0000766000000000000000000000005411234314076031500 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/views/plugin/view.html.php0000766000000000000000000000700711234314076031162 0ustar adminadministratorsload( $cid[0] ); // fail if checked out not by 'me' if ($row->isCheckedOut( $user->get('id') )) { $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The plugin' ), $row->title ); $this->setRedirect( 'index.php?option='. $option .'&client='. $client, $msg, 'error' ); return false; } if ($client == 'admin') { $where = "client_id='1'"; } else { $where = "client_id='0'"; } // get list of groups if ($row->access == 99 || $row->client_id == 1) { $lists['access'] = 'Administrator'; } else { // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row ); } if ($cid[0]) { $row->checkout( $user->get('id') ); if ( $row->ordering > -10000 && $row->ordering < 10000 ) { // build the html select list for ordering $query = 'SELECT ordering AS value, name AS text' . ' FROM #__plugins' . ' WHERE folder = '.$db->Quote($row->folder) . ' AND published > 0' . ' AND '. $where . ' AND ordering > -10000' . ' AND ordering < 10000' . ' ORDER BY ordering' ; $order = JHTML::_('list.genericordering', $query ); $lists['ordering'] = JHTML::_('select.genericlist', $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) ); } else { $lists['ordering'] = ''. JText::_( 'This plugin cannot be reordered' ); } $lang =& JFactory::getLanguage(); $lang->load( 'plg_' . trim( $row->folder ) . '_' . trim( $row->element ), JPATH_ADMINISTRATOR ); $data = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . 'plugins'. DS .$row->folder . DS . $row->element .'.xml'); $row->description = $data['description']; } else { $row->folder = ''; $row->ordering = 999; $row->published = 1; $row->description = ''; } $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ); // get params definitions $params = new JParameter( $row->params, JApplicationHelper::getPath( 'plg_xml', $row->folder.DS.$row->element ), 'plugin' ); $this->assignRef('lists', $lists); $this->assignRef('plugin', $row); $this->assignRef('params', $params); parent::display($tpl); } }joomla/joomla/administrator/components/com_plugins/views/plugin/index.html0000766000000000000000000000005411234314076030524 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/controller.php0000766000000000000000000001633511234314076027001 0ustar adminadministratorsregisterTask( 'apply', 'save'); $this->registerTask( 'unpublish', 'publish'); $this->registerTask( 'edit' , 'display' ); $this->registerTask( 'add' , 'display' ); $this->registerTask( 'orderup' , 'order' ); $this->registerTask( 'orderdown' , 'order' ); $this->registerTask( 'accesspublic' , 'access' ); $this->registerTask( 'accessregistered' , 'access' ); $this->registerTask( 'accessspecial' , 'access' ); } function display( ) { switch($this->getTask()) { case 'add' : case 'edit' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view', 'plugin' ); } break; } parent::display(); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('plugin'); $task = $this->getTask(); $client = JRequest::getWord( 'filter_client', 'site' ); if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError() ); } if (!$row->check()) { JError::raiseError(500, $row->getError() ); } if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); if ($client == 'admin') { $where = "client_id=1"; } else { $where = "client_id=0"; } $row->reorder( 'folder = '.$db->Quote($row->folder).' AND ordering > -10000 AND ordering < 10000 AND ( '.$where.' )' ); switch ( $task ) { case 'apply': $msg = JText::sprintf( 'Successfully Saved changes to Plugin', $row->name ); $this->setRedirect( 'index.php?option=com_plugins&view=plugin&client='. $client .'&task=edit&cid[]='. $row->id, $msg ); break; case 'save': default: $msg = JText::sprintf( 'Successfully Saved Plugin', $row->name ); $this->setRedirect( 'index.php?option=com_plugins&client='. $client, $msg ); break; } } function publish( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); $publish = ( $this->getTask() == 'publish' ? 1 : 0 ); $client = JRequest::getWord( 'filter_client', 'site' ); if (count( $cid ) < 1) { $action = $publish ? JText::_( 'publish' ) : JText::_( 'unpublish' ); JError::raiseError(500, JText::_( 'Select a plugin to '.$action ) ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__plugins SET published = '.(int) $publish . ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ))' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('plugin'); $row->checkin( $cid[0] ); } $this->setRedirect( 'index.php?option=com_plugins&client='. $client ); } function cancel( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $client = JRequest::getWord( 'filter_client', 'site' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('plugin'); $row->bind(JRequest::get('post')); $row->checkin(); $this->setRedirect( JRoute::_( 'index.php?option=com_plugins&client='. $client, false ) ); } function order( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); $uid = $cid[0]; $inc = ( $this->getTask() == 'orderup' ? -1 : 1 ); $client = JRequest::getWord( 'filter_client', 'site' ); // Currently Unsupported if ($client == 'admin') { $where = "client_id = 1"; } else { $where = "client_id = 0"; } $row =& JTable::getInstance('plugin'); $row->load( $uid ); $row->move( $inc, 'folder='.$db->Quote($row->folder).' AND ordering > -10000 AND ordering < 10000 AND ('.$where.')' ); $this->setRedirect( 'index.php?option=com_plugins' ); } function access( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); $uid = $cid[0]; $access = $this->getTask(); $db =& JFactory::getDBO(); switch ( $access ) { case 'accesspublic': $access = 0; break; case 'accessregistered': $access = 1; break; case 'accessspecial': $access = 2; break; } $row =& JTable::getInstance('plugin'); $row->load( $uid ); $row->access = $access; if ( !$row->check() ) { return $row->getError(); } if ( !$row->store() ) { return $row->getError(); } $this->setRedirect( 'index.php?option=com_plugins' ); } function saveorder( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); $db =& JFactory::getDBO(); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order, array(0)); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); $row =& JTable::getInstance('plugin'); $conditions = array(); // update ordering values for ( $i=0; $i < $total; $i++ ) { $row->load( (int) $cid[$i] ); if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError(500, $db->getErrorMsg() ); } // remember to updateOrder this group $condition = 'folder = '.$db->Quote($row->folder).' AND ordering > -10000 AND ordering < 10000 AND client_id = ' . (int) $row->client_id; $found = false; foreach ( $conditions as $cond ) { if ($cond[1]==$condition) { $found = true; break; } } if (!$found) $conditions[] = array($row->id, $condition); } } // execute updateOrder for each group foreach ( $conditions as $cond ) { $row->load( $cond[0] ); $row->reorder( $cond[1] ); } $msg = JText::_( 'New ordering saved' ); $this->setRedirect( 'index.php?option=com_plugins', $msg ); } }joomla/joomla/administrator/components/com_plugins/index.html0000766000000000000000000000005411234314076026071 0ustar adminadministratorsjoomla/joomla/administrator/components/com_plugins/plugins.xml0000766000000000000000000000100511234314076026274 0ustar adminadministrators Plugin Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Plugin Manager joomla/joomla/administrator/components/com_plugins/plugins.php0000766000000000000000000000201711234314076026267 0ustar adminadministratorsauthorize( 'com_plugins', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JPATH_COMPONENT.DS.'controller.php' ); // Create the controller $controller = new PluginsController( ); $controller->execute( JRequest::getCmd( 'task' ) ); $controller->redirect();joomla/joomla/administrator/components/com_poll/0000777000000000000000000000000011266551127023366 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/elements/0000777000000000000000000000000011266551130025174 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/elements/index.html0000766000000000000000000000005411234314106027164 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/elements/poll.php0000766000000000000000000000243211234314106026650 0ustar adminadministratorssetQuery( $query ); $options = $db->loadObjectList(); array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Poll').' -', 'id', 'title')); return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'title', $value, $control_name.$name ); } } joomla/joomla/administrator/components/com_poll/views/0000777000000000000000000000000011266551127024523 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/polls/0000777000000000000000000000000011266551126025653 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/polls/tmpl/0000777000000000000000000000000011266551127026630 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/polls/tmpl/default.php0000766000000000000000000000762211234314106030762 0ustar adminadministrators
    : lists['state']; ?>
    items ); $i < $n; $i++) { $row = &$this->items[$i]; $link = JRoute::_( 'index.php?option=com_poll&view=poll&task=edit&cid[]='. $row->id ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> ">
    lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?>
    pagination->getListFooter(); ?>
    pagination->getRowOffset( $i ); ?> user->get ('id'), $row->checked_out ) ) { echo $row->title; } else { ?> title; ?> voters; ?> numoptions; ?> lag; ?> id; ?>
    joomla/joomla/administrator/components/com_poll/views/polls/tmpl/index.html0000766000000000000000000000005411234314106030612 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/polls/view.html.php0000766000000000000000000000626311234314106030277 0ustar adminadministratorsgetUserStateFromRequest( "$option.filter_order", 'filter_order', 'm.id', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( "$option.filter_state", 'filter_state', '', 'word' ); $search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where = array(); if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'm.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'm.published = 0'; } } if ($search) { $where[] = 'LOWER(m.title) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir; $query = 'SELECT COUNT(m.id)' . ' FROM #__polls AS m' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pagination = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT m.*, u.name AS editor, COUNT(d.id) AS numoptions' . ' FROM #__polls AS m' . ' LEFT JOIN #__users AS u ON u.id = m.checked_out' . ' LEFT JOIN #__poll_data AS d ON d.pollid = m.id AND d.text <> ""' . $where . ' GROUP BY m.id' . $orderby ; $db->setQuery( $query, $pagination->limitstart, $pagination->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $rows); $this->assignRef('pagination', $pagination); parent::display($tpl); } }joomla/joomla/administrator/components/com_poll/views/polls/index.html0000766000000000000000000000005411234314106027636 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/poll/0000777000000000000000000000000011266551127025471 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/poll/tmpl/0000777000000000000000000000000011266551127026445 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/poll/tmpl/default.php0000766000000000000000000000143511234314106030573 0ustar adminadministrators
    options as $option) { if ($option->text <> "") {?>
    poll->title; ?>
    text; ?>
      
    joomla/joomla/administrator/components/com_poll/views/poll/tmpl/form.php0000766000000000000000000001020211234314106030102 0ustar adminadministrators [ ' . $text.' ]' ); JToolBarHelper::Preview('index.php?option=com_poll&controller=poll&cid[]='.$cid[0]); JToolBarHelper::save(); JToolBarHelper::apply(); if ($edit) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.polls.edit' ); ?> poll, ENT_QUOTES ); ?>
    : poll->published ); ?>
    options ); $i < $n; $i++ ) { ?>
    joomla/joomla/administrator/components/com_poll/views/poll/tmpl/index.html0000766000000000000000000000005411234314106030427 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/poll/view.html.php0000766000000000000000000000365311234314106030114 0ustar adminadministratorsload( $uid ); // fail if checked out not by 'me' if ($poll->isCheckedOut( $user->get('id') )) { $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The poll' ), $poll->title ); $this->setRedirect( 'index.php?option='. $option, $msg ); } if ($poll->id == 0) { // defaults $row->published = 1; } $options = array(); if ($edit) { $poll->checkout( $user->get('id') ); $query = 'SELECT id, text' . ' FROM #__poll_data' . ' WHERE pollid = '.(int) $uid . ' ORDER BY id' ; $db->setQuery($query); $options = $db->loadObjectList(); } else { $poll->lag = 3600*24; } $this->assignRef('poll', $poll); $this->assignRef('options', $options); parent::display($tpl); } }joomla/joomla/administrator/components/com_poll/views/poll/index.html0000766000000000000000000000005411234314106027453 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/views/index.html0000766000000000000000000000005411234314106026505 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/controller.php0000766000000000000000000001234111234314106026251 0ustar adminadministratorsregisterTask( 'apply', 'save'); $this->registerTask( 'unpublish', 'publish'); $this->registerTask( 'preview', 'display'); $this->registerTask( 'edit', 'display'); $this->registerTask( 'add' , 'display' ); } function display( ) { switch($this->getTask()) { case 'add' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view', 'poll' ); JRequest::setVar( 'edit', false ); } break; case 'edit' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view', 'poll' ); JRequest::setVar( 'edit', true ); } break; case 'preview' : { JRequest::setVar( 'tmpl', 'component' ); JRequest::setVar( 'view', 'poll' ); } break; } //Set the default view, just in case $view = JRequest::getCmd('view'); if(empty($view)) { JRequest::setVar('view', 'polls'); }; parent::display(); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); // save the poll parent information $row =& JTable::getInstance('poll', 'Table'); $post = JRequest::get( 'post' ); if (!$row->bind( $post )) { JError::raiseError(500, $row->getError() ); } $isNew = ($row->id == 0); if (!$row->check()) { JError::raiseError(500, $row->getError() ); } if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); // save the poll options $options = JArrayHelper::getValue( $post, 'polloption', array(), 'array' ); foreach ($options as $i=>$text) { $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); if ($isNew) { $obj = new stdClass(); $obj->pollid = (int)$row->id; $obj->text = $text; $db->insertObject('#__poll_data', $obj); } else { $obj = new stdClass(); $obj->id = (int)$i; $obj->text = $text; $db->updateObject('#__poll_data', $obj, 'id'); } } switch ($this->_task) { case 'apply': $msg = JText::_( 'Changes to Poll saved' ); $link = 'index.php?option=com_poll&view=poll&task=edit&cid[]='. $row->id .''; break; case 'save': default: $msg = JText::_( 'Poll saved' ); $link = 'index.php?option=com_poll'; break; } $this->setRedirect($link); } function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), '', 'array' ); JArrayHelper::toInteger($cid); $msg = ''; for ($i=0, $n=count($cid); $i < $n; $i++) { $poll =& JTable::getInstance('poll', 'Table'); if (!$poll->delete( $cid[$i] )) { $msg .= $poll->getError(); } } $this->setRedirect( 'index.php?option=com_poll', $msg ); } /** * Publishes or Unpublishes one or more records * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing * @param string The current url option */ function publish() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(), '', 'array' ); $publish = ( $this->getTask() == 'publish' ? 1 : 0 ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { $action = $publish ? 'publish' : 'unpublish'; JError::raiseError(500, JText::_( 'Select an item to' .$action, true ) ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__polls' . ' SET published = ' . (int) $publish . ' WHERE id IN ( '. $cids .' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('poll', 'Table'); $row->checkin( $cid[0] ); } $mainframe->redirect( 'index.php?option=com_poll' ); } function cancel() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $id = JRequest::getVar( 'id', 0, '', 'int' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('poll', 'Table'); $row->checkin( $id ); $this->setRedirect( 'index.php?option=com_poll' ); } }joomla/joomla/administrator/components/com_poll/tables/0000777000000000000000000000000011266551127024640 5ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/tables/index.html0000766000000000000000000000005411234314106026622 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/tables/poll.php0000766000000000000000000000612011234314106026304 0ustar adminadministratorsid = (int) $this->id; return $result; } /** * Overloaded check function * * @access public * @return boolean * @see JTable::check * @since 1.5 */ function check() { // check for valid name if (trim( $this->title ) == '') { $this->setError(JText::_( 'Your Poll must contain a title.' )); return false; } // check for valid lag $this->lag = intval( $this->lag ); if ($this->lag == 0) { $this->setError(JText::_( 'Your Poll must have a non-zero lag time.' )); return false; } if(empty($this->alias)) { $this->alias = $this->title; } $this->alias = JFilterOutput::stringURLSafe($this->alias); if(trim(str_replace('-','',$this->alias)) == '') { $datenow =& JFactory::getDate(); $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S"); } return true; } // overloaded delete function function delete( $oid=null ) { $k = $this->_tbl_key; if ( $oid ) { $this->$k = intval( $oid ); } if ( parent::delete( $oid )) { $query = 'DELETE FROM #__poll_data' . ' WHERE pollid = '.(int) $this->$k ; $this->_db->setQuery( $query ); if ( !$this->_db->query() ) { $this->_error .= $this->_db->getErrorMsg() . "\n"; } $query = 'DELETE FROM #__poll_date' . ' WHERE poll_id = '.(int) $this->$k ; $this->_db->setQuery( $query ); if ( !$this->_db->query() ) { $this->_error .= $this->_db->getErrorMsg() . "\n"; } $query = 'DELETE from #__poll_menu' . ' WHERE pollid = '.(int) $this->$k ; $this->_db->setQuery( $query ); if ( !$this->_db->query() ) { $this->_error .= $this->_db->getErrorMsg() . "\n"; } return true; } return false; } } joomla/joomla/administrator/components/com_poll/poll.xml0000766000000000000000000000101711234314106025043 0ustar adminadministrators Polls Joomla! Project July 2004 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component manages polls joomla/joomla/administrator/components/com_poll/index.html0000766000000000000000000000005411234314106025350 0ustar adminadministratorsjoomla/joomla/administrator/components/com_poll/poll.php0000766000000000000000000000211711234314106025034 0ustar adminadministratorsauthorize( 'com_poll', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JPATH_COMPONENT.DS.'controller.php' ); // Set the table directory JTable::addIncludePath( JPATH_COMPONENT.DS.'tables' ); // Create the controller $controller = new PollController( ); $controller->execute( JRequest::getCmd( 'task' ) ); $controller->redirect();joomla/joomla/administrator/components/com_admin/0000777000000000000000000000000011266551210023501 5ustar adminadministratorsjoomla/joomla/administrator/components/com_admin/tmpl/0000777000000000000000000000000011266551211024456 5ustar adminadministratorsjoomla/joomla/administrator/components/com_admin/tmpl/sysinfo_phpinfo.php0000766000000000000000000000227511234314076030414 0ustar adminadministrators
     
     
    ]*>(.*)#siU', $phpinfo, $output); $output = preg_replace('##', '', $output); $output = str_replace('
    ', '', $output); $output = str_replace('
    ', '', $output); echo $output; ?>
    joomla/joomla/administrator/components/com_admin/tmpl/navigation.php0000766000000000000000000000143711234314076027335 0ustar adminadministrators
    joomla/joomla/administrator/components/com_admin/tmpl/sysinfo_directory.php0000766000000000000000000000456111234314076030755 0ustar adminadministrators
    get('image_path')); writableCell( 'language' ); // List all site languages $site_langs = JFolder::folders(JPATH_SITE.DS.'language'); foreach ($site_langs as $slang) { writableCell( 'language/'.$slang ); } writableCell( 'media' ); writableCell( 'modules' ); writableCell( 'plugins' ); writableCell( 'plugins/content' ); writableCell( 'plugins/editors' ); writableCell( 'plugins/editors-xtd' ); writableCell( 'plugins/search' ); writableCell( 'plugins/system' ); writableCell( 'plugins/user' ); writableCell( 'plugins/xmlrpc' ); writableCell( 'templates' ); writableCell( JPATH_SITE.DS.'cache', 0, ''. JText::_( 'Cache Directory' ) .' ' ); writableCell( JPATH_ADMINISTRATOR.DS.'cache', 0, ''. JText::_( 'Cache Directory' ) .' ' ); writableCell( $config->getValue('config.log_path', JPATH_ROOT.DS.'log'),0, ''. JText::_( 'Log Directory' ) . ' ($log_path) '); writableCell( $config->getValue('config.tmp_path', JPATH_ROOT.DS.'tmp'),0, ''. JText::_( 'Temp Directory' ) . ' ($tmp_path) '); ?>
     
    joomla/joomla/administrator/components/com_admin/tmpl/sysinfo_config.php0000766000000000000000000000370311234314076030213 0ustar adminadministrators
    $v) { if (eregi( 'var \$host', $v)) { $cf[$k] = 'var $host = \'xxxxxx\''; } else if (eregi( 'var \$user', $v)) { $cf[$k] = 'var $user = \'xxxxxx\''; } else if (eregi( 'var \$password', $v)) { $cf[$k] = 'var $password = \'xxxxxx\''; } else if (eregi( 'var \$db ', $v)) { $cf[$k] = 'var $db = \'xxxxxx\''; } else if (eregi( 'var \$ftp_user ', $v)) { $cf[$k] = 'var $ftp_user = \'xxxxxx\''; } else if (eregi( 'var \$ftp_pass ', $v)) { $cf[$k] = 'var $ftp_pass = \'xxxxxx\''; } else if (eregi( 'var \$smtpuser ', $v)) { $cf[$k] = 'var $smtpuser = \'xxxxxx\''; } else if (eregi( 'var \$smtppass ', $v)) { $cf[$k] = 'var $smtppass = \'xxxxxx\''; } else if (eregi( '', $v)) { $cf[$k] = ''; } else if (eregi( '}', $v)) { $cf[$k] = ''; } else if (eregi( 'class JConfig {', $v)) { $cf[$k] = ''; } $cf[$k] = str_replace('var ','',$cf[$k]); $cf[$k] = str_replace(';','',$cf[$k]); $cf[$k] = str_replace(' = ',''; if ($cf[$k] != '') { $config_output[] = $cf[$k]; } } echo implode( '', $config_output ); ?>
     
    ',$cf[$k]); $cf[$k] = ''. $cf[$k] .'
    joomla/joomla/administrator/components/com_admin/tmpl/sysinfo_system.php0000766000000000000000000000364511234314076030277 0ustar adminadministrators
     
    :
    : getVersion(); ?>
    : getCollation(); ?>
    :
    :
    :
    : getLongVersion(); ?>
    :
    joomla/joomla/administrator/components/com_admin/tmpl/sysinfo_phpsettings.php0000766000000000000000000000662111234314076031320 0ustar adminadministrators
    setQuery( $query, 0, 1 ); $editor = $db->loadResult(); ?>
     
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    joomla/joomla/administrator/components/com_admin/tmpl/index.html0000766000000000000000000000005411234314076026454 0ustar adminadministratorsjoomla/joomla/administrator/components/com_admin/toolbar.admin.php0000766000000000000000000000177011234314076026753 0ustar adminadministratorssetBuffer($contents, 'modules', 'submenu'); ?>
    * In case of the remote server it is assumed that this server provide one specific * help set of files in one particular language. */ function help() { global $mainframe; jimport( 'joomla.filesystem.folder' ); jimport( 'joomla.language.help' ); // Get Help URL - an empty helpurl is interpreted as local help files! $helpurl = $mainframe->getCfg('helpurl'); if ( $helpurl == 'http://help.mamboserver.com' ) { $helpurl = 'http://help.joomla.org'; } $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; $helpsearch = JRequest::getString('helpsearch'); $page = JRequest::getCmd('page', 'joomla.whatsnew15.html'); $toc = getHelpToc( $helpsearch ); $lang =& JFactory::getLanguage(); $langTag = $lang->getTag(); if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { $langTag = 'en-GB'; // use english as fallback } if (!eregi( '\.html$', $page )) { $page .= '.xml'; } ?>
    : 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?> 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?> | 'helpFrame')) ?>
      $v) { if ($helpurl) { echo '
    • '; echo JHTML::_('link', JHelp::createUrl( $k ), $v, array('target' => 'helpFrame')); echo '
    • '; } else { echo '
    • '; echo JHTML::_('link', JURI::base() .'help/'.$langTag.'/'.$k, $v, array('target' => 'helpFrame')); echo '
    • '; } } ?>
    			/','',$changelog);
    
    			// Convert all other HTML entities
    			echo htmlentities($changelog);
    			?>
    		
    '. JText::_( 'Writable' ) .''; $unwriteable = ''. JText::_( 'Unwritable' ) .''; echo ''; echo ''; echo $text; if ( $visible ) { echo $folder . '/'; } echo ''; echo ''; if ( $relative ) { echo is_writable( "../$folder" ) ? $writeable : $unwriteable; } else { echo is_writable( "$folder" ) ? $writeable : $unwriteable; } echo ''; echo ''; } /** * Compiles the help table of contents * @param string A specific keyword on which to filter the resulting list */ function getHelpTOC( $helpsearch ) { global $mainframe; $lang =& JFactory::getLanguage(); jimport( 'joomla.filesystem.folder' ); $helpurl = $mainframe->getCfg('helpurl'); // Check for files in the actual language $langTag = $lang->getTag(); if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { $langTag = 'en-GB'; // use english as fallback } $files = JFolder::files( JPATH_BASE.DS.'help'.DS.$langTag, '\.xml$|\.html$' ); $toc = array(); foreach ($files as $file) { $buffer = file_get_contents( JPATH_BASE.DS.'help'.DS.$langTag.DS.$file ); if (preg_match( '#(.*?)#', $buffer, $m )) { $title = trim( $m[1] ); if ($title) { if ($helpurl) { // strip the extension $file = preg_replace( '#\.xml$|\.html$#', '', $file ); } if ($helpsearch) { if (JString::strpos( strip_tags( $buffer ), $helpsearch ) !== false) { $toc[$file] = $title; } } else { $toc[$file] = $title; } } } } asort( $toc ); return $toc; } joomla/joomla/administrator/components/com_admin/toolbar.admin.html.php0000766000000000000000000000226311234314076027714 0ustar adminadministratorsjoomla/joomla/administrator/components/com_categories/0000777000000000000000000000000011266551205024542 5ustar adminadministratorsjoomla/joomla/administrator/components/com_categories/admin.categories.html.php0000766000000000000000000004102211234314106031422 0ustar adminadministrators
    :
    sect_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->section ); $link = 'index.php?option=com_categories§ion='. $section .'&task=edit&cid[]='. $row->id .'&type='.$type; $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->title; } else { ?> title; ?> orderUpIcon( $i, ($row->section == @$rows[$i-1]->section), 'orderup', 'Move Up', $ordering ); ?> orderDownIcon( $i, $n, ($row->section == @$rows[$i+1]->section), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> section_name; ?> active; ?> trash; ?> id; ?>
    image == '') { $row->image = 'blank.png'; } if ( $redirect == 'content' ) { $component = 'Content'; } else { $component = ucfirst( substr( $redirect, 4 ) ); if ( $redirect == 'com_contact_details' ) { $component = 'Contact'; } } JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'description' ); $cparams = JComponentHelper::getParams ('com_media'); ?>
    :
     
    display( 'description', htmlspecialchars($row->description, ENT_QUOTES), '550', '300', '60', '20', array('pagebreak', 'readmore') ) ; ?>

    .
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->title ."
  • "; } echo ""; ?>
    :
    "; foreach ( $contents as $content ) { echo "
  • ". $content->title ."
  • "; } echo ""; ?>


    .


    "; } ?>

    .
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->title ."
  • "; } echo ""; ?>
    :
    "; foreach ( $contents as $content ) { echo "
  • ". $content->title ."
  • "; echo "\n id\" />"; } echo ""; ?>



    .


    "; } ?>
    [ '. $text.' ]', 'categories.png' ); JToolBarHelper::save(); JToolBarHelper::apply(); if ($edit) { // for existing articles the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.' . substr( $section, 4 ) . '.categories.edit' ); } /** * Draws the menu for Moving existing categories * @param int The published state (to display the inverse button) */ function _MOVE() { JToolBarHelper::title( JText::_( 'Category' ) .': [ '. JText::_( 'Move' ).' ]', 'categories.png' ); JToolBarHelper::save( 'movesave' ); JToolBarHelper::cancel(); } /** * Draws the menu for Copying existing categories * @param int The published state (to display the inverse button) */ function _COPY() { JToolBarHelper::title( JText::_( 'Category' ) .': [ '. JText::_( 'Copy' ).' ]', 'categories.png' ); JToolBarHelper::save( 'copysave' ); JToolBarHelper::cancel(); } /** * Draws the menu for Editing an existing category */ function _DEFAULT() { $section = JRequest::getCmd( 'section' ); JToolBarHelper::title( JText::_( 'Category Manager' ) .': [ '. JText::_(JString::substr($section, 4)).' ]', 'categories.png' ); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); if ( $section == 'com_content' || ( $section > 0 ) ) { JToolBarHelper::customX( 'moveselect', 'move.png', 'move_f2.png', 'Move', true ); JToolBarHelper::customX( 'copyselect', 'copy.png', 'copy_f2.png', 'Copy', true ); } JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::help( 'screen.' . substr( $section, 4 ) . '.categories' ); } }joomla/joomla/administrator/components/com_categories/index.html0000766000000000000000000000005411234314106026527 0ustar adminadministratorsjoomla/joomla/administrator/components/com_categories/admin.categories.php0000766000000000000000000006531011234314106030465 0ustar adminadministratorsgetUserStateFromRequest( $option.'.filter_order', 'filter_order', 'c.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $option.'.'.$section.'.filter_state', 'filter_state', '', 'word' ); $sectionid = $mainframe->getUserStateFromRequest( $option.'.'.$section.'.sectionid', 'sectionid', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( $option.'.search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $section_name = ''; $content_add = ''; $content_join = ''; $order = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', c.ordering'; if (intval( $section ) > 0) { $table = 'content'; $query = 'SELECT title' . ' FROM #__sections' . ' WHERE id = '.(int) $section; $db->setQuery( $query ); $section_name = $db->loadResult(); $section_name = JText::sprintf( 'Content:', JText::_( $section_name ) ); $where = ' WHERE c.section = '.$db->Quote($section); $type = 'content'; } else if (strpos( $section, 'com_' ) === 0) { $table = substr( $section, 4 ); $query = 'SELECT name' . ' FROM #__components' . ' WHERE link = '.$db->Quote('option='.$section); ; $db->setQuery( $query ); $section_name = $db->loadResult(); $where = ' WHERE c.section = '.$db->Quote($section); $type = 'other'; // special handling for contact component if ( $section == 'com_contact_details' ) { $section_name = JText::_( 'Contact' ); } $section_name = JText::sprintf( 'Component:', $section_name ); } else { $table = $section; $where = ' WHERE c.section = '.$db->Quote($section); $type = 'other'; } // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__categories' ; if ($section == 'com_content') { if($sectionid > 0) { $query .= ' WHERE section = '.(int) $sectionid; } else { $query .= ' WHERE section > 0'; } } else { $query .= ' WHERE section = '.$db->quote($section); } if ( $filter_state ) { if ( $filter_state == 'P' ) { $query .= ' AND published = 1'; } else if ($filter_state == 'U' ) { $query .= ' AND published = 0'; } } $db->setQuery( $query ); $total = $db->loadResult(); // allows for viweing of all content categories if ( $section == 'com_content' ) { $table = 'content'; $content_add = ' , z.title AS section_name'; $content_join = ' LEFT JOIN #__sections AS z ON z.id = c.section'; $where = ' WHERE c.section NOT LIKE "%com_%"'; if ($filter_order == 'c.ordering'){ $order = ' ORDER BY z.title, c.ordering '. $filter_order_Dir; } else { $order = ' ORDER BY '.$filter_order.' '. $filter_order_Dir.', z.title, c.ordering'; } $section_name = JText::_( 'All Content:' ); $type = 'content'; } // used by filter if ( $sectionid > 0 ) { $filter = ' AND c.section = '.$db->Quote($sectionid); } else { $filter = ''; } if ( $filter_state ) { if ( $filter_state == 'P' ) { $filter .= ' AND c.published = 1'; } else if ($filter_state == 'U' ) { $filter .= ' AND c.published = 0'; } } if ($search) { $filter .= ' AND LOWER(c.title) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $tablesAllowed = $db->getTableList(); if (!in_array($db->getPrefix().$table, $tablesAllowed)) { $table = 'content'; } $query = 'SELECT c.*, c.checked_out as checked_out_contact_category, g.name AS groupname, u.name AS editor, COUNT( DISTINCT s2.checked_out ) AS checked_out_count' . $content_add . ' FROM #__categories AS c' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__'.$table.' AS s2 ON s2.catid = c.id AND s2.checked_out > 0' . $content_join . $where . $filter . ' AND c.published != -2' . ' GROUP BY c.id' . $order ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return; } $count = count( $rows ); // number of Active Items for ( $i = 0; $i < $count; $i++ ) { $query = 'SELECT COUNT( a.id )' . ' FROM #__content AS a' . ' WHERE a.catid = '. (int) $rows[$i]->id . ' AND a.state <> -2' ; $db->setQuery( $query ); $active = $db->loadResult(); $rows[$i]->active = $active; } // number of Trashed Items for ( $i = 0; $i < $count; $i++ ) { $query = 'SELECT COUNT( a.id )' . ' FROM #__content AS a' . ' WHERE a.catid = '. (int) $rows[$i]->id . ' AND a.state = -2' ; $db->setQuery( $query ); $trash = $db->loadResult(); $rows[$i]->trash = $trash; } // get list of sections for dropdown filter $javascript = 'onchange="document.adminForm.submit();"'; $lists['sectionid'] = JHTML::_('list.section', 'sectionid', $sectionid, $javascript, 'ordering', false ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; categories_html::show( $rows, $section, $section_name, $pageNav, $lists, $type ); } /** * Compiles information to add or edit a category * @param string The name of the category section * @param integer The unique id of the category to edit (0 if new) * @param string The name of the current user */ function editCategory($edit ) { global $mainframe; // Initialize variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $uid = $user->get('id'); $type = JRequest::getCmd( 'type' ); $redirect = JRequest::getCmd( 'section', 'com_content' ); $section = JRequest::getCmd( 'section', 'com_content' ); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); JArrayHelper::toInteger($cid, array(0)); // check for existance of any sections $query = 'SELECT COUNT( id )' . ' FROM #__sections' . ' WHERE scope = "content"' ; $db->setQuery( $query ); $sections = $db->loadResult(); if (!$sections && $type != 'other' && $section != 'com_weblinks' && $section != 'com_newsfeeds' && $section != 'com_contact_details' && $section != 'com_banner') { $mainframe->redirect( 'index.php?option=com_categories§ion='. $section, JText::_( 'WARNSECTION', true ) ); } $row =& JTable::getInstance('category'); // load the row from the db table if ($edit) $row->load( $cid[0] ); // fail if checked out not by 'me' if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out )) { $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The category' ), $row->title ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $row->section, $msg ); } if ( $edit ) { $row->checkout( $user->get('id')); } else { $row->published = 1; } // make order list $order = array(); $query = 'SELECT COUNT(*)' . ' FROM #__categories' . ' WHERE section = '.$db->Quote($row->section) ; $db->setQuery( $query ); $max = intval( $db->loadResult() ) + 1; for ($i=1; $i < $max; $i++) { $order[] = JHTML::_('select.option', $i ); } // build the html select list for sections if ( $section == 'com_content' ) { if (!$row->section && JRequest::getInt('sectionid')) { $row->section = JRequest::getInt('sectionid'); } $query = 'SELECT s.id AS value, s.title AS text' . ' FROM #__sections AS s' . ' ORDER BY s.ordering' ; $db->setQuery( $query ); $sections = $db->loadObjectList(); $lists['section'] = JHTML::_('select.genericlist', $sections, 'section', 'class="inputbox" size="1"', 'value', 'text', $row->section ); } else { if ( $type == 'other' ) { $section_name = JText::_( 'N/A' ); } else { $temp =& JTable::getInstance('section'); $temp->load( $row->section ); $section_name = $temp->name; } if(!$section_name) $section_name = JText::_( 'N/A' ); $row->section = $section; $lists['section'] = ''. $section_name; } // build the html select list for ordering $query = 'SELECT ordering AS value, title AS text' . ' FROM #__categories' . ' WHERE section = '.$db->Quote($row->section) . ' ORDER BY ordering' ; if ($edit) { $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query ); } else { $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query ); } // build the select list for the image positions $active = ( $row->image_position ? $row->image_position : 'left' ); $lists['image_position'] = JHTML::_('list.positions', 'image_position', $active, NULL, 0, 0 ); // Imagelist $lists['image'] = JHTML::_('list.images', 'image', $row->image ); // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row ); // build the html radio buttons for published $published = ($row->id) ? $row->published : 1; $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $published ); categories_html::edit( $row, $lists, $redirect ); } /** * Saves the catefory after an edit form submit * @param string The name of the category section */ function saveCategory() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $menu = JRequest::getCmd( 'menu', 'mainmenu', 'post' ); $menuid = JRequest::getVar( 'menuid', 0, 'post', 'int' ); $redirect = JRequest::getCmd( 'redirect', '', 'post' ); $oldtitle = JRequest::getString( 'oldtitle', '', 'post' ); $post = JRequest::get( 'post' ); // fix up special html fields $post['description'] = JRequest::getVar( 'description', '', 'post', 'string', JREQUEST_ALLOWRAW ); $row =& JTable::getInstance('category'); if (!$row->bind( $post )) { JError::raiseError(500, $row->getError() ); } if (!$row->check()) { JError::raiseError(500, $row->getError() ); } // if new item order last in appropriate group if (!$row->id) { $where = "section = " . $db->Quote($row->section); $row->ordering = $row->getNextOrder( $where ); } if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); if ($row->section > 0) { $query = 'UPDATE #__content' .' SET sectionid = '.$row->section .' WHERE catid = '.$row->id ; $db->setQuery( $query ); $db->query(); } if ( $oldtitle ) { if ($oldtitle != $row->title) { $query = 'UPDATE #__menu' . ' SET name = '.$db->Quote($row->title) . ' WHERE name = '.$db->Quote($oldtitle) . ' AND type = "content_category"' ; $db->setQuery( $query ); $db->query(); } } // Update Section Count if ($row->section != 'com_contact_details' && $row->section != 'com_newsfeeds' && $row->section != 'com_weblinks') { $query = 'UPDATE #__sections SET count=count+1' . ' WHERE id = '.$db->Quote($row->section) ; $db->setQuery( $query ); } if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } switch ( JRequest::getCmd('task') ) { case 'go2menu': $mainframe->redirect( 'index.php?option=com_menus&menutype='. $menu ); break; case 'go2menuitem': $mainframe->redirect( 'index.php?option=com_menus&menutype='. $menu .'&task=edit&id='. $menuid ); break; case 'apply': $msg = JText::_( 'Changes to Category saved' ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $redirect .'&task=edit&cid[]='. $row->id, $msg ); break; case 'save': default: $msg = JText::_( 'Category saved' ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $redirect, $msg ); break; } } /** * Deletes one or more categories from the categories table * @param string The name of the category section * @param array An array of unique category id numbers */ function removeCategories( $section, $cid ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select a category to delete', true )); } $cids = implode( ',', $cid ); if (intval( $section ) > 0) { $table = 'content'; } else if (strpos( $section, 'com_' ) === 0) { $table = substr( $section, 4 ); } else { $table = $section; } $tablesAllowed = $db->getTableList(); if (!in_array($db->getPrefix().$table, $tablesAllowed)) { $table = 'content'; } $query = 'SELECT c.id, c.name, c.title, COUNT( s.catid ) AS numcat' . ' FROM #__categories AS c' . ' LEFT JOIN #__'.$table.' AS s ON s.catid = c.id' . ' WHERE c.id IN ( '.$cids.' )' . ' GROUP BY c.id' ; $db->setQuery( $query ); if (!($rows = $db->loadObjectList())) { JError::raiseError( 500, $db->stderr() ); return false; } $err = array(); $cid = array(); foreach ($rows as $row) { if ($row->numcat == 0) { $cid[] = (int) $row->id; } else { $err[] = $row->title; } } if (count( $cid )) { $cids = implode( ',', $cid ); $query = 'DELETE FROM #__categories' . ' WHERE id IN ( '.$cids.' )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError( 500, $db->stderr() ); return false; } } if (count( $err )) { $cids = implode( ", ", $err ); $msg = JText::sprintf( 'WARNNOTREMOVEDRECORDS', $cids ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $section, $msg ); } $mainframe->redirect( 'index.php?option=com_categories§ion='. $section ); } /** * Publishes or Unpublishes one or more categories * @param string The name of the category section * @param integer A unique category id (passed from an edit form) * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing * @param string The name of the current user */ function publishCategories( $section, $cid=null, $publish=1 ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $uid = $user->get('id'); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { $action = $publish ? 'publish' : 'unpublish'; JError::raiseError(500, JText::_( 'Select a category to '.$action, true ) ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__categories' . ' SET published = ' . (int) $publish . ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $uid.' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('category'); $row->checkin( $cid[0] ); } $mainframe->redirect( 'index.php?option=com_categories§ion='. $section ); } /** * Cancels an edit operation * @param string The name of the category section * @param integer A unique category id */ function cancelCategory() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $redirect = JRequest::getCmd( 'redirect', '', 'post' ); $row =& JTable::getInstance('category'); $row->bind( JRequest::get( 'post' )); $row->checkin(); $mainframe->redirect( 'index.php?option=com_categories§ion='. $redirect ); } /** * Moves the order of a record * @param integer The increment to reorder by */ function orderCategory( $uid, $inc ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('category' ); $row->load( $uid ); $row->move( $inc, 'section = '.$db->Quote($row->section) ); $section = JRequest::getCmd('section'); if($section) { $section = '§ion='. $section; } $mainframe->redirect( 'index.php?option=com_categories'. $section ); } /** * Form for moving item(s) to a specific menu */ function moveCategorySelect( $option, $cid, $sectionOld ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $redirect = JRequest::getCmd( 'section', 'com_content', 'post' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to move', true )); } ## query to list selected categories $cids = implode( ',', $cid ); $query = 'SELECT a.title, a.section' . ' FROM #__categories AS a' . ' WHERE a.id IN ( '.$cids.' )' ; $db->setQuery( $query ); $items = $db->loadObjectList(); ## query to list items from categories $query = 'SELECT a.title' . ' FROM #__content AS a' . ' WHERE a.catid IN ( '.$cids.' )' . ' ORDER BY a.catid, a.title' ; $db->setQuery( $query ); $contents = $db->loadObjectList(); ## query to choose section to move to $query = 'SELECT a.title AS text, a.id AS value' . ' FROM #__sections AS a' . ' WHERE a.published = 1' . ' ORDER BY a.title' ; $db->setQuery( $query ); $sections = $db->loadObjectList(); // build the html select list $SectionList = JHTML::_('select.genericlist', $sections, 'sectionmove', 'class="inputbox" size="10"', 'value', 'text', null ); categories_html::moveCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect ); } /** * Save the item(s) to the menu selected */ function moveCategorySave( $cid, $sectionOld ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $sectionMove = JRequest::getCmd( 'sectionmove' ); //Check to see of a section was selected to copy the items too if (!$sectionMove) { $msg = JText::_('Please select a section from the list'); moveCategorySelect( 'com_categories', $cid, $sectionOld ); JError::raiseWarning(500, $msg); return; } JArrayHelper::toInteger($cid, array(0)); $sectionNew =& JTable::getInstance('section'); $sectionNew->load( $sectionMove ); //Remove the categories was in destination section $cids = implode( ',', $cid ); $query = 'SELECT id, title' . ' FROM #__categories' . ' WHERE id IN ( '.$cids.' )' . ' AND section = '.$db->Quote($sectionMove) ; $db->setQuery( $query ); $scid = $db->loadResultArray(0); $title = $db->loadResultArray(1); $cid = array_diff($cid, $scid); // if ( !empty($cid) ) { $cids = implode( ',', $cid ); $total = count( $cid ); $query = 'UPDATE #__categories' . ' SET section = '.$db->Quote($sectionMove) . ' WHERE id IN ( '.$cids.' )' ; $db->setQuery( $query ); if ( !$db->query() ) { JError::raiseError(500, $db->getErrorMsg() ); } $query = 'UPDATE #__content' . ' SET sectionid = '.$db->Quote($sectionMove) . ' WHERE catid IN ( '.$cids.' )' ; $db->setQuery( $query ); if ( !$db->query() ) { JError::raiseError(500, $db->getErrorMsg()); } $msg = JText::sprintf( 'Categories moved to', $sectionNew->title ); $mainframe->enqueueMessage($msg); } if ( !empty($title) && is_array($title) ) { if ( count($title) == 1 ) { $msg = JText::sprintf( 'Category already in', implode( ', ', $title ), $sectionNew->title ); } else { $msg = JText::sprintf( 'Categories already in', implode( ', ', $title ), $sectionNew->title ); } $mainframe->enqueueMessage($msg); } $mainframe->redirect( 'index.php?option=com_categories§ion='. $sectionOld ); } /** * Form for copying item(s) to a specific menu */ function copyCategorySelect( $option, $cid, $sectionOld ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $redirect = JRequest::getCmd( 'section', 'com_content', 'post' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to move', true )); } ## query to list selected categories $cids = implode( ',', $cid ); $query = 'SELECT a.title, a.section' . ' FROM #__categories AS a' . ' WHERE a.id IN ( '.$cids.' )' ; $db->setQuery( $query ); $items = $db->loadObjectList(); ## query to list items from categories $query = 'SELECT a.title, a.id' . ' FROM #__content AS a' . ' WHERE a.catid IN ( '.$cids.' )' . ' ORDER BY a.catid, a.title' ; $db->setQuery( $query ); $contents = $db->loadObjectList(); ## query to choose section to move to $query = 'SELECT a.title AS `text`, a.id AS `value`' . ' FROM #__sections AS a' . ' WHERE a.published = 1' . ' ORDER BY a.name' ; $db->setQuery( $query ); $sections = $db->loadObjectList(); // build the html select list $SectionList = JHTML::_('select.genericlist', $sections, 'sectionmove', 'class="inputbox" size="10"', 'value', 'text', null ); categories_html::copyCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect ); } /** * Save the item(s) to the menu selected */ function copyCategorySave( $cid, $sectionOld ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $sectionMove = JRequest::getInt( 'sectionmove' ); //Check to see of a section was selected to copy the items too if (!$sectionMove) { $msg = JText::_('Please select a section from the list'); copyCategorySelect( 'com_categories', $cid, $sectionOld ); JError::raiseWarning(500, $msg); return; } $contentid = JRequest::getVar( 'item', null, '', 'array' ); JArrayHelper::toInteger($contentid); $category =& JTable::getInstance('category'); foreach( $cid as $id ) { $category->load( $id ); $category->id = NULL; $category->title = JText::sprintf( 'Copy of', $category->title ); $category->name = JText::sprintf( 'Copy of', $category->name ); $category->section = $sectionMove; if (!$category->check()) { JError::raiseError(500, $category->getError()); } if (!$category->store()) { JError::raiseError(500, $category->getError()); } $category->checkin(); // stores original catid $newcatids[]["old"] = $id; // pulls new catid $newcatids[]["new"] = $category->id; } $content =& JTable::getInstance('content'); foreach( $contentid as $id) { $content->load( $id ); $content->id = NULL; $content->sectionid = $sectionMove; $content->hits = 0; foreach( $newcatids as $newcatid ) { if ( $content->catid == $newcatid["old"] ) { $content->catid = $newcatid["new"]; } } if (!$content->check()) { JError::raiseError(500, $content->getError()); } if (!$content->store()) { JError::raiseError(500, $content->getError()); } $content->checkin(); } $sectionNew =& JTable::getInstance('section'); $sectionNew->load( $sectionMove ); $msg = JText::sprintf( 'Categories copied to', count($cid), $sectionNew->title ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $sectionOld, $msg ); } /** * changes the access level of a record * @param integer The increment to reorder by */ function accessMenu( $uid, $access, $section ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('category'); $row->load( $uid ); $row->access = $access; if ( !$row->check() ) { return $row->getError(); } if ( !$row->store() ) { return $row->getError(); } $mainframe->redirect( 'index.php?option=com_categories§ion='. $section ); } function saveOrder( &$cid, $section ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order, array(0)); $row =& JTable::getInstance('category'); $groupings = array(); // update ordering values for( $i=0; $i < $total; $i++ ) { $row->load( (int) $cid[$i] ); // track sections $groupings[] = $row->section; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError(500, $db->getErrorMsg()); } } } // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('section = '.$db->Quote($group)); } $msg = JText::_( 'New ordering saved' ); $mainframe->redirect( 'index.php?option=com_categories§ion='. $section, $msg ); }joomla/joomla/administrator/components/com_categories/toolbar.categories.php0000766000000000000000000000207511234314106031036 0ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/elements/bannerclient.php0000766000000000000000000000276311234314110031032 0ustar adminadministratorssetQuery($query); $options = $db->loadObjectList(); array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Client').' -', 'cid', 'name')); return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'cid', 'name', $value, $control_name.$name ); } } joomla/joomla/administrator/components/com_banners/banners.xml0000766000000000000000000000106011234314110026200 0ustar adminadministrators Banners Joomla! Project April 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component manages banners and banner clients joomla/joomla/administrator/components/com_banners/helpers/0000777000000000000000000000000011266551207025511 5ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/helpers/banner.php0000766000000000000000000000330311234314110027450 0ustar adminadministratorsget( 'tag_prefix' ); $instance = array(); if (!is_array( $keywords )) { $keywords = explode( ',', $keywords ); } foreach ($keywords as $keyword) { $keyword = trim( $keyword ); $regex = '#^' . $prefix . '#'; if (preg_match( $regex, $keyword )) { $instance[] = $keyword; } } } return $instance; } /** * Checks if a URL is an image * * @param string * @return URL */ function isImage( $url ) { $result = preg_match( '#(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$#i', $url ); return $result; } /** * Checks if a URL is a Flash file * * @param string * @return URL */ function isFlash( $url ) { $result = preg_match( '#\.swf$#i', $url ); return $result; } } ?>joomla/joomla/administrator/components/com_banners/helpers/index.html0000766000000000000000000000005411234314110027467 0ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/admin.banners.php0000766000000000000000000000431111234314110027260 0ustar adminadministratorsauthorize( 'com_banners', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Set the table directory JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_banners'.DS.'tables'); $controllerName = JRequest::getCmd( 'c', 'banner' ); if($controllerName == 'client') { JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners'); JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client', true ); JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories§ion=com_banner'); } else { JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners', true ); JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client'); JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories§ion=com_banner'); } switch ($controllerName) { default: $controllerName = 'banner'; // allow fall through case 'banner' : case 'client': // Temporary interceptor $task = JRequest::getCmd('task'); if ($task == 'listclients') { $controllerName = 'client'; } require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' ); $controllerName = 'BannerController'.$controllerName; // Create the controller $controller = new $controllerName(); // Perform the Request task $controller->execute( JRequest::getCmd('task') ); // Redirect if set by the controller $controller->redirect(); break; }joomla/joomla/administrator/components/com_banners/controllers/0000777000000000000000000000000011266551210026407 5ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/controllers/banner.php0000766000000000000000000002767011234314110030371 0ustar adminadministratorsregisterTask( 'add', 'edit' ); $this->registerTask( 'apply', 'save' ); $this->registerTask( 'resethits', 'save' ); $this->registerTask( 'unpublish', 'publish' ); } /** * Display the list of banners */ function display() { global $mainframe; $db =& JFactory::getDBO(); $context = 'com_banners.banner.list.'; $filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 'cc.title', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_catid = $mainframe->getUserStateFromRequest( $context.'filter_catid', 'filter_catid', '', 'int' ); $filter_state = $mainframe->getUserStateFromRequest( $context.'filter_state', 'filter_state', '', 'word' ); $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); $where = array(); if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'b.showBanner = 1'; } else if ($filter_state == 'U' ) { $where[] = 'b.showBanner = 0'; } } if ($filter_catid) { $where[] = 'cc.id = ' . (int) $filter_catid; } if ($search) { $where[] = 'LOWER(b.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : ''; $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', b.ordering'; // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__banner AS b' . ' LEFT JOIN #__categories AS cc ON cc.id = b.catid' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT b.*, c.name AS client_name, cc.title AS category_name, u.name AS editor' . ' FROM #__banner AS b' . ' INNER JOIN #__bannerclient AS c ON c.cid = b.cid' . ' LEFT JOIN #__categories AS cc ON cc.id = b.catid' . ' LEFT JOIN #__users AS u ON u.id = b.checked_out' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); // build list of categories $javascript = 'onchange="document.adminForm.submit();"'; $lists['catid'] = JHTML::_('list.category', 'filter_catid', 'com_banner', (int) $filter_catid, $javascript ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; require_once(JPATH_COMPONENT.DS.'views'.DS.'banner.php'); BannersViewBanner::banners( $rows, $pageNav, $lists ); } function edit() { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); if ($this->_task == 'edit') { $cid = JRequest::getVar('cid', array(0), 'method', 'array'); $cid = array((int) $cid[0]); } else { $cid = array( 0 ); } $option = JRequest::getCmd('option'); $lists = array(); $row =& JTable::getInstance('banner', 'Table'); $row->load( $cid[0] ); if ($cid[0]) { $row->checkout( $user->get('id') ); } else { $row->showBanner = 1; } // Build Client select list $sql = 'SELECT cid, name' . ' FROM #__bannerclient' ; $db->setQuery($sql); if (!$db->query()) { $this->setRedirect( 'index.php?option=com_banners' ); return JError::raiseWarning( 500, $db->getErrorMsg() ); } $banner_params = new JParameter( $row->params ); $lists['width'] = $banner_params->get( 'width'); $lists['height'] = $banner_params->get( 'height'); $clientlist[] = JHTML::_('select.option', '0', JText::_( 'Select Client' ), 'cid', 'name' ); $clientlist = array_merge( $clientlist, $db->loadObjectList() ); $lists['cid'] = JHTML::_('select.genericlist', $clientlist, 'cid', 'class="inputbox" size="1"','cid', 'name', $row->cid ); // Imagelist $javascript = 'onchange="changeDisplayImage();"'; $directory = '/images/banners'; $lists['imageurl'] = JHTML::_('list.images', 'imageurl', $row->imageurl, $javascript, $directory, "bmp|gif|jpg|png|swf" ); // build list of categories $lists['catid'] = JHTML::_('list.category', 'catid', 'com_banner', intval( $row->catid ) ); // sticky $lists['sticky'] = JHTML::_('select.booleanlist', 'sticky', 'class="inputbox"', $row->sticky ); // published $lists['showBanner'] = JHTML::_('select.booleanlist', 'showBanner', '', $row->showBanner ); require_once(JPATH_COMPONENT.DS.'views'.DS.'banner.php'); BannersViewBanner::banner( $row, $lists ); } /** * Save method */ function save() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); // Initialize variables $db =& JFactory::getDBO(); $post = JRequest::get( 'post' ); // fix up special html fields $post['custombannercode'] = JRequest::getVar( 'custombannercode', '', 'post', 'string', JREQUEST_ALLOWRAW ); $row =& JTable::getInstance('banner', 'Table'); // Save params temp fix $temp1 = array(); $temp2 = array(); $temp1['width'] = (int) $post['width']; $temp1['height'] = (int) $post['height']; foreach ($temp1 as $k => $v) { if ( $k && strlen($v) ) { $temp2[] = $k.'='.$v; } } $row->params = implode( "\n", $temp2 ); if (!$row->bind( $post )) { return JError::raiseWarning( 500, $row->getError() ); } // Resets clicks when `Reset Clicks` button is used instead of `Save` button $task = JRequest::getCmd( 'task' ); if ( $task == 'resethits' ) { $row->clicks = 0; $msg = JText::_( 'Reset Banner clicks' ); } // Sets impressions to unlimited when `unlimited` checkbox ticked $unlimited = JRequest::getBool('unlimited'); if ($unlimited) { $row->imptotal = 0; } if (!$row->check()) { return JError::raiseWarning( 500, $row->getError() ); } // if new item order last in appropriate group if (!$row->bid) { $where = 'catid = '.(int) $row->catid; $row->ordering = $row->getNextOrder( $where ); } if (!$row->store()) { return JError::raiseWarning( 500, $row->getError() ); } $row->checkin(); switch ($task) { case 'apply': $link = 'index.php?option=com_banners&task=edit&cid[]='. $row->bid ; break; case 'save': default: $link = 'index.php?option=com_banners'; break; } $this->setRedirect( $link, JText::_( 'Item Saved' ) ); } function cancel() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); // Initialize variables $db =& JFactory::getDBO(); $post = JRequest::get( 'post' ); $row =& JTable::getInstance('banner', 'Table'); $row->bind( $post ); $row->checkin(); } /** * Copies one or more banners */ function copy() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); $cid = JRequest::getVar( 'cid', null, 'post', 'array' ); $db =& JFactory::getDBO(); $table =& JTable::getInstance('banner', 'Table'); $user = &JFactory::getUser(); $n = count( $cid ); if ($n > 0) { foreach ($cid as $id) { if ($table->load( (int)$id )) { $table->bid = 0; $table->name = 'Copy of ' . $table->name; $table->impmade = 0; $table->clicks = 0; $table->showBanner = 0; $table->date = $db->getNullDate(); if (!$table->store()) { return JError::raiseWarning( $table->getError() ); } } else { return JError::raiseWarning( 500, $table->getError() ); } } } else { return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); } $this->setMessage( JText::sprintf( 'Items copied', $n ) ); } function publish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); // Initialize variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $task = JRequest::getCmd( 'task' ); $publish = ($task == 'publish'); $n = count( $cid ); if (empty( $cid )) { return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); } JArrayHelper::toInteger( $cid ); $cids = implode( ',', $cid ); $query = 'UPDATE #__banner' . ' SET showBanner = ' . (int) $publish . ' WHERE bid IN ( '. $cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = ' .(int) $user->get('id'). ' ) )' ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } $this->setMessage( JText::sprintf( $publish ? 'Items published' : 'Items unpublished', $n ) ); } function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); // Initialize variables $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $n = count( $cid ); JArrayHelper::toInteger( $cid ); if ($n) { $query = 'DELETE FROM #__banner' . ' WHERE bid = ' . implode( ' OR bid = ', $cid ) ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseWarning( 500, $db->getError() ); } } $this->setMessage( JText::sprintf( 'Items removed', $n ) ); } /** * Save the new order given by user */ function saveOrder() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners' ); // Initialize variables $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $order = JRequest::getVar( 'order', array(), 'post', 'array' ); $row =& JTable::getInstance('banner', 'Table'); $total = count( $cid ); $conditions = array(); if (empty( $cid )) { return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); } // update ordering values for ($i = 0; $i < $total; $i++) { $row->load( (int) $cid[$i] ); if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { return JError::raiseError( 500, $db->getErrorMsg() ); } // remember to reorder this category $condition = 'catid = '.(int) $row->catid; $found = false; foreach ($conditions as $cond) { if ($cond[1] == $condition) { $found = true; break; } } if (!$found) { $conditions[] = array ( $row->bid, $condition ); } } } // execute reorder for each category foreach ($conditions as $cond) { $row->load( $cond[0] ); $row->reorder( $cond[1] ); } // Clear the component's cache $cache =& JFactory::getCache('com_banners'); $cache->clean(); $this->setMessage( JText::_('New ordering saved') ); } } joomla/joomla/administrator/components/com_banners/controllers/index.html0000766000000000000000000000005411234314110030373 0ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/controllers/client.php0000766000000000000000000001360511234314110030373 0ustar adminadministratorsregisterTask( 'add', 'edit' ); $this->registerTask( 'apply', 'save' ); } function display() { global $mainframe; $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $context = 'com_banners.bannerclient.list.'; $filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 'a.name', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); $where = array(); if ($search) { $where[] = 'LOWER(a.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', a.cid'; // get the total number of records $query = 'SELECT a.*, count(b.bid) AS nbanners, u.name AS editor' . ' FROM #__bannerclient AS a' . ' LEFT JOIN #__banner AS b ON a.cid = b.cid' . ' LEFT JOIN #__users AS u ON u.id = a.checked_out' . $where . ' GROUP BY a.cid' . $orderby ; $db->setQuery( $query ); $db->query(); $total = $db->getNumRows(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; require_once(JPATH_COMPONENT.DS.'views'.DS.'client.php'); BannersViewClients::clients( $rows, $pageNav, $lists ); } /** * Edit a banner client record */ function edit() { // Initialize variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $userId = $user->get ( 'id' ); if ($this->_task == 'edit') { $cid = JRequest::getVar('cid', array(0), 'method', 'array'); } else { $cid = array( 0 ); } $row =& JTable::getInstance('bannerclient', 'Table'); $row->load( (int) $cid[0] ); // fail if checked out not by 'me' if ($row->isCheckedOut( $userId )) { $this->setRedirect( 'index.php?option=com_banners&c=client' ); return JError::raiseWarning( JText::sprintf( 'WARNEDITEDBYPERSON', $row->name ) ); } if ($row->cid) { // do stuff for existing record $row->checkout( $userId ); } else { // do stuff for new record $row->published = 0; $row->approved = 0; } require_once(JPATH_COMPONENT.DS.'views'.DS.'client.php'); BannersViewClients::client( $row ); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners&c=client' ); // Initialize variables $db =& JFactory::getDBO(); $table =& JTable::getInstance('bannerclient', 'Table'); if (!$table->bind( JRequest::get( 'post' ) )) { return JError::raiseWarning( 500, $table->getError() ); } if (!$table->check()) { return JError::raiseWarning( 500, $table->getError() ); } if (!$table->store()) { return JError::raiseWarning( 500, $table->getError() ); } $table->checkin(); switch (JRequest::getCmd( 'task' )) { case 'apply': $this->setRedirect( 'index.php?option=com_banners&c=client&task=edit&cid[]='. $table->cid ); break; } $this->setMessage( JText::_( 'Item Saved' ) ); } function cancel() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners&c=client' ); // Initialize variables $db =& JFactory::getDBO(); $table =& JTable::getInstance('bannerclient', 'Table'); $table->cid = JRequest::getVar( 'cid', 0, 'post', 'int' ); $table->checkin(); } function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $this->setRedirect( 'index.php?option=com_banners&c=client' ); // Initialize variables $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $table =& JTable::getInstance('bannerclient', 'Table'); $n = count( $cid ); for ($i = 0; $i < $n; $i++) { $query = 'SELECT COUNT( bid )' . ' FROM #__banner' . ' WHERE cid = '. (int) $cid[$i] ; $db->setQuery($query); $count = $db->loadResult(); if ($count === null) { return JError::raiseWarning( 500, $db->getErrorMsg() ); } else if ($count > 0) { return JError::raiseWarning( 500, JText::_( 'WARNCANNOTDELCLIENTBANNER' ) ); } else { if (!$table->delete( (int) $cid[$i] )) { return JError::raiseWarning( 500, $table->getError() ); } } } $this->setMessage( JText::sprintf( 'Items removed', $n ) ); } }joomla/joomla/administrator/components/com_banners/views/0000777000000000000000000000000011266551207025204 5ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/views/banner.php0000766000000000000000000003611311234314110027150 0ustar adminadministrators
    :
    id = $row->bid; $link = JRoute::_( 'index.php?option=com_banners&task=edit&cid[]='. $row->id ); if( $row->imptotal <= 0 ) { $row->imptotal = JText::_('unlimited'); } if ( $row->impmade != 0 ) { $percentClicks = 100 * $row->clicks/$row->impmade; } else { $percentClicks = 0; } $row->published = $row->showBanner; $published = JHTML::_('grid.published', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); ?> ">
    getListFooter(); ?>
    getRowOffset($i); ?> get ('id'), $row->checked_out ) ) { echo $row->name; } else { ?> name; ?> client_name;?> category_name;?> class="text_area" style="text-align: center" /> sticky ? JText::_( 'Yes' ) : JText::_( 'No' );?> impmade.' '.JText::_('of').' '.$row->imptotal?> clicks;?> - tags; ?> id; ?>
    [ '. JText::_( 'New' ) .' ]' : JText::_( 'Banner' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'generic.png' ); JToolBarHelper::save( 'save' ); JToolBarHelper::apply('apply'); JToolBarHelper::cancel( 'cancel' ); JToolBarHelper::help( 'screen.banners.edit' ); } function banner( &$row, &$lists ) { BannersViewBanner::setBannerToolbar(); JRequest::setVar( 'hidemainmenu', 1 ); JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'custombannercode' ); ?>
    imptotal == 0) { $unlimited = 'checked="checked"'; $row->imptotal = ''; } ?>
    :
    :
         />
    : clicks;?>     
    : imageurl)) { ?> imageurl)) { ?>
    joomla/joomla/administrator/components/com_banners/views/client.php0000766000000000000000000001727411234314110027170 0ustar adminadministrators
    :
    id = $row->cid; $link = JRoute::_( 'index.php?option=com_banners&c=client&task=edit&cid[]='. $row->id ); $checked = JHTML::_('grid.checkedout', $row, $i ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->name; } else { ?> name; ?> contact; ?> nbanners;?> cid; ?>
    [ '. JText::_( 'New' ) .' ]' : JText::_( 'Banner Client' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'generic.png' ); JToolBarHelper::save( 'save' ); JToolBarHelper::apply('apply'); JToolBarHelper::cancel( 'cancel' ); JToolBarHelper::help( 'screen.banners.client.edit' ); } function client( &$row ) { BannersViewClients::setClientToolbar(); JRequest::setVar( 'hidemainmenu', 1 ); JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'extrainfo' ); ?>
    set( 'date', $now->toMySQL() ); } function clicks() { $query = 'UPDATE #__banner' . ' SET clicks = ( clicks + 1 )' . ' WHERE bid = ' . (int) $this->bid ; $this->_db->setQuery( $query ); $this->_db->query(); } /** * Overloaded check function * * @access public * @return boolean * @see JTable::check * @since 1.5 */ function check() { // check for valid client id if (is_null($this->cid) || $this->cid == 0) { $this->setError(JText::_( 'BNR_CLIENT' )); return false; } // check for valid name if(trim($this->name) == '') { $this->setError(JText::_( 'BNR_NAME' )); return false; } if(empty($this->alias)) { $this->alias = $this->name; } $this->alias = JFilterOutput::stringURLSafe($this->alias); /*if(trim($this->imageurl) == '') { $this->setError(JText::_( 'BNR_IMAGE' )); return false; } if(trim($this->clickurl) == '' && trim($this->custombannercode) == '') { $this->setError(JText::_( 'BNR_URL' )); return false; }*/ return true; } } ?> joomla/joomla/administrator/components/com_banners/tables/index.html0000766000000000000000000000005411234314110027277 0ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/tables/bannerclient.php0000766000000000000000000000316611234314110030466 0ustar adminadministratorsname == '')) { $this->setError(JText::_( 'BNR_CLIENT_NAME' )); return false; } // check for valid client contact if (trim($this->contact == '')) { $this->setError(JText::_( 'BNR_CONTACT' )); return false; } // check for valid client email jimport( 'joomla.mail.helper' ); if (!JMailHelper::isEmailAddress( $this->email )) { $this->setError(JText::_( 'BNR_VALID_EMAIL' )); return false; } return true; } } joomla/joomla/administrator/components/com_banners/index.html0000766000000000000000000000005411234314110026025 0ustar adminadministratorsjoomla/joomla/administrator/components/com_banners/config.xml0000766000000000000000000000114311234314110026017 0ustar adminadministrators joomla/joomla/administrator/components/com_content/0000777000000000000000000000000011266551175024075 5ustar adminadministratorsjoomla/joomla/administrator/components/com_content/toolbar.content.html.php0000766000000000000000000000516611234314104030655 0ustar adminadministrators[ '. $text.' ]', 'addedit.png' ); JToolBarHelper::preview( 'index.php?option=com_content&id='.$cid.'&tmpl=component', true ); JToolBarHelper::save(); JToolBarHelper::apply(); if ( $edit ) { // for existing articles the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.content.edit' ); } /* function _ARCHIVE() { JToolBarHelper::title( JText::_( 'Archive Manager' ), 'addedit.png' ); JToolBarHelper::unarchiveList(); JToolBarHelper::custom( 'remove', 'delete.png', 'delete_f2.png', 'Trash', false ); JToolBarHelper::help( 'screen.content.archive' ); } */ function _MOVE() { JToolBarHelper::title( JText::_( 'Move Articles' ), 'move_f2.png' ); JToolBarHelper::custom( 'movesectsave', 'save.png', 'save_f2.png', 'Save', false ); JToolBarHelper::cancel(); } function _COPY() { JToolBarHelper::title( JText::_( 'Copy Articles' ), 'copy_f2.png' ); JToolBarHelper::custom( 'copysave', 'save.png', 'save_f2.png', 'Save', false ); JToolBarHelper::cancel(); } function _DEFAULT() { global $filter_state; JToolBarHelper::title( JText::_( 'Article Manager' ), 'article.png' ); if ($filter_state == 'A' || $filter_state == NULL) { JToolBarHelper::unarchiveList(); } if ($filter_state != 'A') { JToolBarHelper::archiveList(); } JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::customX( 'movesect', 'move.png', 'move_f2.png', 'Move' ); JToolBarHelper::customX( 'copy', 'copy.png', 'copy_f2.png', 'Copy' ); JToolBarHelper::trash(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::preferences('com_content', '550'); JToolBarHelper::help( 'screen.content' ); } }joomla/joomla/administrator/components/com_content/content.xml0000766000000000000000000000101311234314104026245 0ustar adminadministrators Content Page Joomla! Project April 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 DESCCONTENT joomla/joomla/administrator/components/com_content/elements/0000777000000000000000000000000011266551176025712 5ustar adminadministratorsjoomla/joomla/administrator/components/com_content/elements/article.php0000766000000000000000000000432611234314104030033 0ustar adminadministratorsgetTemplate(); $fieldName = $control_name.'['.$name.']'; $article =& JTable::getInstance('content'); if ($value) { $article->load($value); } else { $article->title = JText::_('Select an Article'); } $js = " function jSelectArticle(id, title, object) { document.getElementById(object + '_id').value = id; document.getElementById(object + '_name').value = title; document.getElementById('sbox-window').close(); }"; $doc->addScriptDeclaration($js); $link = 'index.php?option=com_content&task=element&tmpl=component&object='.$name; JHTML::_('behavior.modal', 'a.modal'); $html = "\n".'
    '; // $html .= "\n   "; $html .= ''."\n"; $html .= "\n".''; return $html; } } joomla/joomla/administrator/components/com_content/elements/index.html0000766000000000000000000000005411234314104027666 0ustar adminadministratorsjoomla/joomla/administrator/components/com_content/elements/author.php0000766000000000000000000000200411234314104027701 0ustar adminadministrators
    <?php echo JText::_( 'Pending' ); ?> | <?php echo JText::_( 'Visible' ); ?> | <?php echo JText::_( 'Finished' ); ?> | <?php echo JText::_( 'Finished' ); ?> | <?php echo JText::_( 'Archived' ); ?>
    joomla/joomla/administrator/components/com_content/helper.php0000766000000000000000000000715011234314104026051 0ustar adminadministrators', '
    ', $text ); // Search for the {readmore} tag and split the text up accordingly. $pattern = '##i'; $tagPos = preg_match($pattern, $text); if ( $tagPos == 0 ) { $row->introtext = $text; } else { list($row->introtext, $row->fulltext) = preg_split($pattern, $text, 2); } // Filter settings jimport( 'joomla.application.component.helper' ); $config = JComponentHelper::getParams( 'com_content' ); $user = &JFactory::getUser(); $gid = $user->get( 'gid' ); $filterGroups = $config->get( 'filter_groups' ); // convert to array if one group selected if ( (!is_array($filterGroups) && (int) $filterGroups > 0) ) { $filterGroups = array($filterGroups); } if (is_array($filterGroups) && in_array( $gid, $filterGroups )) { $filterType = $config->get( 'filter_type' ); $filterTags = preg_split( '#[,\s]+#', trim( $config->get( 'filter_tags' ) ) ); $filterAttrs = preg_split( '#[,\s]+#', trim( $config->get( 'filter_attritbutes' ) ) ); switch ($filterType) { case 'NH': $filter = new JFilterInput(); break; case 'WL': $filter = new JFilterInput( $filterTags, $filterAttrs, 0, 0, 0); // turn off xss auto clean break; case 'BL': default: $filter = new JFilterInput( $filterTags, $filterAttrs, 1, 1 ); break; } $row->introtext = $filter->clean( $row->introtext ); $row->fulltext = $filter->clean( $row->fulltext ); } elseif(empty($filterGroups) && $gid != '25') { // no default filtering for super admin (gid=25) $filter = new JFilterInput( array(), array(), 1, 1 ); $row->introtext = $filter->clean( $row->introtext ); $row->fulltext = $filter->clean( $row->fulltext ); } return true; } /** * Function to reset Hit count of an article * */ function resetHits($redirect, $id) { global $mainframe; // Initialize variables $db = & JFactory::getDBO(); // Instantiate and load an article table $row = & JTable::getInstance('content'); $row->Load($id); $row->hits = 0; $row->store(); $row->checkin(); $msg = JText::_('Successfully Reset Hit count'); $mainframe->redirect('index.php?option=com_content§ionid='.$redirect.'&task=edit&id='.$id, $msg); } function filterCategory($query, $active = NULL) { // Initialize variables $db = & JFactory::getDBO(); $categories[] = JHTML::_('select.option', '0', '- '.JText::_('Select Category').' -'); $db->setQuery($query); $categories = array_merge($categories, $db->loadObjectList()); $category = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $active); return $category; } } joomla/joomla/administrator/components/com_content/views/0000777000000000000000000000000011266551175025232 5ustar adminadministratorsjoomla/joomla/administrator/components/com_content/views/element/0000777000000000000000000000000011266551175026663 5ustar adminadministratorsjoomla/joomla/administrator/components/com_content/views/element/view.php0000766000000000000000000001560211234314104030333 0ustar adminadministratorsgetNullDate(); $document = & JFactory::getDocument(); $document->setTitle(JText::_('Article Selection')); JHTML::_('behavior.modal'); $template = $mainframe->getTemplate(); $document->addStyleSheet("templates/$template/css/general.css"); $limitstart = JRequest::getVar('limitstart', '0', '', 'int'); $lists = $this->_getLists(); //Ordering allowed ? $ordering = ($lists['order'] == 'section_name' && $lists['order_Dir'] == 'ASC'); $rows = &$this->get('List'); $page = &$this->get('Pagination'); JHTML::_('behavior.tooltip'); ?>
    :
    created, JText::_('DATE_FORMAT_LC4') ); $access = JHTML::_('grid.access', $row, $i, $row->state ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> title); ?>', '');"> title, ENT_QUOTES, 'UTF-8'); ?> groupname;?> id; ?> section_name; ?> cctitle; ?>
    getUserStateFromRequest('articleelement.filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest('articleelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $mainframe->getUserStateFromRequest('articleelement.filter_state', 'filter_state', '', 'word'); $catid = $mainframe->getUserStateFromRequest('articleelement.catid', 'catid', 0, 'int'); $filter_authorid = $mainframe->getUserStateFromRequest('articleelement.filter_authorid', 'filter_authorid', 0, 'int'); $filter_sectionid = $mainframe->getUserStateFromRequest('articleelement.filter_sectionid', 'filter_sectionid', -1, 'int'); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest('articleelement.limitstart', 'limitstart', 0, 'int'); $search = $mainframe->getUserStateFromRequest('articleelement.search', 'search', '', 'string'); $search = JString::strtolower($search); // get list of categories for dropdown filter $filter = ($filter_sectionid >= 0) ? ' WHERE cc.section = '.$db->Quote($filter_sectionid) : ''; // get list of categories for dropdown filter $query = 'SELECT cc.id AS value, cc.title AS text, section' . ' FROM #__categories AS cc' . ' INNER JOIN #__sections AS s ON s.id = cc.section' . $filter . ' ORDER BY s.ordering, cc.ordering'; $lists['catid'] = ContentHelper::filterCategory($query, $catid); // get list of sections for dropdown filter $javascript = 'onchange="document.adminForm.submit();"'; $lists['sectionid'] = JHTML::_('list.section', 'filter_sectionid', $filter_sectionid, $javascript); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; return $lists; } } joomla/joomla/administrator/components/com_content/views/element/index.html0000766000000000000000000000005411234314104030640 0ustar adminadministratorsjoomla/joomla/administrator/components/com_content/views/index.html0000766000000000000000000000005411234314104027207 0ustar adminadministratorsjoomla/joomla/administrator/components/com_content/controller.php0000766000000000000000000012736511234314102026766 0ustar adminadministratorsgetModel( 'element' ); $view = &$this->getView( 'element'); $view->setModel( $model, true ); $view->display(); } /** * Compiles a list of installed or defined modules * @param database A database connector object */ function viewContent() { global $mainframe; // Initialize variables $db =& JFactory::getDBO(); $filter = null; // Get some variables from the request $sectionid = JRequest::getVar( 'sectionid', -1, '', 'int' ); $redirect = $sectionid; $option = JRequest::getCmd( 'option' ); $context = 'com_content.viewcontent'; $filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', '', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $context.'filter_state', 'filter_state', '', 'word' ); $catid = $mainframe->getUserStateFromRequest( $context.'catid', 'catid', 0, 'int' ); $filter_authorid = $mainframe->getUserStateFromRequest( $context.'filter_authorid', 'filter_authorid', 0, 'int' ); $filter_sectionid = $mainframe->getUserStateFromRequest( $context.'filter_sectionid', 'filter_sectionid', -1, 'int' ); $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); $search = JString::strtolower($search); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($context.'limitstart', 'limitstart', 0, 'int'); // In case limit has been changed, adjust limitstart accordingly $limitstart = ( $limit != 0 ? (floor($limitstart / $limit) * $limit) : 0 ); //$where[] = "c.state >= 0"; $where[] = 'c.state != -2'; if (!$filter_order) { $filter_order = 'section_name'; } if ($filter_order == 'c.ordering') { $order = ' ORDER BY section_name, cc.title, c.ordering '. $filter_order_Dir; } else { $order = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', section_name, cc.title, c.ordering'; } $all = 1; if ($filter_sectionid >= 0) { $filter = ' WHERE cc.section = '. (int) $filter_sectionid; } $section->title = 'All Articles'; $section->id = 0; /* * Add the filter specific information to the where clause */ // Section filter if ($filter_sectionid >= 0) { $where[] = 'c.sectionid = ' . (int) $filter_sectionid; } // Category filter if ($catid > 0) { $where[] = 'c.catid = ' . (int) $catid; } // Author filter if ($filter_authorid > 0) { $where[] = 'c.created_by = ' . (int) $filter_authorid; } // Content state filter if ($filter_state) { if ($filter_state == 'P') { $where[] = 'c.state = 1'; } else { if ($filter_state == 'U') { $where[] = 'c.state = 0'; } else if ($filter_state == 'A') { $where[] = 'c.state = -1'; } else { $where[] = 'c.state != -2'; } } } // Keyword filter if ($search) { $where[] = '(LOWER( c.title ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ) . ' OR c.id = ' . (int) $search . ')'; } // Build the where clause of the content record query $where = (count($where) ? ' WHERE '.implode(' AND ', $where) : ''); // Get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . $where; $db->setQuery($query); $total = $db->loadResult(); // Create the pagination object jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); // Get the articles $query = 'SELECT c.*, g.name AS groupname, cc.title AS name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . ' LEFT JOIN #__users AS v ON v.id = c.created_by' . ' LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id' . $where . $order; $db->setQuery($query, $pagination->limitstart, $pagination->limit); $rows = $db->loadObjectList(); // If there is a database query error, throw a HTTP 500 and exit if ($db->getErrorNum()) { JError::raiseError( 500, $db->stderr() ); return false; } // get list of categories for dropdown filter $query = 'SELECT cc.id AS value, cc.title AS text, section' . ' FROM #__categories AS cc' . ' INNER JOIN #__sections AS s ON s.id = cc.section ' . $filter . ' ORDER BY s.ordering, cc.ordering'; $lists['catid'] = ContentHelper::filterCategory($query, $catid); // get list of sections for dropdown filter $javascript = 'onchange="document.adminForm.submit();"'; $lists['sectionid'] = JHTML::_('list.section', 'filter_sectionid', $filter_sectionid, $javascript); // get list of Authors for dropdown filter $query = 'SELECT c.created_by, u.name' . ' FROM #__content AS c' . ' INNER JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__users AS u ON u.id = c.created_by' . ' WHERE c.state <> -1' . ' AND c.state <> -2' . ' GROUP BY u.name' . ' ORDER BY u.name'; $authors[] = JHTML::_('select.option', '0', '- '.JText::_('Select Author').' -', 'created_by', 'name'); $db->setQuery($query); $authors = array_merge($authors, $db->loadObjectList()); $lists['authorid'] = JHTML::_('select.genericlist', $authors, 'filter_authorid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'created_by', 'name', $filter_authorid); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state, 'Published', 'Unpublished', 'Archived'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; ContentView::showContent($rows, $lists, $pagination, $redirect); } /** * Shows a list of archived articles * @param int The section id */ function viewArchive() { global $mainframe; // Initialize variables $db =& JFactory::getDBO(); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); $option = JRequest::getCmd( 'option' ); $filter_order = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.filter_order", 'filter_order', 'sectname', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.filter_order_Dir", 'filter_order_Dir', '', 'word'); $catid = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.catid", 'catid', 0, 'int'); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.limitstart", 'limitstart', 0, 'int'); $filter_authorid = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.filter_authorid", 'filter_authorid', 0, 'int'); $filter_sectionid = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.filter_sectionid", 'filter_sectionid', 0, 'int'); $search = $mainframe->getUserStateFromRequest("$option.$sectionid.viewarchive.search", 'search', '', 'string'); $search = JString::strtolower($search); $redirect = $sectionid; // A section id of zero means view all articles [all sections] if ($sectionid == 0) { $where = array ('c.state = -1', 'c.catid = cc.id', 'cc.section = s.id', 's.scope = "content"'); $filter = ' , #__sections AS s WHERE s.id = c.section'; $all = 1; } else { //We are viewing a specific section $where = array ('c.state = -1', 'c.catid = cc.id', 'cc.section = s.id', 's.scope = "content"', 'c.sectionid= '.(int) $sectionid); $filter = ' WHERE section = '.$db->Quote($sectionid); $all = NULL; } // Section filter if ($filter_sectionid > 0) { $where[] = 'c.sectionid = ' . (int) $filter_sectionid; } // Author filter if ($filter_authorid > 0) { $where[] = 'c.created_by = ' . (int) $filter_authorid; } // Category filter if ($catid > 0) { $where[] = 'c.catid = ' . (int) $catid; } // Keyword filter if ($search) { $where[] = 'LOWER( c.title ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } // TODO: Sanitise $filter_order $filter_order_Dir = ($filter_order_Dir == 'ASC' ? 'ASC' : 'DESC'); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', sectname, cc.name, c.ordering'; $where = (count($where) ? ' WHERE '.implode(' AND ', $where) : ''); // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . $where; $db->setQuery($query); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $query = 'SELECT c.*, g.name AS groupname, cc.name, v.name AS author, s.title AS sectname' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS v ON v.id = c.created_by' . $where . $orderby; $db->setQuery($query, $pagination->limitstart, $pagination->limit); $rows = $db->loadObjectList(); // If there is a database query error, throw a HTTP 500 and exit if ($db->getErrorNum()) { JError::raiseError( 500, $db->stderr() ); return false; } // get list of categories for dropdown filter $query = 'SELECT c.id AS value, c.title AS text' . ' FROM #__categories AS c' . $filter . ' ORDER BY c.ordering'; $lists['catid'] = ContentHelper::filterCategory($query, $catid); // get list of sections for dropdown filter $javascript = 'onchange="document.adminForm.submit();"'; $lists['sectionid'] = JAdminMenus::SelectSection('filter_sectionid', $filter_sectionid, $javascript); $section = & JTable::getInstance('section'); $section->load($sectionid); // get list of Authors for dropdown filter $query = 'SELECT c.created_by, u.name' . ' FROM #__content AS c' . ' INNER JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__users AS u ON u.id = c.created_by' . ' WHERE c.state = -1' . ' GROUP BY u.name' . ' ORDER BY u.name'; $db->setQuery($query); $authors[] = JHTML::_('select.option', '0', '- '.JText::_('Select Author').' -', 'created_by', 'name'); $authors = array_merge($authors, $db->loadObjectList()); $lists['authorid'] = JHTML::_('select.genericlist', $authors, 'filter_authorid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'created_by', 'name', $filter_authorid); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; ContentView::showArchive($rows, $section, $lists, $pagination, $option, $all, $redirect); } /** * Compiles information to add or edit the record * * @param database A database connector object * @param integer The unique id of the record to edit (0 if new) * @param integer The id of the content section */ function editContent($edit) { global $mainframe; // Initialize variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); JArrayHelper::toInteger($cid, array(0)); $id = JRequest::getVar( 'id', $cid[0], '', 'int' ); $option = JRequest::getCmd( 'option' ); $nullDate = $db->getNullDate(); $contentSection = ''; $sectionid = 0; // Create and load the content table row $row = & JTable::getInstance('content'); if($edit) $row->load($id); if ($id) { $sectionid = $row->sectionid; if ($row->state < 0) { $mainframe->redirect('index.php?option=com_content', JText::_('You cannot edit an archived item')); } } // A sectionid of zero means grab from all sections if ($sectionid == 0) { $where = ' WHERE section NOT LIKE "%com_%"'; } else { // Grab from the specific section $where = ' WHERE section = '. $db->Quote( $sectionid ); } /* * If the item is checked out we cannot edit it... unless it was checked * out by the current user. */ if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out )) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The item'), $row->title); $mainframe->redirect('index.php?option=com_content', $msg); } if ($id) { $row->checkout($user->get('id')); if (trim($row->images)) { $row->images = explode("\n", $row->images); } else { $row->images = array (); } $query = 'SELECT name' . ' FROM #__users'. ' WHERE id = '. (int) $row->created_by; $db->setQuery($query); $row->creator = $db->loadResult(); // test to reduce unneeded query if ($row->created_by == $row->modified_by) { $row->modifier = $row->creator; } else { $query = 'SELECT name' . ' FROM #__users' . ' WHERE id = '. (int) $row->modified_by; $db->setQuery($query); $row->modifier = $db->loadResult(); } $query = 'SELECT COUNT(content_id)' . ' FROM #__content_frontpage' . ' WHERE content_id = '. (int) $row->id; $db->setQuery($query); $row->frontpage = $db->loadResult(); if (!$row->frontpage) { $row->frontpage = 0; } } else { if (!$sectionid && JRequest::getInt('filter_sectionid')) { $sectionid =JRequest::getInt('filter_sectionid'); } if (JRequest::getInt('catid')) { $row->catid = JRequest::getInt('catid'); $category = & JTable::getInstance('category'); $category->load($row->catid); $sectionid = $category->section; } else { $row->catid = NULL; } $createdate =& JFactory::getDate(); $row->sectionid = $sectionid; $row->version = 0; $row->state = 1; $row->ordering = 0; $row->images = array (); $row->publish_up = $createdate->toUnix(); $row->publish_down = JText::_('Never'); $row->creator = ''; $row->created = $createdate->toUnix(); $row->modified = $nullDate; $row->modifier = ''; $row->frontpage = 0; } $javascript = "onchange=\"changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);\""; $query = 'SELECT s.id, s.title' . ' FROM #__sections AS s' . ' ORDER BY s.ordering'; $db->setQuery($query); $sections[] = JHTML::_('select.option', '-1', '- '.JText::_('Select Section').' -', 'id', 'title'); $sections[] = JHTML::_('select.option', '0', JText::_('Uncategorized'), 'id', 'title'); $sections = array_merge($sections, $db->loadObjectList()); $lists['sectionid'] = JHTML::_('select.genericlist', $sections, 'sectionid', 'class="inputbox" size="1" '.$javascript, 'id', 'title', intval($row->sectionid)); foreach ($sections as $section) { $section_list[] = (int) $section->id; // get the type name - which is a special category if ($row->sectionid) { if ($section->id == $row->sectionid) { $contentSection = $section->title; } } else { if ($section->id == $sectionid) { $contentSection = $section->title; } } } $sectioncategories = array (); $sectioncategories[-1] = array (); $sectioncategories[-1][] = JHTML::_('select.option', '-1', JText::_( 'Select Category' ), 'id', 'title'); $section_list = implode('\', \'', $section_list); $query = 'SELECT id, title, section' . ' FROM #__categories' . ' WHERE section IN ( \''.$section_list.'\' )' . ' ORDER BY ordering'; $db->setQuery($query); $cat_list = $db->loadObjectList(); // Uncategorized category mapped to uncategorized section $uncat = new stdClass(); $uncat->id = 0; $uncat->title = JText::_('Uncategorized'); $uncat->section = 0; $cat_list[] = $uncat; foreach ($sections as $section) { $sectioncategories[$section->id] = array (); $rows2 = array (); foreach ($cat_list as $cat) { if ($cat->section == $section->id) { $rows2[] = $cat; } } foreach ($rows2 as $row2) { $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->title, 'id', 'title'); } } $sectioncategories['-1'][] = JHTML::_('select.option', '-1', JText::_( 'Select Category' ), 'id', 'title'); $categories = array(); foreach ($cat_list as $cat) { if($cat->section == $row->sectionid) $categories[] = $cat; } $categories[] = JHTML::_('select.option', '-1', JText::_( 'Select Category' ), 'id', 'title'); $lists['catid'] = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1"', 'id', 'title', intval($row->catid)); // build the html select list for ordering $query = 'SELECT ordering AS value, title AS text' . ' FROM #__content' . ' WHERE catid = ' . (int) $row->catid . ' AND state >= 0' . ' ORDER BY ordering'; if($edit) $lists['ordering'] = JHTML::_('list.specificordering', $row, $id, $query, 1); else $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query, 1); // build the html radio buttons for frontpage $lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage); // build the html radio buttons for published $lists['state'] = JHTML::_('select.booleanlist', 'state', '', $row->state); /* * We need to unify the introtext and fulltext fields and have the * fields separated by the {readmore} tag, so lets do that now. */ if (JString::strlen($row->fulltext) > 1) { $row->text = $row->introtext . "
    " . $row->fulltext; } else { $row->text = $row->introtext; } // Create the form $form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'article.xml'); // Details Group $active = (intval($row->created_by) ? intval($row->created_by) : $user->get('id')); $form->set('created_by', $active); $form->set('access', $row->access); $form->set('created_by_alias', $row->created_by_alias); $form->set('created', JHTML::_('date', $row->created, '%Y-%m-%d %H:%M:%S')); $form->set('publish_up', JHTML::_('date', $row->publish_up, '%Y-%m-%d %H:%M:%S')); if (JHTML::_('date', $row->publish_down, '%Y') <= 1969 || $row->publish_down == $db->getNullDate()) { $form->set('publish_down', JText::_('Never')); } else { $form->set('publish_down', JHTML::_('date', $row->publish_down, '%Y-%m-%d %H:%M:%S')); } // Advanced Group $form->loadINI($row->attribs); // Metadata Group $form->set('description', $row->metadesc); $form->set('keywords', $row->metakey); $form->loadINI($row->metadata); ContentView::editContent($row, $contentSection, $lists, $sectioncategories, $option, $form); } /** * Saves the article an edit form submit * @param database A database connector object */ function saveContent() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $dispatcher = & JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $details = JRequest::getVar( 'details', array(), 'post', 'array'); $option = JRequest::getCmd( 'option' ); $task = JRequest::getCmd( 'task' ); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); $redirect = JRequest::getVar( 'redirect', $sectionid, 'post', 'int' ); $menu = JRequest::getVar( 'menu', 'mainmenu', 'post', 'cmd' ); $menuid = JRequest::getVar( 'menuid', 0, 'post', 'int' ); $nullDate = $db->getNullDate(); $row = & JTable::getInstance('content'); if (!$row->bind(JRequest::get('post'))) { JError::raiseError( 500, $db->stderr() ); return false; } $row->bind($details); // sanitise id field $row->id = (int) $row->id; $isNew = true; // Are we saving from an item edit? if ($row->id) { $isNew = false; $datenow =& JFactory::getDate(); $row->modified = $datenow->toMySQL(); $row->modified_by = $user->get('id'); } $row->created_by = $row->created_by ? $row->created_by : $user->get('id'); if ($row->created && strlen(trim( $row->created )) <= 10) { $row->created .= ' 00:00:00'; } $config =& JFactory::getConfig(); $tzoffset = $config->getValue('config.offset'); $date =& JFactory::getDate($row->created, $tzoffset); $row->created = $date->toMySQL(); // Append time if not added to publish date if (strlen(trim($row->publish_up)) <= 10) { $row->publish_up .= ' 00:00:00'; } $date =& JFactory::getDate($row->publish_up, $tzoffset); $row->publish_up = $date->toMySQL(); // Handle never unpublish date if (trim($row->publish_down) == JText::_('Never') || trim( $row->publish_down ) == '') { $row->publish_down = $nullDate; } else { if (strlen(trim( $row->publish_down )) <= 10) { $row->publish_down .= ' 00:00:00'; } $date =& JFactory::getDate($row->publish_down, $tzoffset); $row->publish_down = $date->toMySQL(); } // Get a state and parameter variables from the request $row->state = JRequest::getVar( 'state', 0, '', 'int' ); $params = JRequest::getVar( 'params', null, 'post', 'array' ); // Build parameter INI string if (is_array($params)) { $txt = array (); foreach ($params as $k => $v) { $txt[] = "$k=$v"; } $row->attribs = implode("\n", $txt); } // Get metadata string $metadata = JRequest::getVar( 'meta', null, 'post', 'array'); if (is_array($metadata)) { $txt = array(); foreach ($metadata as $k => $v) { if ($k == 'description') { $row->metadesc = $v; } elseif ($k == 'keywords') { $row->metakey = $v; } else { $txt[] = "$k=$v"; } } $row->metadata = implode("\n", $txt); } // Prepare the content for saving to the database ContentHelper::saveContentPrep( $row ); // Make sure the data is valid if (!$row->check()) { JError::raiseError( 500, $db->stderr() ); return false; } // Increment the content version number $row->version++; $result = $dispatcher->trigger('onBeforeContentSave', array(&$row, $isNew)); if(in_array(false, $result, true)) { JError::raiseError(500, $row->getError()); return false; } // Store the content to the database if (!$row->store()) { JError::raiseError( 500, $db->stderr() ); return false; } // Check the article and update item order $row->checkin(); $row->reorder('catid = '.(int) $row->catid.' AND state >= 0'); /* * We need to update frontpage status for the article. * * First we include the frontpage table and instantiate an instance of it. */ require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_frontpage'.DS.'tables'.DS.'frontpage.php'); $fp = new TableFrontPage($db); // Is the article viewable on the frontpage? if (JRequest::getVar( 'frontpage', 0, '', 'int' )) { // Is the item already viewable on the frontpage? if (!$fp->load($row->id)) { // Insert the new entry $query = 'INSERT INTO #__content_frontpage' . ' VALUES ( '. (int) $row->id .', 1 )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->stderr() ); return false; } $fp->ordering = 1; } } else { // Delete the item from frontpage if it exists if (!$fp->delete($row->id)) { $msg .= $fp->stderr(); } $fp->ordering = 0; } $fp->reorder(); $cache = & JFactory::getCache('com_content'); $cache->clean(); $dispatcher->trigger('onAfterContentSave', array(&$row, $isNew)); switch ($task) { case 'go2menu' : $mainframe->redirect('index.php?option=com_menus&menutype='.$menu); break; case 'go2menuitem' : $mainframe->redirect('index.php?option=com_menus&menutype='.$menu.'&task=edit&id='.$menuid); break; case 'menulink' : ContentHelper::menuLink($redirect, $row->id); break; case 'resethits' : ContentHelper::resetHits($redirect, $row->id); break; case 'apply' : $msg = JText::sprintf('SUCCESSFULLY SAVED CHANGES TO ARTICLE', $row->title); $mainframe->redirect('index.php?option=com_content§ionid='.$redirect.'&task=edit&cid[]='.$row->id, $msg); break; case 'save' : default : $msg = JText::sprintf('Successfully Saved Article', $row->title); $mainframe->redirect('index.php?option=com_content§ionid='.$redirect, $msg); break; } } /** * Changes the state of one or more content pages * * @param string The name of the category section * @param integer A unique category id (passed from an edit form) * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing * @param string The name of the current user */ function changeContent( $state = 0 ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $option = JRequest::getCmd( 'option' ); $task = JRequest::getCmd( 'task' ); $rtask = JRequest::getCmd( 'returntask', '', 'post' ); if ($rtask) { $rtask = '&task='.$rtask; } if (count($cid) < 1) { $redirect = JRequest::getVar( 'redirect', '', 'post', 'int' ); $action = ($state == 1) ? 'publish' : ($state == -1 ? 'archive' : 'unpublish'); $msg = JText::_('Select an item to') . ' ' . JText::_($action); $mainframe->redirect('index.php?option='.$option.$rtask.'§ionid='.$redirect, $msg, 'error'); } // Get some variables for the query $uid = $user->get('id'); $total = count($cid); $cids = implode(',', $cid); $query = 'UPDATE #__content' . ' SET state = '. (int) $state . ' WHERE id IN ( '. $cids .' ) AND ( checked_out = 0 OR (checked_out = '. (int) $uid .' ) )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->getErrorMsg() ); return false; } if (count($cid) == 1) { $row = & JTable::getInstance('content'); $row->checkin($cid[0]); } switch ($state) { case -1 : $msg = JText::sprintf('Item(s) successfully Archived', $total); break; case 1 : $msg = JText::sprintf('Item(s) successfully Published', $total); break; case 0 : default : if ($task == 'unarchive') { $msg = JText::sprintf('Item(s) successfully Unarchived', $total); } else { $msg = JText::sprintf('Item(s) successfully Unpublished', $total); } break; } $cache = & JFactory::getCache('com_content'); $cache->clean(); // Get some return/redirect information from the request $redirect = JRequest::getVar( 'redirect', $row->sectionid, 'post', 'int' ); $mainframe->redirect('index.php?option='.$option.$rtask.'§ionid='.$redirect, $msg); } /** * Changes the frontpage state of one or more articles * */ function toggleFrontPage() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $option = JRequest::getCmd( 'option' ); $msg = null; JArrayHelper::toInteger($cid); if (count($cid) < 1) { $msg = JText::_('Select an item to toggle'); $mainframe->redirect('index.php?option='.$option, $msg, 'error'); } /* * We need to update frontpage status for the articles. * * First we include the frontpage table and instantiate an instance of * it. */ require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_frontpage'.DS.'tables'.DS.'frontpage.php'); $fp = new TableFrontPage($db); foreach ($cid as $id) { // toggles go to first place if ($fp->load($id)) { if (!$fp->delete($id)) { $msg .= $fp->stderr(); } $fp->ordering = 0; } else { // new entry $query = 'INSERT INTO #__content_frontpage' . ' VALUES ( '. (int) $id .', 0 )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->stderr() ); return false; } $fp->ordering = 0; } $fp->reorder(); } $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect('index.php?option='.$option, $msg); } function removeContent() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $option = JRequest::getCmd( 'option' ); $return = JRequest::getCmd( 'returntask', '', 'post' ); $nullDate = $db->getNullDate(); JArrayHelper::toInteger($cid); if (count($cid) < 1) { $msg = JText::_('Select an item to delete'); $mainframe->redirect('index.php?option='.$option, $msg, 'error'); } // Removed content gets put in the trash [state = -2] and ordering is always set to 0 $state = '-2'; $ordering = '0'; // Get the list of content id numbers to send to trash. $cids = implode(',', $cid); // Update articles in the database $query = 'UPDATE #__content' . ' SET state = '.(int) $state . ', ordering = '.(int) $ordering . ', checked_out = 0, checked_out_time = '.$db->Quote($nullDate). ' WHERE id IN ( '. $cids. ' )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->getErrorMsg() ); return false; } $cache = & JFactory::getCache('com_content'); $cache->clean(); $msg = JText::sprintf('Item(s) sent to the Trash', count($cid)); $mainframe->redirect('index.php?option='.$option.'&task='.$return, $msg); } /** * Cancels an edit operation */ function cancelContent() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); // Check the article in if checked out $row = & JTable::getInstance('content'); $row->bind(JRequest::get('post')); $row->checkin(); $mainframe->redirect('index.php?option=com_content'); } /** * Moves the order of a record * @param integer The increment to reorder by */ function orderContent($direction) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); if (isset( $cid[0] )) { $row = & JTable::getInstance('content'); $row->load( (int) $cid[0] ); $row->move($direction, 'catid = ' . (int) $row->catid . ' AND state >= 0' ); $cache = & JFactory::getCache('com_content'); $cache->clean(); } $mainframe->redirect('index.php?option=com_content'); } /** * Form for moving item(s) to a different section and category */ function moveSection() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); JArrayHelper::toInteger($cid); if (count($cid) < 1) { $msg = JText::_('Select an item to move'); $mainframe->redirect('index.php?option=com_content', $msg, 'error'); } //seperate contentids $cids = implode(',', $cid); // Articles query $query = 'SELECT a.title' . ' FROM #__content AS a' . ' WHERE ( a.id IN ( '. $cids .' ) )' . ' ORDER BY a.title'; $db->setQuery($query); $items = $db->loadObjectList(); $query = 'SELECT CONCAT_WS( ", ", s.id, c.id ) AS `value`, CONCAT_WS( " / ", s.title, c.title ) AS `text`' . ' FROM #__sections AS s' . ' INNER JOIN #__categories AS c ON c.section = s.id' . ' WHERE s.scope = "content"' . ' ORDER BY s.title, c.title'; $db->setQuery($query); $rows[] = JHTML::_('select.option', "0, 0", JText::_('UNCATEGORIZED')); $rows = array_merge($rows, $db->loadObjectList()); // build the html select list $sectCatList = JHTML::_('select.genericlist', $rows, 'sectcat', 'class="inputbox" size="8"', 'value', 'text', null); ContentView::moveSection($cid, $sectCatList, 'com_content', $sectionid, $items); } /** * Save the changes to move item(s) to a different section and category */ function moveSectionSave() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $user = & JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); $option = JRequest::getCmd( 'option' ); JArrayHelper::toInteger($cid, array(0)); $sectcat = JRequest::getVar( 'sectcat', '', 'post', 'string' ); $sectcat = explode(',', $sectcat); $newsect = (int) @$sectcat[0]; $newcat = (int) @$sectcat[1]; if ((!$newsect || !$newcat) && ($sectcat !== array('0', ' 0'))) { $mainframe->redirect("index.php?option=com_content§ionid=$sectionid", JText::_('An error has occurred')); } // find section name $query = 'SELECT a.title' . ' FROM #__sections AS a' . ' WHERE a.id = '. (int) $newsect; $db->setQuery($query); $section = $db->loadResult(); // find category name $query = 'SELECT a.title' . ' FROM #__categories AS a' . ' WHERE a.id = '. (int) $newcat; $db->setQuery($query); $category = $db->loadResult(); $total = count($cid); $cids = implode(',', $cid); $uid = $user->get('id'); $row = & JTable::getInstance('content'); // update old orders - put existing items in last place foreach ($cid as $id) { $row->load(intval($id)); $row->ordering = 0; $row->store(); $row->reorder('catid = '.(int) $row->catid.' AND state >= 0'); } $query = 'UPDATE #__content SET sectionid = '.(int) $newsect.', catid = '.(int) $newcat. ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $uid.' ) )'; $db->setQuery($query); if (!$db->query()) { JError::raiseError( 500, $db->getErrorMsg() ); return false; } // update new orders - put items in last place foreach ($cid as $id) { $row->load(intval($id)); $row->ordering = 0; $row->store(); $row->reorder('catid = '.(int) $row->catid.' AND state >= 0'); } if ($section && $category) { $msg = JText::sprintf('Item(s) successfully moved to Section', $total, $section, $category); } else { $msg = JText::sprintf('ITEM(S) SUCCESSFULLY MOVED TO UNCATEGORIZED', $total); } $mainframe->redirect('index.php?option='.$option.'§ionid='.$sectionid, $msg); } /** * Form for copying item(s) **/ function copyItem() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); $option = JRequest::getCmd( 'option' ); JArrayHelper::toInteger($cid); if (count($cid) < 1) { $msg = JText::_('Select an item to move'); $mainframe->redirect('index.php?option='.$option, $msg, 'error'); } //seperate contentids $cids = implode(',', $cid); ## Articles query $query = 'SELECT a.title' . ' FROM #__content AS a' . ' WHERE ( a.id IN ( '. $cids .' ) )' . ' ORDER BY a.title'; $db->setQuery($query); $items = $db->loadObjectList(); ## Section & Category query $query = 'SELECT CONCAT_WS(",",s.id,c.id) AS `value`, CONCAT_WS(" / ", s.title, c.title) AS `text`' . ' FROM #__sections AS s' . ' INNER JOIN #__categories AS c ON c.section = s.id' . ' WHERE s.scope = "content"' . ' ORDER BY s.title, c.title'; $db->setQuery($query); // Add a row for uncategorized content $uncat = JHTML::_('select.option', '0,0', JText::_('UNCATEGORIZED')); $rows = $db->loadObjectList(); array_unshift($rows, $uncat); // build the html select list $sectCatList = JHTML::_('select.genericlist', $rows, 'sectcat', 'class="inputbox" size="10"', 'value', 'text', NULL); ContentView::copySection($option, $cid, $sectCatList, $sectionid, $items); } /** * saves Copies of items **/ function copyItemSave() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $sectionid = JRequest::getVar( 'sectionid', 0, '', 'int' ); $option = JRequest::getCmd( 'option' ); JArrayHelper::toInteger($cid); $item = null; $sectcat = JRequest::getVar( 'sectcat', '-1,-1', 'post', 'string' ); //seperate sections and categories from selection $sectcat = explode(',', $sectcat); $newsect = (int) @$sectcat[0]; $newcat = (int) @$sectcat[1]; if (($newsect == -1) || ($newcat == -1)) { $mainframe->redirect('index.php?option=com_content§ionid='.$sectionid, JText::_('An error has occurred')); } // find section name $query = 'SELECT a.title' . ' FROM #__sections AS a' . ' WHERE a.id = '. (int) $newsect; $db->setQuery($query); $section = $db->loadResult(); // find category name $query = 'SELECT a.title' . ' FROM #__categories AS a' . ' WHERE a.id = '. (int) $newcat; $db->setQuery($query); $category = $db->loadResult(); if (($newsect == 0) && ($newcat == 0)) { $section = JText::_('UNCATEGORIZED'); $category = JText::_('UNCATEGORIZED'); } $total = count($cid); for ($i = 0; $i < $total; $i ++) { $row = & JTable::getInstance('content'); // main query $query = 'SELECT a.*' . ' FROM #__content AS a' . ' WHERE a.id = '.(int) $cid[$i]; $db->setQuery($query, 0, 1); $item = $db->loadObject(); // values loaded into array set for store $row->id = NULL; $row->sectionid = $newsect; $row->catid = $newcat; $row->hits = '0'; $row->ordering = '0'; $row->title = $item->title; $row->alias = $item->alias; $row->title_alias = $item->title_alias; $row->introtext = $item->introtext; $row->fulltext = $item->fulltext; $row->state = $item->state; $row->mask = $item->mask; $row->created = $item->created; $row->created_by = $item->created_by; $row->created_by_alias = $item->created_by_alias; $row->modified = $item->modified; $row->modified_by = $item->modified_by; $row->checked_out = $item->checked_out; $row->checked_out_time = $item->checked_out_time; $row->publish_up = $item->publish_up; $row->publish_down = $item->publish_down; $row->images = $item->images; $row->attribs = $item->attribs; $row->version = $item->parentid; $row->parentid = $item->parentid; $row->metakey = $item->metakey; $row->metadesc = $item->metadesc; $row->access = $item->access; $row->metadata = $item->metadata; if (!$row->check()) { JError::raiseError( 500, $row->getError() ); return false; } if (!$row->store()) { JError::raiseError( 500, $row->getError() ); return false; } $row->reorder('catid='.(int) $row->catid.' AND state >= 0'); } $msg = JText::sprintf('Item(s) successfully copied to Section', $total, $section, $category); $mainframe->redirect('index.php?option='.$option.'§ionid='.$sectionid, $msg); } /** * @param integer The id of the article * @param integer The new access level * @param string The URL option */ function accessMenu($access) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $option = JRequest::getCmd( 'option' ); $cid = $cid[0]; // Create and load the article table object $row = & JTable::getInstance('content'); $row->load($cid); $row->access = $access; // Ensure the article object is valid if (!$row->check()) { JError::raiseError( 500, $row->getError() ); return false; } // Store the changes if (!$row->store()) { JError::raiseError( 500, $row->getError() ); return false; } $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect('index.php?option='.$option); } function saveOrder() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db = & JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $order = JRequest::getVar( 'order', array (0), 'post', 'array' ); $redirect = JRequest::getVar( 'redirect', 0, 'post', 'int' ); $rettask = JRequest::getVar( 'returntask', '', 'post', 'cmd' ); $total = count($cid); $conditions = array (); JArrayHelper::toInteger($cid, array(0)); JArrayHelper::toInteger($order, array(0)); // Instantiate an article table object $row = & JTable::getInstance('content'); // Update the ordering for items in the cid array for ($i = 0; $i < $total; $i ++) { $row->load( (int) $cid[$i] ); if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError( 500, $db->getErrorMsg() ); return false; } // remember to updateOrder this group $condition = 'catid = '.(int) $row->catid.' AND state >= 0'; $found = false; foreach ($conditions as $cond) if ($cond[1] == $condition) { $found = true; break; } if (!$found) $conditions[] = array ($row->id, $condition); } } // execute updateOrder for each group foreach ($conditions as $cond) { $row->load($cond[0]); $row->reorder($cond[1]); } $cache = & JFactory::getCache('com_content'); $cache->clean(); $msg = JText::_('New ordering saved'); switch ($rettask) { case 'showarchive' : $mainframe->redirect('index.php?option=com_content&task=showarchive§ionid='.$redirect, $msg); break; default : $mainframe->redirect('index.php?option=com_content§ionid='.$redirect, $msg); break; } } function previewContent() { // Initialize variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $id = JRequest::getVar( 'id', 0, '', 'int' ); $option = JRequest::getCmd( 'option' ); // Get the current default template $query = 'SELECT template' . ' FROM #__templates_menu' . ' WHERE client_id = 0' . ' AND menuid = 0'; $db->setQuery($query); $template = $db->loadResult(); // check if template editor stylesheet exists if (!file_exists( JPATH_SITE.DS.'templates'.DS.$template.DS.'css'.DS.'editor.css' )) { $template = 'system'; } // Set page title $document->setTitle(JText::_('Article Preview')); $document->addStyleSheet(JURI::root() . 'templates/'.$template.'/css/editor.css'); $document->setBase(JUri::root()); // Render article preview ContentView::previewContent(); } function insertPagebreak() { $document =& JFactory::getDocument(); $document->setTitle(JText::_('PGB ARTICLE PAGEBRK')); ContentView::insertPagebreak(); } } joomla/joomla/administrator/components/com_content/admin.content.html.php0000766000000000000000000006705011234314104030303 0ustar adminadministrators
    :
    getNullDate(); for ($i=0, $n=count( $rows ); $i < $n; $i++) { $row = &$rows[$i]; $link = 'index.php?option=com_content§ionid='. $redirect .'&task=edit&cid[]='. $row->id; $row->sect_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->sectionid ); $row->cat_link = JRoute::_( 'index.php?option=com_categories&task=edit&cid[]='. $row->catid ); $publish_up =& JFactory::getDate($row->publish_up); $publish_down =& JFactory::getDate($row->publish_down); $publish_up->setOffset($config->getValue('config.offset')); $publish_down->setOffset($config->getValue('config.offset')); if ( $now->toUnix() <= $publish_up->toUnix() && $row->state == 1 ) { $img = 'publish_y.png'; $alt = JText::_( 'Published' ); } else if ( ( $now->toUnix() <= $publish_down->toUnix() || $row->publish_down == $nullDate ) && $row->state == 1 ) { $img = 'publish_g.png'; $alt = JText::_( 'Published' ); } else if ( $now->toUnix() > $publish_down->toUnix() && $row->state == 1 ) { $img = 'publish_r.png'; $alt = JText::_( 'Expired' ); } else if ( $row->state == 0 ) { $img = 'publish_x.png'; $alt = JText::_( 'Unpublished' ); } else if ( $row->state == -1 ) { $img = 'disabled.png'; $alt = JText::_( 'Archived' ); } $times = ''; if (isset($row->publish_up)) { if ($row->publish_up == $nullDate) { $times .= JText::_( 'Start: Always' ); } else { $times .= JText::_( 'Start' ) .": ". $publish_up->toFormat(); } } if (isset($row->publish_down)) { if ($row->publish_down == $nullDate) { $times .= "
    ". JText::_( 'Finish: No Expiry' ); } else { $times .= "
    ". JText::_( 'Finish' ) .": ". $publish_down->toFormat(); } } if ( $user->authorize( 'com_users', 'manage' ) ) { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $linkA = 'index.php?option=com_users&task=edit&cid[]='. $row->created_by; $author = ''. $row->author .''; } } else { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $author = $row->author; } } $access = JHTML::_('grid.access', $row, $i, $row->state ); $checked = JHTML::_('grid.checkedout', $row, $i ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->title; } else if ($row->state == -1) { echo htmlspecialchars($row->title, ENT_QUOTES, 'UTF-8'); echo ' [ '. JText::_( 'Archived' ) .' ]'; } else { ?> title, ENT_QUOTES); ?> <?php echo $alt; ?> <?php echo ( $row->frontpage ) ? JText::_( 'Yes' ) : JText::_( 'No' );?> orderUpIcon( $i, ($row->catid == @$rows[$i-1]->catid), 'orderup', 'Move Up', $ordering); ?> orderDownIcon( $i, $n, ($row->catid == @$rows[$i+1]->catid), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> section_name; ?> name; ?> created, JText::_('DATE_FORMAT_LC4') ); ?> hits ?> id; ?>
    :
    cat_link = JRoute::_( 'index.php?option=com_categories&task=edit&cid[]='. $row->catid ); $row->sec_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->sectionid ); if ( $user->authorize( 'com_users', 'manage' ) ) { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $linkA = JRoute::_( 'index.php?option=com_users&task=edit&cid[]='. $row->created_by ); $author = ''. $row->author .''; } } else { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $author = $row->author; } } ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> id ); ?> title; ?> id; ?> sectname; ?> name; ?> created, JText::_( 'DATE_FORMAT_LC4' ) ); ?>
    $row is passed with the id * property set to 0. * @param JTableContent The category object * @param string The html for the groups select list */ function editContent( &$row, $section, &$lists, &$sectioncategories, $option, &$form ) { JRequest::setVar( 'hidemainmenu', 1 ); jimport('joomla.html.pane'); JFilterOutput::objectHTMLSafe( $row ); $db = &JFactory::getDBO(); $editor = &JFactory::getEditor(); // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $pane = &JPane::getInstance('sliders', array('allowAllClose' => true)); JHTML::_('behavior.tooltip'); ?>
    display( 'text', $row->text , '100%', '550', '75', '20' ) ; ?>
    startPane("content-pane"); echo $pane->startPanel( $title, "detail-page" ); echo $form->render('details'); $title = JText::_( 'Parameters - Advanced' ); echo $pane->endPanel(); echo $pane->startPanel( $title, "params-page" ); echo $form->render('params', 'advanced'); $title = JText::_( 'Metadata Information' ); echo $pane->endPanel(); echo $pane->startPanel( $title, "metadata-page" ); echo $form->render('meta', 'metadata'); echo $pane->endPanel(); echo $pane->endPane(); ?>
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->title ."
  • "; } echo ""; ?>


    "; } ?>
    :


    :
    "; foreach ( $items as $item ) { echo "
  • ". $item->title ."
  • "; } echo ""; ?>


    "; } ?>
    setLink(JURI::root()); JHTML::_('behavior.caption'); ?>
    getNullDate(); // used to hide "Reset Hits" when hits = 0 if ( !$row->hits ) { $visibility = 'style="display: none; visibility: hidden;"'; } else { $visibility = ''; } ?> id ) { ?>
    : id; ?>
    state > 0 ? JText::_( 'Published' ) : ($row->state < 0 ? JText::_( 'Archived' ) : JText::_( 'Draft Unpublished' ) );?>
    hits;?> >
    version;?>
    created == $nullDate ) { echo JText::_( 'New document' ); } else { echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC2') ); } ?>
    modified == $nullDate ) { echo JText::_( 'Not modified' ); } else { echo JHTML::_('date', $row->modified, JText::_('DATE_FORMAT_LC2')); } ?>
    joomla/joomla/administrator/components/com_content/toolbar.content.php0000766000000000000000000000220311234314104027677 0ustar adminadministrators joomla/joomla/administrator/components/com_content/models/0000777000000000000000000000000011266551175025360 5ustar adminadministratorsjoomla/joomla/administrator/components/com_content/models/index.html0000766000000000000000000000005411234314104027335 0ustar adminadministratorsjoomla/joomla/administrator/components/com_content/models/element.php0000766000000000000000000001153211234314104027505 0ustar adminadministrators_list)) { return $this->_list; } // Initialize variables $db =& $this->getDBO(); $filter = null; // Get some variables from the request $sectionid = JRequest::getVar( 'sectionid', -1, '', 'int' ); $redirect = $sectionid; $option = JRequest::getCmd( 'option' ); $filter_order = $mainframe->getUserStateFromRequest('articleelement.filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest('articleelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $catid = $mainframe->getUserStateFromRequest('articleelement.catid', 'catid', 0, 'int'); $filter_authorid = $mainframe->getUserStateFromRequest('articleelement.filter_authorid', 'filter_authorid', 0, 'int'); $filter_sectionid = $mainframe->getUserStateFromRequest('articleelement.filter_sectionid', 'filter_sectionid', -1, 'int'); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest('articleelement.limitstart', 'limitstart', 0, 'int'); $search = $mainframe->getUserStateFromRequest('articleelement.search', 'search', '', 'string'); $search = JString::strtolower($search); //$where[] = "c.state >= 0"; $where[] = "c.state != -2"; if (!$filter_order) { $filter_order = 'section_name'; } $order = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', section_name, cc.name, c.ordering'; $all = 1; if ($filter_sectionid >= 0) { $filter = ' WHERE cc.section = '.$db->Quote($filter_sectionid); } $section->title = 'All Articles'; $section->id = 0; /* * Add the filter specific information to the where clause */ // Section filter if ($filter_sectionid >= 0) { $where[] = 'c.sectionid = '.(int) $filter_sectionid; } // Category filter if ($catid > 0) { $where[] = 'c.catid = '.(int) $catid; } // Author filter if ($filter_authorid > 0) { $where[] = 'c.created_by = '.(int) $filter_authorid; } // Only published articles $where[] = 'c.state = 1'; // Keyword filter if ($search) { $where[] = 'LOWER( c.title ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } // Build the where clause of the content record query $where = (count($where) ? ' WHERE '.implode(' AND ', $where) : ''); // Get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . $where; $db->setQuery($query); $total = $db->loadResult(); // Create the pagination object jimport('joomla.html.pagination'); $this->_page = new JPagination($total, $limitstart, $limit); // Get the articles $query = 'SELECT c.*, g.name AS groupname, cc.title as cctitle, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . ' LEFT JOIN #__users AS v ON v.id = c.created_by' . ' LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id' . $where . $order; $db->setQuery($query, $this->_page->limitstart, $this->_page->limit); $this->_list = $db->loadObjectList(); // If there is a db query error, throw a HTTP 500 and exit if ($db->getErrorNum()) { JError::raiseError( 500, $db->stderr() ); return false; } return $this->_list; } function getPagination() { if (is_null($this->_list) || is_null($this->_page)) { $this->getList(); } return $this->_page; } } ?> joomla/joomla/administrator/components/com_content/models/article.xml0000766000000000000000000001171711234314104027515 0ustar adminadministrators
    Article Edit Form
    joomla/joomla/administrator/components/com_content/admin.content.php0000766000000000000000000000537311234314104027340 0ustar adminadministratorsexecute( $task ); $controller->redirect(); break; case 'add' : case 'new' : ContentController::editContent(false); break; case 'edit' : ContentController::editContent(true); break; case 'go2menu' : case 'go2menuitem' : case 'resethits' : case 'menulink' : case 'apply' : case 'save' : ContentController::saveContent(); break; case 'remove' : ContentController::removeContent(); break; case 'publish' : ContentController::changeContent(1); break; case 'unpublish' : ContentController::changeContent(0); break; case 'toggle_frontpage' : ContentController::toggleFrontPage(); break; case 'archive' : ContentController::changeContent(-1); break; case 'unarchive' : ContentController::changeContent(0); break; case 'cancel' : ContentController::cancelContent(); break; case 'orderup' : ContentController::orderContent(-1); break; case 'orderdown' : ContentController::orderContent(1); break; //case 'showarchive' : // JContentController::viewArchive(); // break; case 'movesect' : ContentController::moveSection(); break; case 'movesectsave' : ContentController::moveSectionSave(); break; case 'copy' : ContentController::copyItem(); break; case 'copysave' : ContentController::copyItemSave(); break; case 'accesspublic' : ContentController::accessMenu(0); break; case 'accessregistered' : ContentController::accessMenu(1); break; case 'accessspecial' : ContentController::accessMenu(2); break; case 'saveorder' : ContentController::saveOrder(); break; case 'preview' : ContentController::previewContent(); break; case 'ins_pagebreak' : ContentController::insertPagebreak(); break; default : ContentController::viewContent(); break; }joomla/joomla/administrator/components/com_menus/0000777000000000000000000000000011266551137023550 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/0000777000000000000000000000000011266551141025045 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/type.css0000766000000000000000000000442111234314076026541 0ustar adminadministrators/* ---- Basic tree styles ------------------- */ .jtree ul, .jtree li { margin: 0; padding: 0; list-style: none; } /* ---- Tree layout ------------------------- */ .jtree ul { margin-left: 20px; } .jtree li { background: url(images/line.gif) repeat-y; } .jtree li.last { background-image: none; } .jtree div { height: 100%; padding: 4px 0 4px 40px; background-repeat: no-repeat; background-position: left bottom; } .jtree span { display: block; position: absolute; width: 18px; height: 18px; margin: 0 0 0 -20px; background-repeat: no-repeat; border: 0 none; } .jtree a {} .jtree .root { padding-left: 20px;} .jtree .root span { background: url(images/base.gif) no-repeat left bottom; } .jtree .node { background-image: url(images/plus.gif); } .jtree .node span { background-image: url(images/folder.gif); } .jtree li.last .node { background-image: url(images/plusbottom.gif); } .jtree li.last .node span { background-image: url(images/folder.gif); } .jtree .node-open { background-image: url(images/minus.gif); } .jtree .node-open span { background-image: url(images/folderopen.gif); } .jtree li.last .node-open { background-image: url(images/minusbottom.gif); } .jtree li.last .node-open span { background-image: url(images/folderopen.gif); } .jtree .leaf { background-image: url(images/join.gif); } .jtree .leaf span { background-image: url(images/page.gif); } .jtree li.last .leaf { background-image: url(images/joinbottom.gif); } .jtree li.last .leaf span { background-image: url(images/page.gif); } .jtree .base { background-image: url(images/blank.gif); } .jtree .base span { background-image: url(images/folder.gif); } .jtree li.last .base { background-image: url(images/blankbottom.gif); } .jtree li.last .base span { background-image: url(images/folder.gif); } .jtree ul .node { padding: 4px 0 4px 20px; } .jtree ul .node span { display: none; } .jtree ul .node-open { padding: 4px 0 4px 20px; } .jtree ul .node-open span { display: none; } .jtree ul li.last .node span { display: none; } .jtree ul li.last .node span { padding: 4px 0 4px 20px; } .jtree ul li.last .node-open span { display: none; } .jtree ul li.last .node-open span { padding: 4px 0 4px 20px; } /* ---- Specific layout ------------------------- */ #internal-node {} #external-node {} #separator-node {} #link-node {} joomla/joomla/administrator/components/com_menus/assets/images/0000777000000000000000000000000011266551142026313 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/images/empty.gif0000766000000000000000000000007611234314076030142 0ustar adminadministratorsGIF89a!,ڋޜ;joomla/joomla/administrator/components/com_menus/assets/images/nolines_minus.gif0000766000000000000000000000031111234314076031656 0ustar adminadministratorsGIF89awwwsss!,F`$dih)o DaB+: 0 ` (@A!x@ljx*;joomla/joomla/administrator/components/com_menus/assets/images/plusbottom.gif0000766000000000000000000000032211234314076031206 0ustar adminadministratorsGIF89awwwsss!,O$@hlٲ+t]@@Ɓa@$.,ap d9 v;$ԇXIp< d~;joomla/joomla/administrator/components/com_menus/assets/images/blankbottom.gif0000766000000000000000000000031511234314076031314 0ustar adminadministratorsGIF89awwwsss!,J$@hlٲ+t]@@Ɓa@$.,Hd Ss 1}^=O0N/I,D(>&7t"6t!/g(W%O#L"K!8,@@,p6`.WkB&S )'!joomla/joomla/administrator/components/com_menus/assets/images/plus.gif0000766000000000000000000000032611234314076027765 0ustar adminadministratorsGIF89awwwsss!,S$@hlٲ+t]@@Ɓa@$.,ap d9 v;$ԇXIp< dTS,},!;joomla/joomla/administrator/components/com_menus/assets/images/page.gif0000766000000000000000000000010311234314076027707 0ustar adminadministratorsGIF89a U!,π0sauo7QH扦*Z;joomla/joomla/administrator/components/com_menus/assets/images/minusbottom.gif0000766000000000000000000000040311234314076031356 0ustar adminadministratorsGIF89a2wwwsss!,2$@hlٲ{H.n;ZP6|[GK(l)%U{@wUmoSht   D& 0  {)h # ( xw'}  $iK!;joomla/joomla/administrator/components/com_menus/assets/images/node.gif0000766000000000000000000000011311234314076027721 0ustar adminadministratorsGIF89a!,"z^RUjBhbAfch9G_;joomla/joomla/administrator/components/com_menus/assets/images/folder.gif0000766000000000000000000000042611234314076030256 0ustar adminadministratorsGIF89a鸽毲⡎\ZYVT}RzOwMtKqImGiDeA_>N/I,D(>&6t!/g(W%O#L!,dib:Zl{])`MB`hUp@ E1mQX>E`T5[ /D9(%gFl"zU~OV5lw"5''*!;joomla/joomla/administrator/components/com_menus/assets/rtl_images/0000777000000000000000000000000011266551141027173 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/rtl_images/empty.gif0000766000000000000000000000007611234314076031023 0ustar adminadministratorsGIF89a!,ڋޜ;joomla/joomla/administrator/components/com_menus/assets/rtl_images/nolines_minus.gif0000766000000000000000000000031111234314076032537 0ustar adminadministratorsGIF89assswwwҭ!,F`$dih,o E x8!<^ƥ 20"D$Bp,J j);joomla/joomla/administrator/components/com_menus/assets/rtl_images/plusbottom.gif0000766000000000000000000000032311234314076032070 0ustar adminadministratorsGIF89assswww!,P$Ch Gt]Q8B$ AFSO91)8  Ag~;joomla/joomla/administrator/components/com_menus/assets/rtl_images/blankbottom.gif0000766000000000000000000000031611234314076032176 0ustar adminadministratorsGIF89assswww!,K$Ch Gt]8B$HH ]h4R`BOTd`]dO%EQpl6|N;joomla/joomla/administrator/components/com_menus/assets/rtl_images/gradient.gif0000766000000000000000000000032611234314076031460 0ustar adminadministratorsGIF89a ?zɋzY:v딴a󂨳qiݿKD}✻Q!, STV,C4r E8Hʺ0pˍJԪ,D[┧5PcQ.Y[sV:a8!;joomla/joomla/administrator/components/com_menus/assets/rtl_images/join.gif0000766000000000000000000000007411234314076030622 0ustar adminadministratorsGIF89a!,qݼK;joomla/joomla/administrator/components/com_menus/assets/rtl_images/folderopen.gif0000766000000000000000000000061611234314076032022 0ustar adminadministratorsGIF89a鸽篲⡏]][ZYZWVUTSU}S}RzPzOzNwMwLtKrJqInHmGiDeA~_>^=O0N/I,D(>&7t"6t!/g(W%O#L"K!8,@@,p6`.WkB&S )'!YA)X|N7;joomla/joomla/administrator/components/com_menus/assets/rtl_images/blank.gif0000766000000000000000000000032211234314076030746 0ustar adminadministratorsGIF89assswww!,O$Ch Gt]8B$HH ]h4R`BOTd`]dO%EQpl6H&WOz^;joomla/joomla/administrator/components/com_menus/assets/rtl_images/nolines_plus.gif0000766000000000000000000000031211234314076032370 0ustar adminadministratorsGIF89assswww!,G`$dih,o   x G@x/#!Hi rZq@ c;joomla/joomla/administrator/components/com_menus/assets/rtl_images/joinbottom.gif0000766000000000000000000000015211234314076032044 0ustar adminadministratorsGIF89a2!,2A˦ Ëltk^v]!5F%t6+׺3K͸~hVK JkԪj;joomla/joomla/administrator/components/com_menus/assets/rtl_images/line.gif0000766000000000000000000000011011234314076030601 0ustar adminadministratorsGIF89a!,˦ Ëltk^v]!5F%t6+׺M;joomla/joomla/administrator/components/com_menus/assets/rtl_images/index.html0000766000000000000000000000005411234314076031167 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/rtl_images/plus.gif0000766000000000000000000000032611234314076030646 0ustar adminadministratorsGIF89assswww!,S$Ch Gt]Q8B$ AFSO91)8  AgFJw!;joomla/joomla/administrator/components/com_menus/assets/rtl_images/page.gif0000766000000000000000000000010311234314076030570 0ustar adminadministratorsGIF89a U!,3saPUD扦;joomla/joomla/administrator/components/com_menus/assets/rtl_images/minusbottom.gif0000766000000000000000000000040211234314076032236 0ustar adminadministratorsGIF89a2sssҩwww!,2$$Dh s\ÿV5LmT6UOWtI{R֩6m^W"t!,AaxΊ8|.i('yx$   ljjQ!;joomla/joomla/administrator/components/com_menus/assets/rtl_images/node.gif0000766000000000000000000000011411234314076030603 0ustar adminadministratorsGIF89a!,#T%OmGiDtKI,wMqI>&\(W/g˽D(}R6t!Y鸅VN/zO#L!,'^i8z4!&Z]KhlL p,`d$=P6!` DttdmJfd y} U^Fysi y  *A+((*!;joomla/joomla/administrator/components/com_menus/assets/index.html0000766000000000000000000000005411234314076027041 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/assets/type_rtl.css0000766000000000000000000000455611234314076027433 0ustar adminadministrators/* ---- Basic tree styles ------------------- */ .jtree ul, .jtree li { margin: 0; padding: 0; list-style: none; } /* ---- Tree layout ------------------------- */ .jtree ul { margin-right: 20px; } .jtree li { background: url(rtl_images/line.gif) right repeat-y; } .jtree li.last { background-image: none; } .jtree div { height: 100%; padding: 4px 40px 4px 0px; background-repeat: no-repeat; background-position: right bottom; } .jtree span { display: block; position: absolute; width: 18px; height: 18px; margin: 0 -20px 0 0px; background-repeat: no-repeat; border: 0 none; } .jtree a {} .jtree .root { padding-right: 20px;} .jtree .root span { background: url(rtl_images/base.gif) no-repeat right bottom; } .jtree .node { background-image: url(rtl_images/plus.gif); } .jtree .node span { background-image: url(rtl_images/folder.gif); } .jtree li.last .node { background-image: url(rtl_images/plusbottom.gif); } .jtree li.last .node span { background-image: url(rtl_images/folder.gif); } .jtree .node-open { background-image: url(rtl_images/minus.gif); } .jtree .node-open span { background-image: url(rtl_images/folderopen.gif); } .jtree li.last .node-open { background-image: url(rtl_images/minusbottom.gif); } .jtree li.last .node-open span { background-image: url(rtl_images/folderopen.gif); } .jtree .leaf { background-image: url(rtl_images/join.gif); } .jtree .leaf span { background-image: url(rtl_images/page.gif); } .jtree li.last .leaf { background-image: url(rtl_images/joinbottom.gif); } .jtree li.last .leaf span { background-image: url(rtl_images/page.gif); } .jtree .base { background-image: url(rtl_images/blank.gif); } .jtree .base span { background-image: url(rtl_images/folder.gif); } .jtree li.last .base { background-image: url(rtl_images/blankbottom.gif); } .jtree li.last .base span { background-image: url(rtl_images/folder.gif); } .jtree ul .node { padding: 4px 20px 4px 0px;} .jtree ul .node span { display: none; } .jtree ul .node-open { padding: 4px 20px 4px 0px; } .jtree ul .node-open span { display: none; } .jtree ul li.last .node span { display: none; } .jtree ul li.last .node span { padding: 4px 20px 4px 0px; } .jtree ul li.last .node-open span { display: none; } .jtree ul li.last .node-open span { padding: 4px 20px 4px 0px; } /* ---- Specific layout ------------------------- */ #internal-node {} #external-node {} #separator-node {} #link-node {} joomla/joomla/administrator/components/com_menus/menus.xml0000766000000000000000000000100211234314076025405 0ustar adminadministrators Menus Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Menu Manager joomla/joomla/administrator/components/com_menus/helpers/0000777000000000000000000000000011266551137025212 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/helpers/helper.php0000766000000000000000000001056711234314100027172 0ustar adminadministratorssetQuery( $query ); return $db->loadObjectList(); } /** * Get a list of the menutypes * @return array An array of menu type names */ function getMenuTypes() { $db = &JFactory::getDBO(); $query = 'SELECT menutype' . ' FROM #__menu_types'; $db->setQuery( $query ); return $db->loadResultArray(); } /** * Gets a list of components that can link to the menu */ function getComponentList() { $db = &JFactory::getDBO(); $query = 'SELECT c.id, c.name, c.link, c.option' . ' FROM #__components AS c' . ' WHERE c.link <> "" AND parent = 0' . ' ORDER BY c.name'; $db->setQuery( $query ); $result = $db->loadObjectList( ); return $result; } /** * Build the select list for parent menu item */ function Parent( &$row ) { $db =& JFactory::getDBO(); // If a not a new item, lets set the menu item id if ( $row->id ) { $id = ' AND id != '.(int) $row->id; } else { $id = null; } // In case the parent was null if (!$row->parent) { $row->parent = 0; } // get a list of the menu items // excluding the current menu item and its child elements $query = 'SELECT m.*' . ' FROM #__menu m' . ' WHERE menutype = '.$db->Quote($row->menutype) . ' AND published != -2' . $id . ' ORDER BY parent, ordering'; $db->setQuery( $query ); $mitems = $db->loadObjectList(); // establish the hierarchy of the menu $children = array(); if ( $mitems ) { // first pass - collect children foreach ( $mitems as $v ) { $pt = $v->parent; $list = @$children[$pt] ? $children[$pt] : array(); array_push( $list, $v ); $children[$pt] = $list; } } // second pass - get an indent list of the items $list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0 ); // assemble menu items to the array $mitems = array(); $mitems[] = JHTML::_('select.option', '0', JText::_( 'Top' ) ); foreach ( $list as $item ) { $mitems[] = JHTML::_('select.option', $item->id, '   '. $item->treename ); } $output = JHTML::_('select.genericlist', $mitems, 'parent', 'class="inputbox" size="10"', 'value', 'text', $row->parent ); return $output; } /** * build the select list for target window */ function Target( &$row ) { $click[] = JHTML::_('select.option', '0', JText::_( 'Parent Window With Browser Navigation' ) ); $click[] = JHTML::_('select.option', '1', JText::_( 'New Window With Browser Navigation' ) ); $click[] = JHTML::_('select.option', '2', JText::_( 'New Window Without Browser Navigation' ) ); $target = JHTML::_('select.genericlist', $click, 'browserNav', 'class="inputbox" size="4"', 'value', 'text', intval( $row->browserNav ) ); return $target; } /** * build the select list for target window */ function Published( &$row ) { $put[] = JHTML::_('select.option', '0', JText::_( 'No' )); $put[] = JHTML::_('select.option', '1', JText::_( 'Yes' )); // If not a new item, trash is not an option if ( !$row->id ) { $row->published = 1; } $published = JHTML::_('select.radiolist', $put, 'published', '', 'value', 'text', $row->published ); return $published; } /** * clean system cache */ function cleanCache() { global $mainframe; if ($mainframe->getCfg('caching')) { // clean system cache $cache =& JFactory::getCache('_system'); $cache->clean(); // clean mod_mainmenu cache $cache2 =& JFactory::getCache('mod_mainmenu'); $cache2->clean(); } } } joomla/joomla/administrator/components/com_menus/helpers/index.html0000766000000000000000000000005411234314100027165 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/0000777000000000000000000000000011266551135024703 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/menus/0000777000000000000000000000000011266551134026031 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/menus/tmpl/0000777000000000000000000000000011266551134027005 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/menus/tmpl/default.php0000766000000000000000000000641011234314076031141 0ustar adminadministrators
    menus as $menu) : ?> id; $linkA = 'index.php?option=com_menus&task=view&menutype='. $menu->menutype; ?> ">
     
    pagination->getListFooter(); ?>
    pagination->limitstart + 1 + $i; ?> title; ?> menutype; ?> published; ?> unpublished; ?> trash; ?> modules; ?> id; ?>
    joomla/joomla/administrator/components/com_menus/views/menus/tmpl/edit.php0000766000000000000000000000531211234314076030442 0ustar adminadministrators
    isnew) : ?>
    joomla/joomla/administrator/components/com_menus/views/menus/tmpl/delete.php0000766000000000000000000000224211234314076030756 0ustar adminadministrators
    modules ) : ?> :
      modules as $module ) : ?>
    1. title; ?>
    :
      menuItems as $item) : ?>
    1. name; ?>
    joomla/joomla/administrator/components/com_menus/views/menus/tmpl/index.html0000766000000000000000000000005411234314076030777 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/menus/tmpl/copy.php0000766000000000000000000000367711234314076030503 0ustar adminadministrators
    :



    :


    :
    table->menutype; ?>

    :
      items as $item) : ?>
    1. name; ?>
     
    joomla/joomla/administrator/components/com_menus/views/menus/view.php0000766000000000000000000000754111234314076027521 0ustar adminadministrators_layout = 'default'; // Set toolbar items for the page JToolBarHelper::title( JText::_( 'Menu Manager' ), 'menumgr.png' ); JToolBarHelper::customX( 'copyMenu', 'copy.png', 'copy_f2.png', 'Copy', true ); JToolBarHelper::customX( 'deleteMenu', 'delete.png', 'delete_f2.png', 'Delete', true ); JToolBarHelper::editListX('editMenu'); JToolBarHelper::addNewX('addMenu'); JToolBarHelper::help( 'screen.menumanager' ); $document = & JFactory::getDocument(); $document->setTitle(JText::_('View Menus')); $limitstart = JRequest::getVar('limitstart', '0', '', 'int'); $menus = &$this->get('Menus'); $pagination = &$this->get('Pagination'); $this->assignRef('menus', $menus); $this->assignRef('pagination', $pagination); $this->assignRef('limitstart', $limitstart); JHTML::_('behavior.tooltip'); parent::display($tpl); } function copyForm($tpl=null) { global $mainframe; $this->_layout = 'copy'; // view data $table = $this->get('Table'); $items = $this->get('MenuItems'); /* * Set toolbar items for the page */ JToolBarHelper::title( JText::_( 'Copy Menu' ) ); JToolBarHelper::custom( 'doCopyMenu', 'copy.png', 'copy_f2.png', 'Copy', false ); JToolBarHelper::cancel(); JToolBarHelper::help( 'screen.menumanager' ); $document = & JFactory::getDocument(); $document->setTitle(JText::_('Copy Menu Items')); $this->assignRef('items', $items); $this->assignRef('table', $table); parent::display($tpl); } function deleteForm($tpl=null) { global $mainframe; $this->_layout = 'delete'; /* * Set toolbar items for the page */ JToolBarHelper::title( JText::_( 'Menu' ) . ': [ '. JText::_( 'Delete' ) .' ]' ); JToolBarHelper::custom( 'doDeleteMenu', 'delete.png', 'delete_f2.png', 'Delete', false ); JToolBarHelper::cancel(); JToolBarHelper::help( 'screen.menumanager.delete' ); // view data $table = $this->get('Table'); $modules = $this->get('Modules'); $menuItems = $this->get('MenuItems'); $document = & JFactory::getDocument(); $document->setTitle(JText::_('Confirm Delete Menu Type') . ': ' . $table->menutype ); $this->assignRef('table', $table); $this->assignRef('modules', $modules); $this->assignRef('menuItems', $menuItems); parent::display($tpl); } function editForm($edit,$tpl=null) { JRequest::setVar( 'hidemainmenu', 1 ); global $mainframe; $this->_layout = 'edit'; if($edit) $table = &$this->get('Table'); else $table=& JTable::getInstance('menuTypes'); /* * Set toolbar items for the page */ $text = ( ($table->id != 0) ? JText::_( 'Edit' ) : JText::_( 'New' ) ); JToolBarHelper::title( JText::_( 'Menu Details' ).': [ '. $text.' ]', 'menumgr.png' ); JToolBarHelper::custom( 'savemenu', 'save.png', 'save_f2.png', 'Save', false ); JToolBarHelper::cancel(); JToolBarHelper::help( 'screen.menumanager.new' ); $this->assignRef('row', $table); $this->assign('isnew', ($table->id == 0)); JHTML::_('behavior.tooltip'); parent::display($tpl); } } joomla/joomla/administrator/components/com_menus/views/menus/index.html0000766000000000000000000000005411234314076030023 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/item/0000777000000000000000000000000011266551136025642 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/item/tmpl/0000777000000000000000000000000011266551136026616 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/item/tmpl/type.php0000766000000000000000000000621511234314076030310 0ustar adminadministrators
    joomla/joomla/administrator/components/com_menus/views/item/tmpl/form.php0000766000000000000000000002047011234314076030271 0ustar adminadministrators

    name; ?>

    description; ?>
    item->id) { ?>
    : item->id; ?>
    :
    :
    : lists->disabled;?> />
    : menutypes, 'menutype', 'class="inputbox" size="1"', 'menutype', 'title', $this->item->menutype );?>
    : item ); ?>
    : lists->published ?>
    : item, $this->item->id ); ?>
    : item ); ?>
    : item ); ?>
    pane->startPane("menu-pane"); echo $this->pane->startPanel(JText :: _('Parameters - Basic'), "param-page"); echo $this->urlparams->render('urlparams'); if(count($this->params->getParams('params'))) : echo $this->params->render('params'); endif; if(!count($this->params->getNumParams('params')) && !count($this->urlparams->getNumParams('urlparams'))) : echo "
    ".JText::_('There are no parameters for this item')."
    "; endif; echo $this->pane->endPanel(); if($params = $this->advanced->render('params')) : echo $this->pane->startPanel(JText :: _('Parameters - Advanced'), "advanced-page"); echo $params; echo $this->pane->endPanel(); endif; if ($this->comp && ($params = $this->comp->render('params'))) : echo $this->pane->startPanel(JText :: _('Parameters - Component'), "component-page"); echo $params; echo $this->pane->endPanel(); endif; if ($this->sysparams && ($params = $this->sysparams->render('params'))) : echo $this->pane->startPanel(JText :: _('Parameters - System'), "system-page"); echo $params; echo $this->pane->endPanel(); endif; echo $this->pane->endPane(); ?>
    item->linkfield; ?>
    joomla/joomla/administrator/components/com_menus/views/item/tmpl/index.html0000766000000000000000000000005411234314076030606 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/item/view.php0000766000000000000000000001326711234314076027332 0ustar adminadministrators_layout = 'form'; $item = &$this->get('Item'); // clean item data JFilterOutput::objectHTMLSafe( $item, ENT_QUOTES, '' ); // Set toolbar items for the page if (!$item->id) { JToolBarHelper::title( JText::_( 'Menu Item' ) .': [ '. JText::_( 'New' ) .' ]', 'menu.png' ); } else { JToolBarHelper::title( JText::_( 'Menu Item' ) .': [ '. JText::_( 'Edit' ) .' ]', 'menu.png' ); } JToolBarHelper::save(); JToolBarHelper::apply(); if ($item->id) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancelItem', 'Close' ); } else { JToolBarHelper::cancel('cancelItem'); } JToolBarHelper::help( 'screen.menus.edit' ); // Load component language files $component = &$this->get('Component'); $lang->load($component->option, JPATH_ADMINISTRATOR); // Initialize variables $urlparams = $this->get( 'UrlParams' ); $params = $this->get( 'StateParams' ); $sysparams = $this->get( 'SystemParams' ); $advanced = $this->get( 'AdvancedParams' ); $component = $this->get( 'ComponentParams' ); $name = $this->get( 'StateName' ); $description = $this->get( 'StateDescription' ); $menuTypes = MenusHelper::getMenuTypeList(); $components = MenusHelper::getComponentList(); JHTML::_('behavior.tooltip'); $document = & JFactory::getDocument(); if ($item->id) { $document->setTitle(JText::_( 'Menu Item' ) .': ['. JText::_( 'Edit' ) .']'); } else { $document->setTitle(JText::_( 'Menu Item' ) .': ['. JText::_( 'New' ) .']'); } // Was showing up null in some cases.... if (!$item->published) { $item->published = 0; } $lists = new stdClass(); $lists->published = MenusHelper::Published($item); $lists->disabled = ($item->type != 'url' ? 'readonly="true"' : ''); $item->expansion = null; if ($item->type != 'url') { $lists->disabled = 'readonly="true"'; $item->linkfield = ''; if (($item->id) && ($item->type == 'component') && (isset($item->linkparts['option']))) { $item->expansion = '&expand='.trim(str_replace('com_', '', $item->linkparts['option'])); } } else { $lists->disabled = null; $item->linkfield = null; } $this->assignRef('lists' , $lists); $this->assignRef('item' , $item); $this->assignRef('urlparams', $urlparams); $this->assignRef('sysparams', $sysparams); $this->assignRef('params' , $params); $this->assignRef('advanced' , $advanced); $this->assignRef('comp' , $component); $this->assignRef('menutypes', $menuTypes); $this->assignRef('name' , $name); $this->assignRef('description', $description); // Add slider pane // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $pane = &JPane::getInstance('sliders', array('allowAllClose' => true)); $this->assignRef('pane', $pane); parent::display($tpl); } function type($tpl = null) { JRequest::setVar( 'hidemainmenu', 1 ); global $mainframe; $lang =& JFactory::getLanguage(); $this->_layout = 'type'; $item = &$this->get('Item'); // Set toolbar items for the page if (!$item->id) { JToolBarHelper::title( JText::_( 'Menu Item' ) .': [ '. JText::_( 'New' ) .' ]', 'menu.png' ); } else { JToolBarHelper::title( JText::_( 'Change Menu Item' ), 'menu.png' ); } // Set toolbar items for the page JToolBarHelper::cancel('view'); JToolBarHelper::help( 'screen.menus.edit' ); // Add scripts and stylesheets to the document $document = & JFactory::getDocument(); if($lang->isRTL()){ $document->addStyleSheet('components/com_menus/assets/type_rtl.css'); } else { $document->addStyleSheet('components/com_menus/assets/type.css'); } JHTML::_('behavior.tooltip'); // Load component language files $components = MenusHelper::getComponentList(); $n = count($components); for($i = 0; $i < $n; $i++) { $path = JPATH_SITE.DS.'components'.DS.$components[$i]->option.DS.'views'; $components[$i]->legacy = !is_dir($path); $lang->load($components[$i]->option, JPATH_ADMINISTRATOR); } // Initialize variables $item = &$this->get('Item'); $expansion = &$this->get('Expansion'); $component = &$this->get('Component'); $name = $this->get( 'StateName' ); $description = $this->get( 'StateDescription' ); $menuTypes = MenusHelper::getMenuTypeList(); // Set document title if ($item->id) { $document->setTitle(JText::_( 'Menu Item' ) .': ['. JText::_( 'Edit' ) .']'); } else { $document->setTitle(JText::_( 'Menu Item' ) .': ['. JText::_( 'New' ) .']'); } $this->assignRef('item', $item); $this->assignRef('components', $components); $this->assignRef('expansion', $expansion); parent::display($tpl); } } joomla/joomla/administrator/components/com_menus/views/item/index.html0000766000000000000000000000005411234314076027632 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/index.html0000766000000000000000000000005411234314076026674 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/list/0000777000000000000000000000000011266551135025656 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/list/tmpl/0000777000000000000000000000000011266551135026632 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/list/tmpl/default.php0000766000000000000000000001167511234314076030776 0ustar adminadministrators
    : lists['levellist']; echo $this->lists['state']; ?>
    items ); $rows = &$this->items; foreach ($rows as $row) : $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> ">
    lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> ordering) echo JHTML::_('grid.order', $this->items ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?>
    pagination->getListFooter(); ?>
    pagination->limitstart;?> user->get('id'), $row->checked_out ) ) : ?> treename; ?> treename; ?> home == 1 ) : ?> <?php echo JText::_( 'Default' ); ?>   pagination->orderUpIcon( $i, $row->parent == 0 || $row->parent == @$rows[$i-1]->parent, 'orderup', 'Move Up', $this->ordering); ?> pagination->orderDownIcon( $i, $n, $row->parent == 0 || $row->parent == @$rows[$i+1]->parent, 'orderdown', 'Move Down', $this->ordering ); ?> ordering ? '' : 'disabled="disabled"'; ?> class="text_area" style="text-align: center" /> type == 'component') ? $row->view : $row->type; ?> id; ?>
    joomla/joomla/administrator/components/com_menus/views/list/tmpl/move.php0000766000000000000000000000270111234314076030306 0ustar adminadministrators
    :
    MenuList ?>

    :
      items as $item ) : ?>
    1. name; ?>
    items as $item ) : ?>
    joomla/joomla/administrator/components/com_menus/views/list/tmpl/index.html0000766000000000000000000000005411234314076030623 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/views/list/tmpl/copy.php0000766000000000000000000000267211234314076030321 0ustar adminadministrators
    :
    MenuList; ?>

    :
      items as $item ) : ?>
    1. name; ?>
    items as $item ) : ?>
    joomla/joomla/administrator/components/com_menus/views/list/view.php0000766000000000000000000001433511234314076027344 0ustar adminadministrators_layout = 'default'; /* * Set toolbar items for the page */ $menutype = $mainframe->getUserStateFromRequest( 'com_menus.menutype', 'menutype', 'mainmenu', 'string' ); JToolBarHelper::title( JText::_( 'MENU ITEM MANAGER' ) .': ['.$menutype.']', 'menu.png' ); $bar =& JToolBar::getInstance('toolbar'); $bar->appendButton( 'Link', 'menus', 'Menus', "index.php?option=com_menus" ); JToolBarHelper::makeDefault( 'setdefault' ); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::customX( 'move', 'move.png', 'move_f2.png', 'Move', true ); JToolBarHelper::customX( 'copy', 'copy.png', 'copy_f2.png', 'Copy', true ); JToolBarHelper::trash(); JToolBarHelper::editListX(); JToolBarHelper::addNewX('newItem'); JToolBarHelper::help( 'screen.menus' ); $document = & JFactory::getDocument(); $document->setTitle(JText::_('View Menu Items')); $limitstart = JRequest::getVar('limitstart', '0', '', 'int'); $items = &$this->get('Items'); $pagination = &$this->get('Pagination'); $lists = &$this->_getViewLists(); $user = &JFactory::getUser(); // Ensure ampersands and double quotes are encoded in item titles foreach ($items as $i => $item) { $treename = $item->treename; $treename = JFilterOutput::ampReplace($treename); $treename = str_replace('"', '"', $treename); $items[$i]->treename = $treename; } //Ordering allowed ? $ordering = ($lists['order'] == 'm.ordering'); JHTML::_('behavior.tooltip'); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); $this->assignRef('user', $user); $this->assignRef('menutype', $menutype); $this->assignRef('ordering', $ordering); $this->assignRef('limitstart', $limitstart); parent::display($tpl); } function copyForm($tpl=null) { global $mainframe; $this->_layout = 'copy'; /* * Set toolbar items for the page */ JToolBarHelper::title( JText::_( 'Menu Items' ) . ': [ '. JText::_( 'Copy' ) .' ]' ); JToolBarHelper::custom( 'doCopy', 'copy.png', 'copy_f2.png', 'Copy', false ); JToolBarHelper::cancel('cancelItem'); JToolBarHelper::help( 'screen.menus' ); $document = & JFactory::getDocument(); $document->setTitle(JText::_('Copy Menu Items')); $menutype = $mainframe->getUserStateFromRequest( 'com_menus.menutype', 'menutype', 'mainmenu', 'string' ); // Build the menutypes select list $menuTypes = MenusHelper::getMenuTypes(); foreach ( $menuTypes as $menuType ) { $menu[] = JHTML::_('select.option', $menuType, $menuType ); } $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null ); $items = &$this->get('ItemsFromRequest'); $this->assignRef('menutype', $menutype); $this->assignRef('items', $items); $this->assignRef('menutypes', $menuTypes); $this->assignRef('MenuList', $MenuList); parent::display($tpl); } function moveForm($tpl=null) { global $mainframe; $this->_layout = 'move'; /* * Set toolbar items for the page */ JToolBarHelper::title( JText::_( 'Menu Items' ) . ': [ '. JText::_( 'Move' ) .' ]' ); JToolBarHelper::custom( 'doMove', 'move.png', 'move_f2.png', 'Move', false ); JToolBarHelper::cancel('cancelItem'); JToolBarHelper::help( 'screen.menus' ); $document = & JFactory::getDocument(); $document->setTitle(JText::_('Move Menu Items')); $menutype = $mainframe->getUserStateFromRequest( 'com_menus.menutype', 'menutype', 'mainmenu', 'string' ); // Build the menutypes select list $menuTypes = MenusHelper::getMenuTypes(); foreach ( $menuTypes as $menuType ) { $menu[] = JHTML::_('select.option', $menuType, $menuType ); } $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null ); $items = &$this->get('ItemsFromRequest'); $this->assignRef('menutype', $menutype); $this->assignRef('items', $items); $this->assignRef('menutypes', $menuTypes); $this->assignRef('MenuList', $MenuList); parent::display($tpl); } function &_getViewLists() { global $mainframe; $db =& JFactory::getDBO(); $menutype = $mainframe->getUserStateFromRequest( "com_menus.menutype", 'menutype', 'mainmenu', 'string' ); $filter_order = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_order", 'filter_order', 'm.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_order_Dir", 'filter_order_Dir', 'ASC', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_state", 'filter_state', '', 'word' ); $levellimit = $mainframe->getUserStateFromRequest( "com_menus.$menutype.levellimit", 'levellimit', 10, 'int' ); $search = $mainframe->getUserStateFromRequest( "com_menus.$menutype.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); // level limit filter $lists['levellist'] = JHTML::_('select.integerlist', 1, 20, 1, 'levellimit', 'size="1" onchange="document.adminForm.submit();"', $levellimit ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; return $lists; } } joomla/joomla/administrator/components/com_menus/views/list/index.html0000766000000000000000000000005411234314076027647 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/controller.php0000766000000000000000000005204111234314076026441 0ustar adminadministratorsgetModel( 'Item' ); $view =& $this->getView( 'Item' ); $view->setModel( $model, true ); // Set the layout and display $view->setLayout('type'); $view->type(); } /** * Edit menu item wizard */ function type() { JRequest::setVar( 'edit', true ); $model =& $this->getModel( 'Item' ); $view =& $this->getView( 'Item' ); $view->setModel( $model, true ); // Set the layout and display $view->setLayout('type'); $view->type(); } /** * Edits a menu item */ function edit() { JRequest::setVar( 'edit', true ); $model =& $this->getModel( 'Item' ); $model->checkout(); $view =& $this->getView( 'Item' ); $view->setModel( $model, true ); // Set the layout and display $view->setLayout('form'); $view->edit(); } /** * Saves a menu item */ function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model =& $this->getModel( 'Item' ); $post = JRequest::get('post'); // allow name only to contain html $post['name'] = JRequest::getVar( 'name', '', 'post', 'string', JREQUEST_ALLOWHTML ); $model->setState( 'request', $post ); if ($model->store()) { $msg = JText::_( 'Menu item Saved' ); } else { $msg = JText::_( 'Error Saving Menu item' ); } $item =& $model->getItem(); switch ( $this->_task ) { case 'apply': $this->setRedirect( 'index.php?option=com_menus&menutype='.$item->menutype.'&task=edit&cid[]='.$item->id.'' , $msg ); break; case 'save': default: $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$item->menutype, $msg ); break; } } /** * Cancels an edit operation */ function cancelItem() { global $mainframe; JRequest::checkToken() or jexit( 'Invalid Token' ); $menutype = $mainframe->getUserStateFromRequest( 'com_menus.menutype', 'menutype', 'mainmenu', 'string' ); $model = $this->getModel('item'); $model->checkin(); $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menutype); } /** * Cancels an edit operation */ function cancel() { $this->setRedirect( 'index.php?option=com_menus'); } /** * Form for copying item(s) to a specific menu */ function copy() { $model =& $this->getModel( 'List' ); $view =& $this->getView( 'List' ); $view->setModel( $model, true ); $view->copyForm(); } /** * Save the item(s) to the menu selected */ function doCopy() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getString( 'menu', '', 'post'); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); //Check to see of a menu was selected to copy the items too if (empty($menu)) { $msg = JText::_('Please select a menu from the list'); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('copy'); } $model =& $this->getModel( 'List' ); if ($model->copy($cid, $menu)) { $msg = JText::sprintf( 'Menu Items Copied to', count( $cid ), $menu ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Form for moving item(s) to a specific menu */ function move() { $model =& $this->getModel( 'List'); $view =& $this->getView( 'List' ); $view->setModel( $model, true ); $view->moveForm(); } /** * Save the item(s) to the menu selected */ function doMove() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menu', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); //Check to see if a menu was selected to copy the items too if (empty($menu)) { $msg = JText::_('Please select a menu from the list'); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('move'); } $model =& $this->getModel( 'List' ); if ($model->move($cid, $menu)) { $msg = JText::sprintf( 'Menu Items Moved to', count( $cid ), $menu ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function publish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setItemState($cid, 1)) { $msg = JText::sprintf( 'Menu Items Published', count( $cid ) ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function unpublish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setItemState($cid, 0)) { $msg = JText::sprintf( 'Menu Items Unpublished', count( $cid ) ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function orderup() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (isset($cid[0]) && $cid[0]) { $id = $cid[0]; } else { $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, JText::_('No Items Selected') ); return false; } $model =& $this->getModel( 'List' ); if ($model->orderItem($id, -1)) { $msg = JText::_( 'Menu Item Moved Up' ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function orderdown() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (isset($cid[0]) && $cid[0]) { $id = $cid[0]; } else { $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, JText::_('No Items Selected') ); return false; } $model =& $this->getModel( 'List' ); if ($model->orderItem($id, 1)) { $msg = JText::_( 'Menu Item Moved Down' ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function saveorder() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setOrder($cid, $menu)) { $msg = JText::_( 'New ordering saved' ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function accesspublic() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setAccess($cid, 0)) { $msg = JText::sprintf( 'Menu Items Set Public', count( $cid ) ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function accessregistered() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setAccess($cid, 1)) { $msg = JText::sprintf( 'Menu Items Set Registered', count( $cid ) ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function accessspecial() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $model =& $this->getModel( 'List' ); if ($model->setAccess($cid, 2)) { $msg = JText::sprintf( 'Menu Items Set Special', count( $cid ) ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function setdefault() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (isset($cid[0]) && $cid[0]) { $id = $cid[0]; } else { $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, JText::_('No Items Selected') ); return false; } $item =& JTable::getInstance( 'menu' ); $item->load($id); if(!$item->get('published')) { $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, JText::_('The Default Menu Item Must Be Published') ); return false; } $model =& $this->getModel( 'List' ); if ($model->setHome($id)) { $msg = JText::_( 'Default Menu Item Set' ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Get some variables from the request $menu = JRequest::getVar( 'menutype', '', 'post', 'string' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (!count($cid)) { $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, JText::_('No Items Selected') ); return false; } $model =& $this->getModel( 'List' ); if ($n = $model->toTrash($cid)) { $msg = JText::sprintf( 'Item(s) sent to the Trash', $n ); } else { $msg = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus&task=view&menutype='.$menu, $msg ); } /** * Save the item(s) to the menu selected */ function view() { $model =& $this->getModel( 'List' ); $view =& $this->getView( 'List' ); $view->setModel( $model, true ); $view->display(); } /** * Controller for view listing menu types and related statical info * @param string The URL option */ function viewMenus() { $view =& $this->getView( 'Menus'); $model =& $this->getModel( 'Menutype' ); $view->setModel( $model, true ); $view->display(); } /** * Controller for view to edit a menu type */ function editMenu() { $view =& $this->getView( 'Menus' ); $model =& $this->getModel( 'Menutype' ); $view->setModel( $model, true ); $view->editForm(true,null); } /** * Controller for view to create a menu type */ function addMenu() { $view =& $this->getView( 'Menus' ); $model =& $this->getModel( 'Menutype' ); $view->setModel( $model, true ); $view->editForm(false,null); } /** * Controller for saving a menu type */ function saveMenu() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $id = JRequest::getVar( 'id', 0, 'post', 'int' ); $oldType =& JTable::getInstance('menutypes' ); $oldType->load( $id ); $menuType =& JTable::getInstance('menutypes'); $menuType->bind( JRequest::get( 'post' ) ); $isNew = ($menuType->id == 0); $isChanged = ($oldType->menutype != $menuType->menutype); if (!$menuType->check()) { JError::raiseWarning( 500, $menuType->getError() ); $this->setRedirect( 'index.php?option=com_menus&task=editMenu', 'Please check your menu settings' ); return false; } if (!$menuType->store()) { JError::raiseWarning( 500, $menuType->getError() ); $this->setRedirect( 'index.php?option=com_menus&task=editMenu', 'Please check your menu settings' ); return false; } if ($isNew) { if ($title = JRequest::getVar( 'module_title', $menuType->menutype, 'post', 'string' )) { $module =& JTable::getInstance( 'module'); $module->title = $title; $module->position = 'left'; $module->module = 'mod_mainmenu'; $module->published = 0; $module->iscore = 0; $module->params = 'menutype='. $menuType->menutype; // check then store data in db if (!$module->check()) { return JError::raiseWarning( 500, $module->getError() ); } if (!$module->store()) { return JError::raiseWarning( 500, $module->getError() ); } $module->checkin(); $module->reorder( 'position='.$db->Quote($module->position) ); // module assigned to show on All pages by default // Clean up possible garbage first $query = 'DELETE FROM #__modules_menu WHERE moduleid = '.(int) $module->id; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } // ToDO: Changed to become a Joomla! db-object $query = 'INSERT INTO #__modules_menu VALUES ( '.(int) $module->id.', 0 )'; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } } $msg = JText::sprintf( 'New Menu created', $menuType->menutype ); } else if ($isChanged) { $oldTerm = $oldType->menutype; $newTerm = $menuType->menutype; // change menutype being of all mod_mainmenu modules calling old menutype $query = 'SELECT id' . ' FROM #__modules' . ' WHERE module = "mod_mainmenu"' . ' AND params LIKE "%menutype='.$db->getEscaped($oldTerm).'%"' ; $db->setQuery( $query ); $modules = $db->loadResultArray(); foreach ($modules as $id) { $row =& JTable::getInstance('module'); $row->load( $id ); $row->params = str_replace( $oldTerm, $newTerm, $row->params ); // check then store data in db if ( !$row->check() ) { return JError::raiseWarning( 500, $db->getError() ); } if ( !$row->store() ) { return JError::raiseWarning( 500, $db->getError() ); } $row->checkin(); } // change menutype of all menuitems using old menutype $query = 'UPDATE #__menu' . ' SET menutype = '.$db->Quote($newTerm) . ' WHERE menutype = '.$db->Quote($oldTerm) ; $db->setQuery( $query ); $db->query(); $msg = JText::_( 'Menu Items & Modules updated' ); } $this->setRedirect( 'index.php?option=com_menus', $msg ); } /** * Controller for a view to confirm the deletion of a menu type */ function deleteMenu() { $view =& $this->getView( 'Menus' ); $model =& $this->getModel( 'Menutype' ); $view->setModel( $model, true ); $view->deleteForm(); } /** * Delete a menu */ function doDeleteMenu() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $id = JRequest::getVar( 'id', 0, '', 'int' ); if ($id <= 0) { JError::raiseWarning( 500, JText::_( 'Invalid ID provided' ) ); $this->setRedirect( 'index.php?option=com_menus' ); return false; } $model =& $this->getModel( 'Menutype' ); if (!$model->canDelete()) { JError::raiseWarning( 500, $model->getError() ); $this->setRedirect( 'index.php?option=com_menus' ); return false; } $err = null; if (!$model->delete()) { $err = $model->getError(); } $this->setRedirect( 'index.php?option=com_menus', $err ); } /** * Compiles a list of the articles you have selected to Copy */ function copyMenu() { $view =& $this->getView( 'Menus' ); $model =& $this->getModel( 'Menutype' ); $view->setModel( $model, true ); $view->copyForm(); } /** * Copies a complete menu, all its items and creates a new module, using the name speified */ function doCopyMenu() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $type = JRequest::getVar( 'type', '', 'post', 'string' ); $menu_name = JRequest::getVar( 'menu_name', 'New Menu', 'post', 'string' ); $module_name = JRequest::getVar( 'module_name', 'New Module', 'post', 'string' ); // check for unique menutype for new menu copy $query = 'SELECT params' . ' FROM #__modules' . ' WHERE module = "mod_mainmenu"'; $db->setQuery( $query ); $menus = $db->loadResultArray(); foreach ( $menus as $menu ) { $params = new JParameter( $menu ); if ( $params->get('menutype') == $menu_name ) { JError::raiseWarning( 500, JText::_( 'ERRORMENUNAMEEXISTS' ) ); $this->setRedirect( 'index.php?option=com_menus' ); return; } } // copy the menu items $mids = JRequest::getVar( 'mids', array(), 'post', 'array' ); JArrayHelper::toInteger($mids); $total = count( $mids ); $copy =& JTable::getInstance('menu'); $original =& JTable::getInstance('menu'); sort( $mids ); $a_ids = array(); foreach( $mids as $mid ) { $original->load( $mid ); $copy = $original; $copy->id = NULL; $copy->parent = $a_ids[$original->parent]; $copy->menutype = $menu_name; $copy->home = 0; if ( !$copy->check() ) { JError::raiseWarning( 500, $copy->getError() ); $this->setRedirect( 'index.php?option=com_menus' ); return; } if ( !$copy->store() ) { JError::raiseWarning( 500, $copy->getError() ); $this->setRedirect( 'index.php?option=com_menus' ); return; } $a_ids[$original->id] = $copy->id; } // create the module copy $row =& JTable::getInstance('module'); $row->load( 0 ); $row->title = $module_name; $row->iscore = 0; $row->published = 1; $row->position = 'left'; $row->module = 'mod_mainmenu'; $row->params = 'menutype='. $menu_name; if (!$row->check()) { JError::raiseWarning( 500, $db->getError() ); $this->setRedirect( 'index.php?option=com_menus' ); return; } if (!$row->store()) { JError::raiseWarning( 500, $db->getError() ); $this->setRedirect( 'index.php?option=com_menus' ); return; } $row->checkin(); $row->reorder( 'position='.$db->Quote($row->position) ); // module assigned to show on All pages by default // ToDO: Changed to become a Joomla! db-object $query = 'INSERT INTO #__modules_menu' . ' VALUES ( '.(int) $row->id.', 0 )'; $db->setQuery( $query ); if ( !$db->query() ) { JError::raiseWarning( 500, $db->getErrorMsg(true) ); $this->setRedirect( 'index.php?option=com_menus' ); return; //echo "\n"; //$mainframe->close(); } // Insert the menu type $query = 'INSERT INTO `#__menu_types` ( `menutype` , `title` , `description` ) ' . ' VALUES ( '.$db->Quote($menu_name).', '.$db->Quote($menu_name).', "")'; $db->setQuery( $query ); if ( !$db->query() ) { JError::raiseWarning( 500, $db->getErrorMsg(true) ); $this->setRedirect( 'index.php?option=com_menus' ); return; //echo "\n"; //$mainframe->close(); } $msg = JText::sprintf( 'Copy of Menu created', $type, $total ); $mainframe->redirect( 'index.php?option=com_menus', $msg ); } } joomla/joomla/administrator/components/com_menus/classes/0000777000000000000000000000000011266551137025205 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/classes/ilink.php0000766000000000000000000002306411234314076027024 0ustar adminadministrators_cid = "&cid[]=".$id; } else { $this->_cid = null; } if ($menutype) { $this->_menutype = "&menutype=".$menutype; } else { $this->_menutype = null; } $this->_com = preg_replace( '#\W#', '', $component ); // Build the tree if (!$this->_getOptions($this->_getXML(JPATH_SITE.'/components/com_'.$this->_com.'/metadata.xml', 'menu'), $this->_root)) { if (!$this->_getViews()) { // Default behavior } } } /** * Returns the component * @return string */ function getComponent() { return $this->_com; } function getTree() { $depth = 0; $this->reset(); $class = null; // Recurse through children if they exist while ($this->_current->hasChildren()) { $this->_output .= '
      '; $children = $this->_current->getChildren(); for ($i=0,$n=count($children);$i<$n;$i++) { $this->_current = & $children[$i]; $this->renderLevel($depth,($i==$n-1)?1:0); } $this->_output .= '
    '; } return $this->_output; } function renderLevel($depth, $isLast=0) { $depth++; if (!isset($this->_depthHash[$depth])) { $this->_depthHash[$depth] = 0; } $this->_depthHash[$depth]++; if ($this->_current->hasChildren()) { $classes = 'node-open'; } else { $classes = 'leaf'; } if ($isLast) { $last = ' class="last"'; } else { $last = ''; } $parent = & $this->_current->getParent(); // Print the item $this->_output .= "\n"; // Print the url if ($this->_current->hasChildren()) { $this->_output .= ""; } else { $this->_output .= ""; } // Recurse through children if they exist while ($this->_current->hasChildren()) { $this->_output .= "
      \n"; $children = $this->_current->getChildren(); for ($i=0,$n=count($children);$i<$n;$i++) { $this->_current = & $children[$i]; $this->renderLevel($depth,($i==$n-1)?1:0); } $this->_output .= "
    \n"; } // Close item $this->_output .= "\n"; } function _getOptions($e, &$parent, $purl=null) { if (!$purl) { $purl = 'url[option]=com_'.$this->_com; // No metadata xml file in component root if (!$e) { return false; } } // Does the metadata file say no options available? if ($e->attributes('options') == 'none') { $node =& new iLinkNode($e->attributes('name'), $purl, $e->attributes('msg')); $parent->addChild($node); return true; } // Do we have defined options available? $options = &$e->getElementByPath('options'); if ($options) { $children = $options->children(); foreach ($children as $child) { if ($child->name() == 'option') { $url = $purl.'&url['.$options->attributes('var').']='.$child->attributes('value'); $node =& new iLinkNode($child->attributes('name'), $url, $child->attributes('msg')); $parent->addChild($node); } elseif ($child->name() == 'default') { $node =& new iLinkNode($child->attributes('name'), $purl, $child->attributes('msg')); $parent->addChild($node); } } return true; } else { return false; } } /** * @access private */ function _getViews() { $return = false; $path = JPATH_SITE.DS.'components'.DS.'com_'.$this->_com.DS.'views'; if (JFolder::exists($path)) { $views = JFolder::folders($path); } else { return $return; } if (is_array($views) && count($views)) { //$this->addChild(new iLinkNode('Views', null, 'Select the view'), true); $return = true; foreach ($views as $view) { if (strpos($view, '_') === false) { // Load view metadata if it exists $xmlpath = $path.DS.$view.DS.'metadata.xml'; if (JFile::exists($xmlpath)) { $data = $this->_getXML($xmlpath, 'view'); } else { $data = null; } $url = 'url[option]=com_'.$this->_com.'&url[view]='.$view; if ($data) { if ($data->attributes('hidden') != 'true') { $m = $data->getElementByPath('message'); if ($m) { $message = $m->data(); } $node =& new iLinkNode($data->attributes('title'), $url, $message); $this->addChild($node); if ($options = $data->getElementByPath('options')) { $this->_getOptions($data, $node, $url); } else { $this->_getLayouts(dirname($xmlpath), $node); } } } else { $onclick = null; $node =& new iLinkNode(ucfirst($view), $url); $this->addChild($node); $this->_getLayouts(dirname($xmlpath), $node); } } } } return $return; } /** * @access private */ function _getLayouts($path, &$node) { $return = false; $folder = $path.DS.'tmpl'; if (is_dir( $folder )) { $files = JFolder::files($folder, '.php$'); if (count($files)) { foreach ($files as $file) { if (strpos($file, '_') === false) { // Load view metadata if it exists $layout = JFile::stripext($file); $xmlpath = $path.DS.'tmpl'.DS.$layout.'.xml'; if (JFile::exists($xmlpath)) { $data = $this->_getXML($xmlpath, 'layout'); } else { $data = null; } if ($layout != 'default') { $url = 'url[option]=com_'.$this->_com.'&url[view]='.basename($path).'&url[layout]='.$layout; } else { $url = 'url[option]=com_'.$this->_com.'&url[view]='.basename($path); } if ($data) { if ($data->attributes('hidden') != 'true') { $m = $data->getElementByPath('message'); if ($m) { $message = $m->data(); } $child =& new iLinkNode($data->attributes('title'), $url, $message); $node->addChild($child); } } else { // Add default info for the layout $child =& new iLinkNode(ucfirst($layout).' '.JText::_('Layout'), $url); $node->addChild($child); } } } } } return $return; } function _getXML($path, $xpath='control') { // Initialize variables $result = null; // load the xml metadata if (file_exists( $path )) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($path)) { if (isset( $xml->document )) { $result = $xml->document->getElementByPath($xpath); } } return $result; } return $result; } function _findNodes(&$node) { foreach ($node->children() as $step) { /* * For each child we need to see if it is an include and if so we * need to get those children and process them as well (break out into * another method). Then we need to create the objects in the _steps * array for each child of type step. For now we aren't going to handle * nested includes. */ if ($step->name() == 'include') { // Handle include $this->_getIncludedSteps($step, $node); } elseif ($step->name() == 'step') { // Include step to array $this->_nodes[] = $step; } else { // Do nothing continue; } } } function _getIncludedSteps($include, &$parent) { $tags = array(); $source = $include->attributes('source'); $path = $include->attributes('path'); preg_match_all( "/{([A-Za-z\-_]+)}/", $source, $tags); if (isset( $tags[1] )) { $n = count( $tags[1] ); for ($i=0; $i < $n; $i++) { $source = str_replace($tags[0][$i], @$this->_vars[$tags[1][$i]], $source); } } // load the source xml file if (file_exists( JPATH_ROOT.$source )) { $xml = & JFactory::getXMLParser('Simple'); if ($xml->loadFile(JPATH_ROOT.$source)) { $document = &$xml->document; $steps = $document->getElementByPath($path); foreach($steps->children() as $step) { if ($step->name() == 'include') { // Handle include } elseif ($step->name() == 'step') { // Include step to array $node->addChild('step', $step->attributes(), $node->level()+1); } else { // Do nothing continue; } } } } } } class iLinkNode extends JNode { /** * Node Title */ var $title = null; /** * Node URL */ var $url = null; /** * Node message */ var $msg = null; function __construct($title, $url = null, $msg = null) { $this->title = trim($title); $this->url = $url; $this->msg = trim($msg); } }joomla/joomla/administrator/components/com_menus/classes/index.html0000766000000000000000000000005411234314076027174 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/index.html0000766000000000000000000000005411234314076025537 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/config.xml0000766000000000000000000000031211234314076025526 0ustar adminadministrators joomla/joomla/administrator/components/com_menus/models/0000777000000000000000000000000011266551136025032 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/models/list.php0000766000000000000000000004430211234314100026501 0ustar adminadministrators_table == null) { $this->_table =& JTable::getInstance( 'menu'); } return $this->_table; } function &getItems() { global $mainframe; static $items; if (isset($items)) { return $items; } $db =& $this->getDBO(); $menutype = $mainframe->getUserStateFromRequest( "com_menus.menutype", 'menutype', 'mainmenu', 'string' ); $filter_order = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.filter_order', 'filter_order', 'm.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.filter_order_Dir', 'filter_order_Dir', 'ASC', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.filter_state', 'filter_state', '', 'word' ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg( 'list_limit' ), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.limitstart', 'limitstart', 0, 'int' ); $levellimit = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.levellimit', 'levellimit', 10, 'int' ); $search = $mainframe->getUserStateFromRequest( 'com_menus.'.$menutype.'.search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $and = ''; if ( $filter_state ) { if ( $filter_state == 'P' ) { $and = ' AND m.published = 1'; } else if ($filter_state == 'U' ) { $and = ' AND m.published = 0'; } } // just in case filter_order get's messed up if ($filter_order) { $orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .', m.parent, m.ordering'; } else { $orderby = ' ORDER BY m.parent, m.ordering'; } // select the records // note, since this is a tree we have to do the limits code-side if ($search) { $query = 'SELECT m.id' . ' FROM #__menu AS m' . ' WHERE menutype = '.$db->Quote($menutype) . ' AND LOWER( m.name ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ) . $and; $db->setQuery( $query ); $search_rows = $db->loadResultArray(); } $query = 'SELECT m.*, u.name AS editor, g.name AS groupname, c.publish_up, c.publish_down, com.name AS com_name' . ' FROM #__menu AS m' . ' LEFT JOIN #__users AS u ON u.id = m.checked_out' . ' LEFT JOIN #__groups AS g ON g.id = m.access' . ' LEFT JOIN #__content AS c ON c.id = m.componentid AND m.type = "content_typed"' . ' LEFT JOIN #__components AS com ON com.id = m.componentid AND m.type = "component"' . ' WHERE m.menutype = '.$db->Quote($menutype) . ' AND m.published != -2' . $and . $orderby; $db->setQuery( $query ); $rows = $db->loadObjectList(); // establish the hierarchy of the menu $children = array(); // first pass - collect children foreach ($rows as $v ) { $pt = $v->parent; $list = @$children[$pt] ? $children[$pt] : array(); array_push( $list, $v ); $children[$pt] = $list; } // second pass - get an indent list of the items $list = JHTML::_('menu.treerecurse', 0, '', array(), $children, max( 0, $levellimit-1 ) ); // eventually only pick out the searched items. if ($search) { $list1 = array(); foreach ($search_rows as $sid ) { foreach ($list as $item) { if ($item->id == $sid) { $list1[] = $item; } } } // replace full list with found items $list = $list1; } $total = count( $list ); jimport('joomla.html.pagination'); $this->_pagination = new JPagination( $total, $limitstart, $limit ); // slice out elements based on limits $list = array_slice( $list, $this->_pagination->limitstart, $this->_pagination->limit ); $i = 0; $query = array(); foreach ( $list as $mitem ) { $edit = ''; switch ( $mitem->type ) { case 'separator': $list[$i]->descrip = JText::_('Separator'); break; case 'url': $list[$i]->descrip = JText::_('URL'); break; case 'menulink': $list[$i]->descrip = JText::_('Menu Link'); break; case 'component': $list[$i]->descrip = JText::_('Component'); $query = parse_url($list[$i]->link); $view = array(); if(isset($query['query'])) { if(strpos($query['query'], '&') !== false) { $query['query'] = str_replace('&','&',$query['query']); } parse_str($query['query'], $view); } $list[$i]->view = $list[$i]->com_name; if (isset($view['view'])) { $list[$i]->view .= ' » '.JText::_(ucfirst($view['view'])); } if (isset($view['layout'])) { $list[$i]->view .= ' / '.JText::_(ucfirst($view['layout'])); } if (isset($view['task']) && !isset($view['view'])) { $list[$i]->view .= ' :: '.JText::_(ucfirst($view['task'])); } break; default: $list[$i]->descrip = JText::_('Unknown'); break; } $i++; } $items = $list; return $items; } function &getPagination() { if ($this->_pagination == null) { $this->getItems(); } return $this->_pagination; } /** * Form for copying item(s) to a specific menu */ function getItemsFromRequest() { static $items; if (isset($items)) { return $items; } $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count($cid) < 1) { $this->setError(JText::_( 'Select an item to move')); return false; } // Query to list the selected menu items $db =& $this->getDBO(); $cids = implode( ',', $cid ); $query = 'SELECT `id`, `name`' . ' FROM `#__menu`' . ' WHERE `id` IN ( '.$cids.' )'; $db->setQuery( $query ); $items = $db->loadObjectList(); return $items; } /** * Gets the componet table object related to this menu item */ function &getComponent() { $id = $this->_table->componentid; $component = & JTable::getInstance( 'component'); $component->load( $id ); return $component; } /** * Save the item(s) to the menu selected */ function copy( $items, $menu ) { $curr =& JTable::getInstance('menu'); $itemref = array(); foreach ($items as $id) { $curr->load( $id ); $curr->id = NULL; $curr->home = 0; if ( !$curr->store() ) { $this->setError($curr->getError()); return false; } $itemref[] = array($id, $curr->id); } foreach ($itemref as $ref) { $curr->load( $ref[1] ); if ($curr->parent!=0) { $found = false; foreach ( $itemref as $ref2 ) { if ($curr->parent == $ref2[0]) { $curr->parent = $ref2[1]; $found = true; break; } // if } if (!$found && $curr->menutype!=$menu) { $curr->parent = 0; } } $curr->menutype = $menu; $curr->ordering = '9999'; $curr->home = 0; if ( !$curr->store() ) { $this->setError($curr->getError()); return false; } $curr->reorder( 'menutype = '.$this->_db->Quote($curr->menutype).' AND parent = '.(int) $curr->parent ); } // foreach //Now, we need to rebuild sublevels... $this->_rebuildSubLevel(); // clean cache MenusHelper::cleanCache(); return true; } function move($items, $menu) { // Add all children to the list foreach ($items as $id) { $this->_addChildren($id, $items); } $row =& $this->getTable(); $ordering = 1000000; $firstroot = 0; foreach ($items as $id) { $row->load( $id ); // is it moved together with his parent? $found = false; if ($row->parent != 0) { foreach ($items as $idx) { if ($idx == $row->parent) { $found = true; break; } // if } } if (!$found) { $row->parent = 0; $row->ordering = $ordering++; if (!$firstroot) $firstroot = $row->id; } // if $row->menutype = $menu; if ( !$row->store() ) { $this->setError($row->getError()); return false; } // if } // foreach if ($firstroot) { $row->load( $firstroot ); $row->reorder( 'menutype = '.$this->_db->Quote($row->menutype).' AND parent = '.(int) $row->parent ); } // if //Rebuild sublevel $this->_rebuildSubLevel(); // clean cache MenusHelper::cleanCache(); return true; } function toTrash($items) { $db =& $this->getDBO(); $nd = $db->getNullDate(); $state = -2; $row =& $this->getTable(); $default = 0; // Add all children to the list foreach ($items as $id) { //Check if it's the default item $row->load( $id ); if ($row->home != 1) { $this->_addChildren($id, $items); } else { unset($items[$default]); JError::raiseWarning( 'SOME_ERROR_CODE', JText::_('You cannot trash the default menu item')); } $default++; } if (!empty($items)) { // Sent menu items to the trash JArrayHelper::toInteger($items, array(0)); $where = ' WHERE (id = ' . implode( ' OR id = ', $items ) . ') AND home = 0'; $query = 'UPDATE #__menu' . ' SET published = '.(int) $state.', parent = 0, ordering = 0, checked_out = 0, checked_out_time = '.$db->Quote($nd) . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } } // clean cache MenusHelper::cleanCache(); return count($items); } function fromTrash($items) { $db =& $this->getDBO(); $nd = $db->getNullDate(); $state = 0; // Add all children to the list foreach ($items as $id) { $this->_addChildren($id, $items); } // Sent menu items to the trash JArrayHelper::toInteger($items, array(0)); $where = ' WHERE id = ' . implode( ' OR id = ', $items ); $query = 'UPDATE #__menu' . ' SET published = '.(int) $state.', parent = 0, ordering = 99999, checked_out = 0, checked_out_time = '.$db->Quote($nd) . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } // clean cache (require helper because method can be called from com_trash) require_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_menus'.DS.'helpers'.DS.'helper.php' ); MenusHelper::cleanCache(); return count($items); } /** * Set the state of selected menu items */ function setHome( $item ) { $db =& $this->getDBO(); // Clear home field for all other items $query = 'UPDATE #__menu' . ' SET home = 0' . ' WHERE 1'; $db->setQuery( $query ); if ( !$db->query() ) { $this->setError($db->getErrorMsg()); return false; } // Set the given item to home $query = 'UPDATE #__menu' . ' SET home = 1' . ' WHERE id = '.(int) $item; $db->setQuery( $query ); if ( !$db->query() ) { $this->setError($db->getErrorMsg()); return false; } // clean cache MenusHelper::cleanCache(); return true; } /** * Set the state of selected menu items */ function setItemState( $items, $state ) { if(is_array($items)) { $row =& $this->getTable(); foreach ($items as $id) { $row->load( $id ); if ($row->home != 1) { $row->published = $state; if ($state != 1) { // Set any alias menu types to not point to unpublished menu items $db = &$this->getDBO(); $query = 'UPDATE #__menu SET link = 0 WHERE type = \'menulink\' AND link = '.(int)$id; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } } if (!$row->check()) { $this->setError($row->getError()); return false; } if (!$row->store()) { $this->setError($row->getError()); return false; } } else { JError::raiseWarning( 'SOME_ERROR_CODE', JText::_('You cannot unpublish the default menu item')); return false; } } } // clean cache MenusHelper::cleanCache(); return true; } /** * Set the access of selected menu items */ function setAccess( $items, $access ) { $row =& $this->getTable(); foreach ($items as $id) { $row->load( $id ); $row->access = $access; // Set any alias menu types to not point to unpublished menu items $db = &$this->getDBO(); $query = 'UPDATE #__menu SET link = 0 WHERE type = \'menulink\' AND access < '.(int)$access.' AND link = '.(int)$id; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } if (!$row->check()) { $this->setError($row->getError()); return false; } if (!$row->store()) { $this->setError($row->getError()); return false; } } // clean cache MenusHelper::cleanCache(); return true; } function orderItem($item, $movement) { $row =& $this->getTable(); $row->load( $item ); if (!$row->move( $movement, 'menutype = '.$this->_db->Quote($row->menutype).' AND parent = '.(int) $row->parent )) { $this->setError($row->getError()); return false; } // clean cache MenusHelper::cleanCache(); return true; } function setOrder($items, $menutype) { $total = count( $items ); $row =& $this->getTable(); $groupings = array(); $order = JRequest::getVar( 'order', array(), 'post', 'array' ); JArrayHelper::toInteger($order); // update ordering values for( $i=0; $i < $total; $i++ ) { $row->load( $items[$i] ); // track parents $groupings[] = $row->parent; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { $this->setError($row->getError()); return false; } } // if } // for // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('menutype = '.$this->_db->Quote($menutype).' AND parent = '.(int) $group.' AND published >=0'); } // clean cache MenusHelper::cleanCache(); return true; } /** * Delete one or more menu items * @param mixed int or array of id values */ function delete( $ids ) { JArrayHelper::toInteger($ids); if (!empty( $ids )) { // Add all children to the list foreach ($ids as $id) { $this->_addChildren($id, $ids); } $db = &$this->getDBO(); // Delete associated module and template mappings $where = 'WHERE menuid = ' . implode( ' OR menuid = ', $ids ); $query = 'DELETE FROM #__modules_menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } $query = 'DELETE FROM #__templates_menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } // Set any alias menu types to not point to missing menu items $query = 'UPDATE #__menu SET link = 0 WHERE type = \'menulink\' AND (link = '.implode( ' OR id = ', $ids ).')'; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } // Delete the menu items $where = 'WHERE id = ' . implode( ' OR id = ', $ids ); $query = 'DELETE FROM #__menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } } // clean cache MenusHelper::cleanCache(); return true; } /** * Delete menu items by type */ function deleteByType( $type = '' ) { $db = &$this->getDBO(); $query = 'SELECT id' . ' FROM #__menu' . ' WHERE menutype = ' . $db->Quote( $type ); $db->setQuery( $query ); $ids = $db->loadResultArray(); if ($db->getErrorNum()) { $this->setError( $db->getErrorMsg() ); return false; } return $this->delete( $ids ); } function _addChildren($id, &$list) { // Initialize variables $return = true; // Get all rows with parent of $id $db =& $this->getDBO(); $query = 'SELECT id' . ' FROM #__menu' . ' WHERE parent = '.(int) $id; $db->setQuery( $query ); $rows = $db->loadObjectList(); // Make sure there aren't any errors if ($db->getErrorNum()) { $this->setError($db->getErrorMsg()); return false; } // Recursively iterate through all children... kinda messy // TODO: Cleanup this method foreach ($rows as $row) { $found = false; foreach ($list as $idx) { if ($idx == $row->id) { $found = true; break; } } if (!$found) { $list[] = $row->id; } $return = $this->_addChildren($row->id, $list); } return $return; } /* * Rebuild the sublevel field for items in the menu (if called with 2nd param = 0 or no params, it will rebuild entire menu tree's sublevel * @param array of menu item ids to change level to * @param int level to set the menu items to (based on parent */ function _rebuildSubLevel($cid = array(0), $level = 0) { JArrayHelper::toInteger($cid, array(0)); $db =& $this->getDBO(); $ids = implode( ',', $cid ); $cids = array(); if($level == 0) { $query = 'UPDATE #__menu SET sublevel = 0 WHERE parent = 0'; $db->setQuery($query); $db->query(); $query = 'SELECT id FROM #__menu WHERE parent = 0'; $db->setQuery($query); $cids = $db->loadResultArray(0); } else { $query = 'UPDATE #__menu SET sublevel = '.(int) $level .' WHERE parent IN ('.$ids.')'; $db->setQuery( $query ); $db->query(); $query = 'SELECT id FROM #__menu WHERE parent IN ('.$ids.')'; $db->setQuery( $query ); $cids = $db->loadResultArray( 0 ); } if (!empty( $cids )) { $this->_rebuildSubLevel( $cids, $level + 1 ); } } } joomla/joomla/administrator/components/com_menus/models/metadata/0000777000000000000000000000000011266551137026613 5ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/models/metadata/separator.xml0000766000000000000000000000054611234314100031321 0ustar adminadministrators Separator Separator parameters... joomla/joomla/administrator/components/com_menus/models/metadata/url.xml0000766000000000000000000000055611234314100030124 0ustar adminadministrators External Link External link parameters... joomla/joomla/administrator/components/com_menus/models/metadata/menulink.xml0000766000000000000000000000053411234314100031140 0ustar adminadministrators Menu Link Menu Link parameters... joomla/joomla/administrator/components/com_menus/models/metadata/index.html0000766000000000000000000000005411234314100030566 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/models/metadata/component.xml0000766000000000000000000000223311234314100031316 0ustar adminadministrators Component Component Parameters joomla/joomla/administrator/components/com_menus/models/item.php0000766000000000000000000004456611234314100026500 0ustar adminadministrators_url = 'index.php?option='.$url['option']; unset($url['option']); if (count($url)) { foreach ($url as $k => $v) { $this->_url .= '&'.$k.'='.$v; } } } $this->setId(); } function setId() { $array = JRequest::getVar('cid', array(0), '', 'array'); $this->_id = (int) $array[0]; if (!$this->_id) { $this->_id = JRequest::getInt('id', 0); } } function &getItem() { static $item; if (isset($item)) { return $item; } $table =& $this->_getTable(); // Load the current item if it has been defined $edit = JRequest::getVar('edit',true); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); JArrayHelper::toInteger($cid, array(0)); if ($edit) { $table->load($cid[0]); } // Override the current item's type field if defined in the request if ($type = JRequest::getString('type')) { $table->type = $type; } // Override the current item's menutype field if defined in the request if ($menu_type = JRequest::getString('menutype')) { $table->menutype = $menu_type; } switch ($table->type) { case 'separator': $table->link = null; $table->componentid = 0; break; case 'url': $table->componentid = 0; break; case 'menulink': $table->componentid = 0; break; case 'component': // Override the current item's link field if defined in the request if (!is_null($this->_url)) { $table->link = $this->_url; } $url = str_replace('index.php?', '', $table->link); $url = str_replace('&', '&', $url); $table->linkparts = null; if(strpos($url, '&') !== false) { $url = str_replace('&','&',$url); } parse_str($url, $table->linkparts); $db = &$this->getDBO(); if ($component = @$table->linkparts['option']) { $query = 'SELECT `id`' . ' FROM `#__components`' . ' WHERE `link` <> \'\'' . ' AND `parent` = 0' . ' AND `option` = "'.$db->getEscaped($component).'"'; $db->setQuery( $query ); $table->componentid = $db->loadResult(); } break; } $item = $table; return $item; } function &getExpansion() { $item = &$this->getItem(); $return['option'] = JRequest::getCmd('expand'); $menutype = JRequest::getString('menutype'); if ($return['option']) { require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_menus'.DS.'classes'.DS.'ilink.php'); $handler = new iLink($return['option'], $item->id, $menutype); $return['html'] = $handler->getTree(); return $return; } else { $return['html'] = null; } return $return; } function &getUrlParams() { // Get the state parameters $item =& $this->getItem(); $params = new JParameter(''); if ($state =& $this->_getStateXML()) { if (is_a($state, 'JSimpleXMLElement')) { $sp =& $state->getElementByPath('url'); $params->setXML($sp); if (isset($item->linkparts) && is_array($item->linkparts)) { $params->loadArray($item->linkparts); } } } return $params; } function &getStateParams() { // Get the state parameters $item =& $this->getItem(); $params = new JParameter($item->params); if ($state =& $this->_getStateXML()) { if (is_a($state, 'JSimpleXMLElement')) { $sp =& $state->getElementByPath('params'); $params->setXML($sp); } } return $params; } function &getAdvancedParams() { // Get the state parameters $item =& $this->getItem(); $params = new JParameter($item->params); if ($state =& $this->_getStateXML()) { if (is_a($state, 'JSimpleXMLElement')) { $ap =& $state->getElementByPath('advanced'); $params->setXML($ap); } } return $params; } function &getComponentParams() { // Initialize variables $params = null; $item = &$this->getItem(); if ($item->type == 'component') { $comp = &$this->getComponent(); $option = preg_replace( '#\W#', '', $comp->option ); $path = JPATH_ADMINISTRATOR.DS.'components'.DS.$option.DS.'config.xml'; $params = new JParameter( $item->params ); if (file_exists( $path )) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($path)) { $document =& $xml->document; // if hide is set, don't show the component configuration while editing menu item $menu = $document->attributes('menu'); if ( isset($menu) && $menu == 'hide' ) { $params = null; return $params; } if (isset($document->params[0]->param)) { // We will collect the hidden elements in an array // loop will mess up if we do it within the loop $hide = array(); for ($i=0,$n=count($document->params[0]->param); $i<$n; $i++) { if ($document->params[0]->param[$i]->attributes('menu') == 'hide') { $hide[] = &$document->params[0]->param[$i]; } else if ($document->params[0]->param[$i]->attributes('type') == 'radio' || $document->params[0]->param[$i]->attributes('type') == 'list') { $document->params[0]->param[$i]->addAttribute('default', ''); $document->params[0]->param[$i]->addAttribute('type', 'list'); $child = &$document->params[0]->param[$i]->addChild('option', array('value' => '')); $child->setData('Use Global'); } } // Now remove any hidden elements for ($i = 0, $n = count( $hide ); $i < $n; $i++) { $document->params[0]->removeChild( $hide[$i] ); } } $params->setXML( $document->params[0] ); } } } return $params; } function &getSystemParams() { // Initialize variables $params = null; $item = &$this->getItem(); $params = new JParameter( $item->params ); if ($item->type == 'component') { $path = JPATH_BASE.DS.'components'.DS.'com_menus'.DS.'models'.DS.'metadata'.DS.'component.xml'; if (file_exists( $path )) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($path)) { $document =& $xml->document; $params->setXML($document->getElementByPath('state/params')); } } } return $params; } /** * Get the name of the current menu item * * @return string * @access public * @since 1.5 */ function getStateName() { $state =& $this->_getStateXML(); if ( ! is_a($state, 'JSimpleXMLElement')) { return null; } $name = null; $sn =& $state->getElementByPath('name'); if ($sn) { $name = $sn->data(); } return JText::_($name); } /** * Get the description of the current menu item * * @return string * @access public * @since 1.5 */ function getStateDescription() { $state =& $this->_getStateXML(); if ( ! is_a($state, 'JSimpleXMLElement')) { return null; } $description = null; $sd =& $state->getElementByPath('description'); if ($sd) { $description = $sd->data(); } return JText::_($description); } /** * Gets the componet table object related to this menu item */ function &getComponent() { $item =& $this->getItem(); $id = $item->componentid; $component = & JTable::getInstance( 'component'); $component->load( $id ); return $component; } function checkout($uid = null) { $id = JRequest::getVar('cid', array(0), '', 'array'); JArrayHelper::toInteger( $id, array(0) ); // Make sure we have a user id to checkout the article with if (is_null($uid)) { $user =& JFactory::getUser(); $uid = $user->get('id'); } // Lets get to it and checkout the thing... $item =& $this->getItem(); if(!$item->checkout($uid, $id[0])) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } function checkin() { if ($this->_id) { $item =& $this->_getTable(); if(!$item->checkin($this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } return false; } function store() { // Initialize variables $db =& JFactory::getDBO(); $row =& $this->getItem(); $post = $this->_state->get( 'request' ); switch ($post['type']) { case 'separator': break; case 'url': break; case 'menulink': $post['link'] = 'index.php?Itemid='.$post['params']['menu_item']; break; case 'component': break; } if (!$row->bind( $post )) { echo "\n"; return false; } if ($row->id > 0) { // existing item $query = 'SELECT menutype FROM #__menu WHERE id = '.(int) $row->id; $this->_db->setQuery( $query ); $oldType = $this->_db->loadResult(); if ($oldType != $row->menutype) { // moved to another menu, disconnect the old parent $row->parent = 0; } $query = 'SELECT parent FROM #__menu WHERE id = '.(int) $row->id; $this->_db->setQuery( $query ); $oldParent = $this->_db->loadResult(); if ($oldParent != $row->parent) { // we have changed parents, so we have to fix the submenu values if ($row->parent != 0) { $query = 'SELECT sublevel FROM #__menu WHERE id = '.(int) $row->parent; $this->_db->setQuery( $query ); $sublevel = $this->_db->loadResult() + 1; } else { $sublevel = 0; } $row->sublevel = $sublevel; $this->_setSubLevel( array( (int) $row->id ), $sublevel ); } } else { // if new item order last in appropriate group $where = "menutype = " . $db->Quote($row->menutype) . " AND published >= 0 AND parent = ".(int) $row->parent; $row->ordering = $row->getNextOrder( $where ); if( $row->parent != 0 ) { $query = 'SELECT sublevel FROM #__menu WHERE id = '. (int) $row->parent; $this->_db->setQuery($query); $row->sublevel = $this->_db->loadResult() + 1; } } if (isset($post['urlparams']) && is_array($post['urlparams'])) { $pos = strpos( $row->link, '?' ); if ($pos !== false) { $prefix = substr( $row->link, 0, $pos ); $query = substr( $row->link, $pos+1 ); $temp = array(); if(strpos($query, '&') !== false) { $query = str_replace('&', '&', $query); } parse_str( $query, $temp ); $temp2 = array_merge( $temp, $post['urlparams'] ); $temp3 = array(); foreach ($temp2 as $k => $v) { if ( $k && strlen($v) ) { $temp3[] = $k.'='.$v; } } $url = null; $row->link = $prefix . '?' . implode( '&', $temp3 ); } } if (!$row->check()) { echo "\n"; return false; } if (!$row->store()) { echo "\n"; return false; } $row->checkin(); $row->reorder( 'menutype='.$db->Quote( $row->menutype ).' AND parent='.(int)$row->parent ); // clean cache MenusHelper::cleanCache(); return true; } /** * Delete one or more menu items * @param mixed int or array of id values */ function delete( $ids ) { JArrayHelper::toInteger($ids); $db = &$this->getDBO(); if (count( $ids )) { // Delete associated module and template mappings $where = 'WHERE menuid = ' . implode( ' OR menuid = ', $ids ); $query = 'DELETE FROM #__modules_menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } $query = 'DELETE FROM #__templates_menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } // Set any alias menu types to not point to missing menu items $query = 'UPDATE #__menu SET link = 0 WHERE type = \'menulink\' AND (link = '.implode( ' OR id = ', $ids ).')'; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } // Delete the menu items $where = 'WHERE id = ' . implode( ' OR id = ', $ids ); $query = 'DELETE FROM #__menu ' . $where; $db->setQuery( $query ); if (!$db->query()) { $this->setError( $db->getErrorMsg() ); return false; } } // clean cache MenusHelper::cleanCache(); return true; } /** * Delete menu items by type */ function deleteByType( $type = '' ) { $db = &$this->getDBO(); $query = 'SELECT id' . ' FROM #__menu' . ' WHERE menutype = ' . $db->Quote( $type ); $db->setQuery( $query ); $ids = $db->loadResultArray(); if ($db->getErrorNum()) { $this->setError( $db->getErrorMsg() ); return false; } return $this->delete( $ids ); } /** * Returns the internal table object * @return JTable */ function &_getTable() { if ($this->_table == null) { $this->_table =& JTable::getInstance( 'menu'); } return $this->_table; } function &_getStateXML() { static $xml; if (isset($xml)) { return $xml; } $xml = null; $xmlpath = null; $item = &$this->getItem(); switch ($item->type) { case 'separator': $xmlpath = JPATH_BASE.DS.'components'.DS.'com_menus'.DS.'models'.DS.'metadata'.DS.'separator.xml'; break; case 'url': $xmlpath = JPATH_BASE.DS.'components'.DS.'com_menus'.DS.'models'.DS.'metadata'.DS.'url.xml'; break; case 'menulink': $xmlpath = JPATH_BASE.DS.'components'.DS.'com_menus'.DS.'models'.DS.'metadata'.DS.'menulink.xml'; break; case 'component': default: if (isset($item->linkparts['view'])) { // View is set... so we konw to look in view file if (isset($item->linkparts['layout'])) { $layout = $item->linkparts['layout']; } else { $layout = 'default'; } $lpath = JPATH_ROOT.DS.'components'.DS.$item->linkparts['option'].DS.'views'.DS.$item->linkparts['view'].DS.'tmpl'.DS.$layout.'.xml'; $vpath = JPATH_ROOT.DS.'components'.DS.$item->linkparts['option'].DS.'views'.DS.$item->linkparts['view'].DS.'metadata.xml'; if (file_exists($lpath)) { $xmlpath = $lpath; } elseif (file_exists($vpath)) { $xmlpath = $vpath; } } if (!$xmlpath && isset($item->linkparts['option'])) { $xmlpath = JPATH_ROOT.DS.'components'.DS.$item->linkparts['option'].DS.'metadata.xml'; if(!file_exists($xmlpath)) { $xmlpath = JApplicationHelper::getPath('com_xml', $item->linkparts['option']); } } break; } if (file_exists($xmlpath)) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($xmlpath)) { $this->_xml = &$xml; $document =& $xml->document; /* * HANDLE NO OPTION CASE */ $menus =& $document->getElementByPath('menu'); if (is_a($menus, 'JSimpleXMLElement') && $menus->attributes('options') == 'none') { $xml =& $menus->getElementByPath('state'); } else { $xml =& $document->getElementByPath('state'); } // Handle error case... path doesn't exist if (!is_a($xml, 'JSimpleXMLElement')) { return $document; } /* * HANDLE A SWITCH IF IT EXISTS */ if ($switch = $xml->attributes('switch')) { $default = $xml->attributes('default'); // Handle switch $switchVal = (isset($item->linkparts[$switch]))? $item->linkparts[$switch] : 'default'; $found = false; foreach ($xml->children() as $child) { if ($child->name() == $switchVal) { $xml =& $child; $found = true; break; } } if (!$found) { foreach ($xml->children() as $child) { if ($child->name() == $default) { $xml =& $child; break; } } } } /* * HANDLE INCLUDED PARAMS */ $children = $xml->children(); if (count($children) == 1) { if ($children[0]->name() == 'include') { $ret =& $this->_getIncludedParams($children[0]); if ($ret) { $xml =& $ret; } } } if ($switch = $xml->attributes('switch')) { $default = $xml->attributes('default'); // Handle switch $switchVal = ($item->linkparts[$switch])? $item->linkparts[$switch] : 'default'; $found = false; foreach ($xml->children() as $child) { if ($child->name() == $switchVal) { $xml =& $child; $found = true; break; } } if (!$found) { foreach ($xml->children() as $child) { if ($child->name() == $default) { $xml =& $child; break; } } } } } } return $xml; } function &_getIncludedParams($include) { $tags = array(); $state = null; $source = $include->attributes('source'); $path = $include->attributes('path'); $item = &$this->getItem(); preg_match_all( "/{([A-Za-z\-_]+)}/", $source, $tags); if (isset($tags[1])) { for ($i=0;$ilinkparts[$tags[1][$i]], $source); } } // load the source xml file if (file_exists( JPATH_ROOT.$source )) { $xml = & JFactory::getXMLParser('Simple'); if ($xml->loadFile(JPATH_ROOT.$source)) { $document = &$xml->document; $state = $document->getElementByPath($path); } } return $state; } /** * Sets the sublevel for menu items * * @param array id values to set * @param int level to assign to the sublevel */ function _setSubLevel( $cid, $level ) { JArrayHelper::toInteger($cid, array(0)); $ids = implode( ',', $cid ); $query = 'UPDATE #__menu SET sublevel = '.(int) $level .' WHERE id IN ('.$ids.')'; $this->_db->setQuery( $query ); $this->_db->query(); $query = 'SELECT id FROM #__menu WHERE parent IN ('.$ids.')'; $this->_db->setQuery( $query ); $cids = $this->_db->loadResultArray( 0 ); if (!empty( $cids )) { $this->_setSubLevel( $cids, $level + 1 ); } } } joomla/joomla/administrator/components/com_menus/models/index.html0000766000000000000000000000005411234314100027006 0ustar adminadministratorsjoomla/joomla/administrator/components/com_menus/models/menutype.php0000766000000000000000000001625411234314100027401 0ustar adminadministrators_table == null) { $this->_table = & JTable::getInstance('menuTypes'); if ($id = JRequest::getVar('id', false, '', 'int')) { $this->_table->load($id); } } return $this->_table; } /** * Get a list of the menu records associated with the type * * @param string The menu type * @return array An array of records as objects */ function getMenus() { global $mainframe; $menus= array(); $db = &$this->getDBO(); // Preselect some aggregate data // Query to get published menu item counts $query = 'SELECT a.menutype, COUNT( a.menutype ) AS num' . ' FROM #__menu AS a' . ' WHERE a.published = 1' . ' GROUP BY a.menutype'; $db->setQuery( $query ); $published = $db->loadObjectList( 'menutype' ); // Query to get unpublished menu item counts $query = 'SELECT a.menutype, COUNT( a.menutype ) AS num' . ' FROM #__menu AS a' . ' WHERE a.published = 0' . ' GROUP BY a.menutype'; $db->setQuery( $query ); $unpublished = $db->loadObjectList( 'menutype' ); // Query to get trash menu item counts $query = 'SELECT a.menutype, COUNT( a.menutype ) AS num' . ' FROM #__menu AS a' . ' WHERE a.published = -2' . ' GROUP BY a.menutype'; $db->setQuery( $query ); $trash = $db->loadObjectList( 'menutype' ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( 'com_menus.limitstart', 'limitstart', 0, 'int' ); $query = 'SELECT a.*, SUM(b.home) AS home' . ' FROM #__menu_types AS a' . ' LEFT JOIN #__menu AS b ON b.menutype = a.menutype' . ' GROUP BY a.id'; $db->setQuery( $query, $limitstart, $limit ); $menuTypes = $db->loadObjectList(); $total = count( $menuTypes ); $i = 0; for ($i = 0; $i < $total; $i++) { $row = &$menuTypes[$i]; // query to get number of modules for menutype $query = 'SELECT count( id )' . ' FROM #__modules' . ' WHERE module = "mod_mainmenu"' . ' AND params LIKE '.$db->Quote('%menutype='.$row->menutype.'%'); $db->setQuery( $query ); $modules = $db->loadResult(); if ( !$modules ) { $modules = '-'; } $row->modules = $modules; $row->published = @$published[$row->menutype]->num ? $published[$row->menutype]->num : '-' ; $row->unpublished = @$unpublished[$row->menutype]->num ? $unpublished[$row->menutype]->num : '-'; $row->trash = @$trash[$row->menutype]->num ? $trash[$row->menutype]->num : '-'; $menus[] = $row; } return $menus; } /** * Get a list of the menu records associated with the type * * @param string The menu type * @return array An array of records as objects */ function getPagination() { global $mainframe; $menutypes = MenusHelper::getMenuTypeList(); $total = count( $menutypes ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( 'com_menus.limitstart', 'limitstart', 0, 'int' ); jimport('joomla.html.pagination'); $pagination = new JPagination( $total, $limitstart, $limit ); return $pagination; } /** * Get a list of the menu records associated with the type * @param string The menu type * @return array An array of records as objects */ function getMenuItems() { $table = & $this->getTable(); if ($table->menutype == '') { $table->menutype = JRequest::getString('menutype'); } $db = &$this->getDBO(); $query = 'SELECT a.name, a.id' . ' FROM #__menu AS a' . ' WHERE a.menutype = ' . $db->Quote( $table->menutype ) . ' ORDER BY a.name'; $db->setQuery( $query ); $result = $db->loadObjectList(); return $result; } /** * Get a list of the menu records associated with the type * @param string The menu type * @return array An array of records as objects */ function getModules( $type='' ) { if ($type == '') { $type = $this->_table->menutype; } $db = &$this->getDBO(); $query = 'SELECT id, title, params' . ' FROM #__modules' . ' WHERE module = "mod_mainmenu"' . ' AND params LIKE ' . $db->Quote( '%menutype=' . $type . '%' ); $db->setQuery( $query ); $temp = $db->loadObjectList(); $result = array(); $n = count( $temp ); for ($i = 0; $i < $n; $i++) { $params = new JParameter( $temp[$i]->params ); if ($params->get( 'menutype' ) == $type) { $result[] = $temp[$i]; } } return $result; } /** * Checks if the menu can be deleted * @param string The menu type * @return boolean */ function canDelete( $type='' ) { if ($type == '') { $type = $this->_table->menutype; } if ($type == 'mainmenu') { $this->setError( JText::_( 'WARNDELMAINMENU' ) ); return false; } return true; } /** * Deletes menu type and associations * @param string The id of the menu type * @return boolean */ function delete( $id = 0 ) { $table = &$this->getTable(); if ($id != 0) { $table->load( $id ); } $db = &$this->getDBO(); // Delete Associations if (!$this->deleteByType( $table->menutype )) { $this->setError( $this->getError() ); return false; } // TODO: Should invoke JModuleModel::delete to delete the actual module $moduleTable= &JTable::getInstance( 'module'); $items = &$this->getModules( $table->menutype ); $modulesIds = array(); foreach ($items as $item) { if (!$moduleTable->delete( $item->id )) { $this->setError( $moduleTable->getErrorMsg() ); return false; } $modulesIds[] = (int) $item->id; } if (count( $modulesIds )) { $query = 'DELETE FROM #__modules_menu' . ' WHERE menuid = '.implode( ' OR moduleid = ', $modulesIds ); $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } } $result = $table->delete(); return $result; } /** * Delete menu items by type */ function deleteByType( $type = '' ) { if (!$type) { return false; } $db = &$this->getDBO(); $query = 'DELETE FROM #__menu' . ' WHERE menutype = '.$db->Quote( $type ); $db->setQuery( $query ); if (!$db->query()) { $this->setError( $menuTable->getErrorMsg() ); return false; } // clean cache MenusHelper::cleanCache(); return true; } } joomla/joomla/administrator/components/com_menus/admin.menus.php0000766000000000000000000000167311234314076026501 0ustar adminadministrators 'viewMenus') ); $controller->registerTask('apply', 'save'); $controller->execute( JRequest::getCmd( 'task' ) ); $controller->redirect();joomla/joomla/administrator/components/com_contact/0000777000000000000000000000000011266551177024060 5ustar adminadministratorsjoomla/joomla/administrator/components/com_contact/toolbar.contact.html.php0000766000000000000000000000351211234314112030607 0ustar adminadministrators[ '. $text .' ]', 'generic.png' ); //JToolBarHelper::custom( 'save2new', 'new.png', 'new_f2.png', 'Save & New', false, false ); //JToolBarHelper::custom( 'save2copy', 'copy.png', 'copy_f2.png', 'Save To Copy', false, false ); JToolBarHelper::save(); JToolBarHelper::apply(); if ( $edit ) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.contactmanager.edit' ); } function _DEFAULT() { JToolBarHelper::title( JText::_( 'Contact Manager' ), 'generic.png' ); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::preferences('com_contact', '500'); JToolBarHelper::help( 'screen.contactmanager' ); } }joomla/joomla/administrator/components/com_contact/contact_items.xml0000766000000000000000000001312311234314112027414 0ustar adminadministrators Contact Items Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 Parameters for individual Contact Items joomla/joomla/administrator/components/com_contact/elements/0000777000000000000000000000000011266551177025674 5ustar adminadministratorsjoomla/joomla/administrator/components/com_contact/elements/index.html0000766000000000000000000000005411234314112027646 0ustar adminadministratorsjoomla/joomla/administrator/components/com_contact/elements/contact.php0000766000000000000000000000251211234314112030016 0ustar adminadministratorssetQuery( $query ); $options = $db->loadObjectList( ); return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'text', $value, $control_name.$name ); } } joomla/joomla/administrator/components/com_contact/toolbar.contact.php0000766000000000000000000000160411234314112027644 0ustar adminadministratorsproperties["N"] = "$family;$first;$additional;$prefix;$suffix"; $this->setFormattedName( trim( "$prefix $first $additional $family $suffix" ) ); } // needed to fix bug in vcard class function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' ) { // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" $separator = ';'; $key = 'ADR'; if ( $type != '' ) { $key .= $separator . $type; } $key.= ';ENCODING=QUOTED-PRINTABLE'; $return = encode( $postoffice ); $return .= $separator . encode( $extended ); $return .= $separator . encode( $street ); $return .= $separator . encode( $city ); $return .= $separator . encode( $region); $return .= $separator . encode( $zip ); $return .= $separator . encode( $country ); $this->properties[$key] = $return; } // added ability to set filename function setFilename( $filename ) { $this->filename = $filename .'.vcf'; } // added ability to set position/title function setTitle( $title ) { $title = trim( $title ); $this->properties['TITLE'] = $title; } // added ability to set organisation/company function setOrg( $org ) { $org = trim( $org ); $this->properties['ORG'] = $org; } function getVCard( $sitename ) { $text = 'BEGIN:VCARD'; $text .= "\r\n"; $text .= 'VERSION:2.1'; $text .= "\r\n"; foreach( $this->properties as $key => $value ) { $text .= "$key:$value"; $text .= "\r\n"; } $text .= 'REV:'. date( 'Y-m-d' ) .'T'. date( 'H:i:s' ). 'Z'; $text .= "\r\n"; $text .= 'MAILER: Joomla! vCard for '. $sitename; $text .= "\r\n"; $text .= 'END:VCARD'; $text .= "\r\n"; return $text; } }joomla/joomla/administrator/components/com_contact/helpers/index.html0000766000000000000000000000005411234314112027474 0ustar adminadministratorsjoomla/joomla/administrator/components/com_contact/admin.contact.html.php0000766000000000000000000003442411234314112030243 0ustar adminadministrators
    :
    id ); $checked = JHTML::_('grid.checkedout', $row, $i ); $access = JHTML::_('grid.access', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); $row->cat_link = JRoute::_( 'index.php?option=com_categories§ion=com_contact_details&task=edit&type=other&cid[]='. $row->catid ); $row->user_link = JRoute::_( 'index.php?option=com_users&task=editA&cid[]='. $row->user_id ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out )) : echo $row->name; else : ?> name; ?> orderUpIcon( $i, ( $row->catid == @$rows[$i-1]->catid ), 'orderup', 'Move Up', $ordering ); ?> orderDownIcon( $i, $n, ( $row->catid == @$rows[$i+1]->catid ), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> category; ?> user; ?> id; ?>
    image == '') { $row->image = 'blank.png'; } JHTML::_('behavior.tooltip'); jimport('joomla.html.pane'); // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $pane = &JPane::getInstance('sliders', array('allowAllClose' => true)); JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'misc' ); $cparams = JComponentHelper::getParams ('com_media'); ?>
    id) { ?>
    :
    id;?>
    startPane("menu-pane"); echo $pane->startPanel(JText :: _('Contact Parameters'), "param-page"); echo $params->render(); echo $pane->endPanel(); echo $pane->startPanel(JText :: _('Advanced Parameters'), "param-page"); echo $params->render('params', 'advanced'); echo $pane->endPanel(); echo $pane->startPanel(JText :: _('E-mail Parameters'), "param-page"); echo $params->render('params', 'email'); echo $pane->endPanel(); echo $pane->endPane(); ?>
    joomla/joomla/administrator/components/com_contact/tables/contact.php0000766000000000000000000000571711234314112027466 0ustar adminadministratorsdefault_con = intval( $this->default_con ); if (JFilterInput::checkAttribute(array ('href', $this->webpage))) { $this->setError(JText::_('Please provide a valid URL')); return false; } // check for http on webpage if (strlen($this->webpage) > 0 && (!(eregi('http://', $this->webpage) || (eregi('https://', $this->webpage)) || (eregi('ftp://', $this->webpage))))) { $this->webpage = 'http://'.$this->webpage; } if(empty($this->alias)) { $this->alias = $this->name; } $this->alias = JFilterOutput::stringURLSafe($this->alias); if(trim(str_replace('-','',$this->alias)) == '') { $datenow =& JFactory::getDate(); $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S"); } return true; } } joomla/joomla/administrator/components/com_contact/index.html0000766000000000000000000000005411234314112026032 0ustar adminadministratorsjoomla/joomla/administrator/components/com_contact/admin.contact.php0000766000000000000000000003201011234314112027265 0ustar adminadministratorsauthorize( 'com_contact', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } require_once( JApplicationHelper::getPath( 'admin_html' ) ); // Set the table directory JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_contact'.DS.'tables'); $task = JRequest::getCmd('task'); $id = JRequest::getVar('id', 0, 'get', 'int'); $cid = JRequest::getVar('cid', array(0), 'post', 'array'); JArrayHelper::toInteger($cid, array(0)); switch ($task) { case 'add' : editContact(false ); break; case 'edit': editContact(true); break; case 'apply': case 'save': case 'save2new': case 'save2copy': saveContact( $task ); break; case 'remove': removeContacts( $cid ); break; case 'publish': changeContact( $cid, 1 ); break; case 'unpublish': changeContact( $cid, 0 ); break; case 'orderup': orderContacts( $cid[0], -1 ); break; case 'orderdown': orderContacts( $cid[0], 1 ); break; case 'accesspublic': changeAccess( $cid[0], 0 ); break; case 'accessregistered': changeAccess( $cid[0], 1 ); break; case 'accessspecial': changeAccess( $cid[0], 2 ); break; case 'saveorder': saveOrder( $cid ); break; case 'cancel': cancelContact(); break; default: showContacts( $option ); break; } /** * List the records * @param string The current GET/POST option */ function showContacts( $option ) { global $mainframe; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'cd.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $option.'filter_state', 'filter_state', '', 'word' ); $filter_catid = $mainframe->getUserStateFromRequest( $option.'filter_catid', 'filter_catid', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option.'.limitstart', 'limitstart', 0, 'int'); $where = array(); if ( $search ) { $where[] = 'cd.name LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } if ( $filter_catid ) { $where[] = 'cd.catid = '.(int) $filter_catid; } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'cd.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'cd.published = 0'; } } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); if ($filter_order == 'cd.ordering'){ $orderby = ' ORDER BY category, cd.ordering'; } else { $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', category, cd.ordering'; } // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__contact_details AS cd' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); // get the subset (based on limits) of required records $query = 'SELECT cd.*, cc.title AS category, u.name AS user, v.name as editor, g.name AS groupname' . ' FROM #__contact_details AS cd' . ' LEFT JOIN #__groups AS g ON g.id = cd.access' . ' LEFT JOIN #__categories AS cc ON cc.id = cd.catid' . ' LEFT JOIN #__users AS u ON u.id = cd.user_id' . ' LEFT JOIN #__users AS v ON v.id = cd.checked_out' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); // build list of categories $javascript = 'onchange="document.adminForm.submit();"'; $lists['catid'] = JHTML::_('list.category', 'filter_catid', 'com_contact_details', intval( $filter_catid ), $javascript ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; HTML_contact::showcontacts( $rows, $pageNav, $option, $lists ); } /** * Creates a new or edits and existing user record * @param int The id of the record, 0 if a new entry * @param string The current GET/POST option */ function editContact($edit ) { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $cid = JRequest::getVar('cid', array(0), '', 'array'); $option = JRequest::getCmd('option'); JArrayHelper::toInteger($cid, array(0)); $row =& JTable::getInstance('contact', 'Table'); // load the row from the db table if($edit) $row->load( $cid[0] ); if ($edit) { // do stuff for existing records $row->checkout($user->get('id')); } else { // do stuff for new records $row->imagepos = 'top'; $row->ordering = 0; $row->published = 1; } $lists = array(); // build the html select list for ordering $query = 'SELECT ordering AS value, name AS text' . ' FROM #__contact_details' . ' WHERE published >= 0' . ' AND catid = '.(int) $row->catid . ' ORDER BY ordering' ; if($edit) $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query ); else $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query ); // build list of users $lists['user_id'] = JHTML::_('list.users', 'user_id', $row->user_id, 1, NULL, 'name', 0 ); // build list of categories $lists['catid'] = JHTML::_('list.category', 'catid', 'com_contact_details', intval( $row->catid ) ); // build the html select list for images $lists['image'] = JHTML::_('list.images', 'image', $row->image ); // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row ); // build the html radio buttons for published $lists['published'] = JHTML::_('select.booleanlist', 'published', '', $row->published ); // build the html radio buttons for default $lists['default_con'] = JHTML::_('select.booleanlist', 'default_con', '', $row->default_con ); // get params definitions $file = JPATH_ADMINISTRATOR .'/components/com_contact/contact_items.xml'; $params = new JParameter( $row->params, $file, 'component' ); HTML_contact::editcontact( $row, $lists, $option, $params ); } /** * Saves the record from an edit form submit * @param string The current GET/POST option */ function saveContact( $task ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('contact', 'Table'); $post = JRequest::get( 'post' ); $post['misc'] = JRequest::getVar('misc', '', 'POST', 'string', JREQUEST_ALLOWHTML); if (!$row->bind( $post )) { JError::raiseError(500, $row->getError() ); } // save params $params = JRequest::getVar( 'params', array(), 'post', 'array' ); if (is_array( $params )) { $txt = array(); foreach ( $params as $k=>$v) { $txt[] = "$k=$v"; } $row->params = implode( "\n", $txt ); } // save to a copy, reset the primary key if ($task == 'save2copy') { $row->id = 0; } // pre-save checks if (!$row->check()) { JError::raiseError(500, $row->getError() ); } // if new item, order last in appropriate group if (!$row->id) { $where = "catid = " . (int) $row->catid; $row->ordering = $row->getNextOrder( $where ); } // save the changes if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); if ($row->default_con) { $query = 'UPDATE #__contact_details' . ' SET default_con = 0' . ' WHERE id <> '. (int) $row->id . ' AND default_con = 1' ; $db->setQuery( $query ); $db->query(); } switch ($task) { case 'apply': case 'save2copy': $msg = JText::sprintf( 'Changes to X saved', JText::_('Contact') ); $link = 'index.php?option=com_contact&task=edit&cid[]='. $row->id .''; break; case 'save2new': $msg = JText::sprintf( 'Changes to X saved', JText::_('Contact') ); $link = 'index.php?option=com_contact&task=edit'; break; case 'save': default: $msg = JText::_( 'Contact saved' ); $link = 'index.php?option=com_contact'; break; } $mainframe->redirect( $link, $msg ); } /** * Removes records * @param array An array of id keys to remove * @param string The current GET/POST option */ function removeContacts( &$cid ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); JArrayHelper::toInteger($cid); if (count( $cid )) { $cids = implode( ',', $cid ); $query = 'DELETE FROM #__contact_details' . ' WHERE id IN ( '. $cids .' )' ; $db->setQuery( $query ); if (!$db->query()) { echo "\n"; } } $mainframe->redirect( "index.php?option=com_contact" ); } /** * Changes the state of one or more content pages * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing * @param string The current option */ function changeContact( $cid=null, $state=0 ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { $action = $state ? 'publish' : 'unpublish'; JError::raiseError(500, JText::_( 'Select an item to' .$action, true ) ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__contact_details' . ' SET published = ' . (int) $state . ' WHERE id IN ( '. $cids .' )' . ' AND ( checked_out = 0 OR ( checked_out = '. (int) $user->get('id') .' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('contact', 'Table'); $row->checkin( intval( $cid[0] ) ); } $mainframe->redirect( 'index.php?option=com_contact' ); } /** JJC * Moves the order of a record * @param integer The increment to reorder by */ function orderContacts( $uid, $inc ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('contact', 'Table'); $row->load( $uid ); $row->move( $inc, 'catid = '. (int) $row->catid .' AND published != 0' ); $mainframe->redirect( 'index.php?option=com_contact' ); } /** PT * Cancels editing and checks in the record */ function cancelContact() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('contact', 'Table'); $row->bind( JRequest::get( 'post' )); $row->checkin(); $mainframe->redirect('index.php?option=com_contact'); } /** * changes the access level of a record * @param integer The increment to reorder by */ function changeAccess( $id, $access ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $row =& JTable::getInstance('contact', 'Table'); $row->load( $id ); $row->access = $access; if ( !$row->check() ) { return $row->getError(); } if ( !$row->store() ) { return $row->getError(); } $mainframe->redirect( 'index.php?option=com_contact' ); } function saveOrder( &$cid ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize variables $db =& JFactory::getDBO(); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order, array(0)); $row =& JTable::getInstance('contact', 'Table'); $groupings = array(); // update ordering values for( $i=0; $i < $total; $i++ ) { $row->load( (int) $cid[$i] ); // track categories $groupings[] = $row->catid; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError(500, $db->getErrorMsg() ); } } } // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('catid = '.(int) $group); } $msg = 'New ordering saved'; $mainframe->redirect( 'index.php?option=com_contact', $msg ); } joomla/joomla/administrator/components/com_contact/config.xml0000766000000000000000000000731011234314112026026 0ustar adminadministrators joomla/joomla/administrator/components/com_contact/contact.xml0000766000000000000000000000105311234314112026212 0ustar adminadministrators Contact Joomla! Project Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. April 2006 http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component shows a listing of Contact Information joomla/joomla/administrator/components/com_frontpage/0000777000000000000000000000000011266551167024411 5ustar adminadministratorsjoomla/joomla/administrator/components/com_frontpage/admin.frontpage.php0000766000000000000000000002517611234314074030177 0ustar adminadministratorsauthorize( 'com_frontpage', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Set the table directory JTable::addIncludePath(JPATH_COMPONENT.DS.DS.'tables'); // Set the helper directory JHTML::addIncludePath( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_content'.DS.'helper' ); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); JArrayHelper::toInteger($cid, array(0)); switch ( JRequest::getCmd( 'task' ) ) { case 'publish': changeFrontPage( $cid, 1, $option ); break; case 'unpublish': changeFrontPage( $cid, 0, $option ); break; case 'archive': changeFrontPage( $cid, -1, $option ); break; case 'remove': removeFrontPage( $cid, $option ); break; case 'orderup': orderFrontPage( $cid[0], -1, $option ); break; case 'orderdown': orderFrontPage( $cid[0], 1, $option ); break; case 'saveorder': saveOrder( $cid ); break; case 'accesspublic': accessMenu( $cid[0], 0 ); break; case 'accessregistered': accessMenu( $cid[0], 1 ); break; case 'accessspecial': accessMenu( $cid[0], 2 ); break; default: viewFrontPage( $option ); break; } /** * Compiles a list of frontpage items */ function viewFrontPage( $option ) { global $mainframe; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( $option.'.filter_order', 'filter_order', 'fpordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $option.'.filter_state', 'filter_state', '', 'word' ); $catid = $mainframe->getUserStateFromRequest( $option.'.catid', 'catid', 0, 'int' ); $filter_authorid = $mainframe->getUserStateFromRequest( $option.'.filter_authorid', 'filter_authorid', 0, 'int' ); $filter_sectionid = $mainframe->getUserStateFromRequest( $option.'.filter_sectionid', 'filter_sectionid', -1, 'int' ); $search = $mainframe->getUserStateFromRequest( $option.'.search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); JToolBarHelper::title( JText::_( 'Frontpage Manager' ), 'frontpage.png' ); JToolBarHelper::archiveList(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::custom('remove','delete.png','delete_f2.png','Remove', true); JToolBarHelper::help( 'screen.frontpage' ); $where = array( "c.state >= 0" ); // used by filter if ( $filter_sectionid >= 0 ) { $where[] = 'c.sectionid = '.(int) $filter_sectionid; } if ( $catid > 0 ) { $where[] = 'c.catid = '.(int) $catid; } if ( $filter_authorid > 0 ) { $where[] = 'c.created_by = '. (int) $filter_authorid; } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'c.state = 1'; } else if ($filter_state == 'U' ) { $where[] = 'c.state = 0'; } } if ($search) { $where[] = 'LOWER( c.title ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', fpordering'; // get the total number of records $query = 'SELECT count(*)' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope="content"' . ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT c.*, g.name AS groupname, cc.title as name, s.title AS sect_name, u.name AS editor, f.ordering AS fpordering, v.name AS author' . ' FROM #__content AS c' . ' LEFT JOIN #__categories AS cc ON cc.id = c.catid' . ' LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope="content"' . ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id' . ' INNER JOIN #__groups AS g ON g.id = c.access' . ' LEFT JOIN #__users AS u ON u.id = c.checked_out' . ' LEFT JOIN #__users AS v ON v.id = c.created_by' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart,$pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // get list of categories for dropdown filter $query = 'SELECT cc.id AS value, cc.title AS text, section' . ' FROM #__categories AS cc' . ' INNER JOIN #__sections AS s ON s.id = cc.section ' . ' ORDER BY s.ordering, cc.ordering' ; $db->setQuery( $query ); $categories[] = JHTML::_('select.option', '-1', '- '. JText::_( 'Select Category' ) .' -' ); $categories = array_merge( $categories, $db->loadObjectList() ); $lists['catid'] = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $catid ); // get list of sections for dropdown filter $javascript = 'onchange="document.adminForm.submit();"'; $lists['sectionid'] = JHTML::_('list.section', 'filter_sectionid', $filter_sectionid, $javascript ); // get list of Authors for dropdown filter $query = 'SELECT c.created_by, u.name' . ' FROM #__content AS c' . ' INNER JOIN #__sections AS s ON s.id = c.sectionid' . ' LEFT JOIN #__users AS u ON u.id = c.created_by' . ' WHERE c.state <> -1' . ' AND c.state <> -2' . ' GROUP BY u.name' . ' ORDER BY u.name' ; $db->setQuery( $query ); $authors[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Author' ) .' -', 'created_by', 'name' ); $authors = array_merge( $authors, $db->loadObjectList() ); $lists['authorid'] = JHTML::_('select.genericlist', $authors, 'filter_authorid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'created_by', 'name', $filter_authorid ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; require_once(JPATH_COMPONENT.DS.'views'.DS.'frontpage.php'); FrontpageView::showList( $rows, $pageNav, $option, $lists ); } /** * Changes the state of one or more content pages * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing */ function changeFrontPage( $cid=null, $state=0, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { $action = $state == 1 ? 'publish' : ($state == -1 ? 'archive' : 'unpublish'); JError::raiseError(500, JText::_( 'Select an item to' .$action, true ) ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__content' . ' SET state = '.(int) $state . ' WHERE id IN ( '. $cids .' )' . ' AND ( checked_out = 0 OR ( checked_out = ' .(int) $user->get('id'). ' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('content'); $row->checkin( $cid[0] ); } $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect( 'index.php?option='.$option ); } function removeFrontPage( &$cid, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); if (!is_array( $cid ) || count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to delete', true ) ); } $fp =& JTable::getInstance('frontpage', 'Table'); foreach ($cid as $id) { if (!$fp->delete( $id )) { JError::raiseError(500, $fp->getError() ); } $obj =& JTable::getInstance('content'); $obj->load( $id ); $obj->mask = 0; if (!$obj->store()) { JError::raiseError(500, $fp->getError() ); } } $fp->reorder(); $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect( 'index.php?option='.$option ); } /** * Moves the order of a record * @param integer The increment to reorder by */ function orderFrontPage( $uid, $inc, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $fp =& JTable::getInstance('frontpage','Table'); $fp->load( $uid ); $fp->move( $inc ); $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect( 'index.php?option='.$option ); } /** * @param integer The id of the article * @param integer The new access level * @param string The URL option */ function accessMenu( $uid, $access ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db = & JFactory::getDBO(); $row =& JTable::getInstance('content'); $row->load( $uid ); $row->access = $access; if ( !$row->check() ) { return $row->getError(); } if ( !$row->store() ) { return $row->getError(); } $cache = & JFactory::getCache('com_content'); $cache->clean(); $mainframe->redirect( 'index.php?option=com_frontpage' ); } function saveOrder( &$cid ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); for( $i=0; $i < $total; $i++ ) { $query = 'UPDATE #__content_frontpage' . ' SET ordering = ' . (int) $order[$i] . ' WHERE content_id = ' . (int) $cid[$i]; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } } $cache = & JFactory::getCache('com_content'); $cache->clean(); $msg = JText::_( 'New ordering saved' ); $mainframe->redirect( 'index.php?option=com_frontpage', $msg ); }joomla/joomla/administrator/components/com_frontpage/views/0000777000000000000000000000000011266551167025546 5ustar adminadministratorsjoomla/joomla/administrator/components/com_frontpage/views/frontpage.php0000766000000000000000000002232611234314074030237 0ustar adminadministratorsgetNullDate(); $config =& JFactory::getConfig(); $now =& JFactory::getDate(); //Ordering allowed ? $ordering = (($lists['order'] == 'fpordering')); JHTML::_('behavior.tooltip'); ?>
    :
    id ); $publish_up =& JFactory::getDate($row->publish_up); $publish_down =& JFactory::getDate($row->publish_down); $publish_up->setOffset($config->getValue('config.offset')); $publish_down->setOffset($config->getValue('config.offset')); if ( $now->toUnix() <= $publish_up->toUnix() && $row->state == 1 ) { $img = 'publish_y.png'; $alt = JText::_( 'Published' ); } else if ( ( $now->toUnix() <= $publish_down->toUnix() || $row->publish_down == $nullDate ) && $row->state == 1 ) { $img = 'publish_g.png'; $alt = JText::_( 'Published' ); } else if ( $now->toUnix() > $publish_down->toUnix() && $row->state == 1 ) { $img = 'publish_r.png'; $alt = JText::_( 'Expired' ); } else if ( $row->state == 0 ) { $img = 'publish_x.png'; $alt = JText::_( 'Unpublished' ); } else if ( $row->state == -1 ) { $img = 'disabled.png'; $alt = JText::_( 'Archived' ); } $times = ''; if (isset($row->publish_up)) { if ($row->publish_up == $nullDate) { $times .= JText::_( 'Start: Always' ); } else { $times .= JText::_( 'Start' ) .": ". $publish_up->toFormat(); } } if (isset($row->publish_down)) { if ($row->publish_down == $nullDate) { $times .= "
    ". JText::_( 'Finish: No Expiry' ); } else { $times .= "
    ". JText::_( 'Finish' ) .": ". $publish_down->toFormat(); } } $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); if ( $user->authorize( 'com_users', 'manage' ) ) { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $linkA = JRoute::_( 'index.php?option=com_users&task=edit&cid[]='. $row->created_by ); $author='' . ''. $row->author .''; } } else { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $author = $row->author; } } // section handling if ($row->sectionid) { $row->sect_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->sectionid ); $title_sec = JText::_( 'Edit Section' ); } // category handling if ($row->catid) { $row->cat_link = JRoute::_( 'index.php?option=com_categories&task=edit&cid[]='. $row->catid ); $title_cat = JText::_( 'Edit Category' ); } ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->title; } else { ?> title; ?> <?php echo $alt;?> orderUpIcon( $i, true, 'orderup', 'Move Up', $ordering ); ?> orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> id;?> sectionid) : ?> sect_name; ?> catid) : ?> name; ?>
    joomla/joomla/administrator/components/com_frontpage/tables/0000777000000000000000000000000011266551171025656 5ustar adminadministratorsjoomla/joomla/administrator/components/com_frontpage/tables/frontpage.php0000766000000000000000000000171611234314074030354 0ustar adminadministratorsjoomla/joomla/administrator/components/com_frontpage/index.html0000766000000000000000000000005411234314074026373 0ustar adminadministratorsjoomla/joomla/administrator/components/com_frontpage/frontpage.xml0000766000000000000000000000103511234314074027105 0ustar adminadministrators Frontpage Joomla! Project (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This Component shows all the published Articles from your site marked Show on Front Page. joomla/joomla/administrator/components/com_newsfeeds/0000777000000000000000000000000011266551132024377 5ustar adminadministratorsjoomla/joomla/administrator/components/com_newsfeeds/admin.newsfeeds.html.php0000766000000000000000000002520311234314104031117 0ustar adminadministrators
    :
    id ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); $row->cat_link = JRoute::_( 'index.php?option=com_categories§ion=com_newsfeeds&task=edit&cid[]='. $row->catid ); ?>
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->name; } else { ?> name; ?> orderUpIcon($i, ($row->catid == @$rows[$i-1]->catid), 'orderup', 'Move Up', $ordering ); ?> orderDownIcon($i, $n, ($row->catid == @$rows[$i+1]->catid), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> catname;?> numarticles;?> cache_time;?> id; ?>
    get('gid') == 25 ) { $visible = 1; } HTML_newsfeeds::writableCell( JPATH_SITE.DS.'cache', 0, ''. JText::_('Cache Directory') .' ', $visible ); ?>
    :
    '. JText::_( 'Writable' ) .''; $unwriteable = ''. JText::_( 'Unwritable' ) .''; echo ''; echo ''; echo $text; if ( $visible ) { echo $folder . '/'; } echo ''; echo ''; if ( $relative ) { echo is_writable( "../$folder" ) ? $writeable : $unwriteable; } else { echo is_writable( "$folder" ) ? $writeable : $unwriteable; } echo ''; echo ''; } }joomla/joomla/administrator/components/com_newsfeeds/elements/0000777000000000000000000000000011266551132026213 5ustar adminadministratorsjoomla/joomla/administrator/components/com_newsfeeds/elements/newsfeed.php0000766000000000000000000000320711234314106030520 0ustar adminadministratorssetQuery( $query ); $options = $db->loadObjectList( ); $n = count( $options ); for ($i = 0; $i < $n; $i++) { $options[$i]->text = $options[$i]->title . '-' . $options[$i]->name; } array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Feed').' -', 'id', 'text')); return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'text', $value, $control_name.$name ); } } joomla/joomla/administrator/components/com_newsfeeds/elements/index.html0000766000000000000000000000005411234314106030201 0ustar adminadministratorsjoomla/joomla/administrator/components/com_newsfeeds/newsfeeds.xml0000766000000000000000000000102611234314106027075 0ustar adminadministrators Newsfeeds Joomla! Project April 2006 (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component manages RSS/RDF newsfeeds joomla/joomla/administrator/components/com_newsfeeds/toolbar.newsfeeds.php0000766000000000000000000000157511234314104030534 0ustar adminadministratorsalias)) { $this->alias = $this->name; } $this->alias = JFilterOutput::stringURLSafe($this->alias); if(trim(str_replace('-','',$this->alias)) == '') { $datenow =& JFactory::getDate(); $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S"); } return true; } } joomla/joomla/administrator/components/com_newsfeeds/tables/index.html0000766000000000000000000000005411234314104027635 0ustar adminadministratorsjoomla/joomla/administrator/components/com_newsfeeds/index.html0000766000000000000000000000005411234314104026363 0ustar adminadministratorsjoomla/joomla/administrator/components/com_newsfeeds/toolbar.newsfeeds.html.php0000766000000000000000000000314511234314106031474 0ustar adminadministrators[ '. $text.' ]' ); JToolBarHelper::save(); JToolBarHelper::apply(); if ($edit) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.newsfeeds.edit' ); } }joomla/joomla/administrator/components/com_newsfeeds/config.xml0000766000000000000000000000412611234314104026361 0ustar adminadministrators joomla/joomla/administrator/components/com_newsfeeds/admin.newsfeeds.php0000766000000000000000000002722411234314104030161 0ustar adminadministratorsauthorize( 'com_newsfeeds', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Set the table directory JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_newsfeeds'.DS.'tables'); require_once( JApplicationHelper::getPath( 'admin_html' ) ); $task = JRequest::getCmd('task'); switch ($task) { case 'add' : editNewsFeed(false); break; case 'edit': editNewsFeed(true); break; case 'save': case 'apply': saveNewsFeed( ); break; case 'publish': publishNewsFeeds( ); break; case 'unpublish': unPublishNewsFeeds( ); break; case 'remove': removeNewsFeeds( ); break; case 'cancel': cancelNewsFeed( ); break; case 'orderup': moveUpNewsFeed( ); break; case 'orderdown': moveDownNewsFeed( ); break; case 'saveorder': saveOrder( ); break; default: showNewsFeeds( ); break; } /** * List the records */ function showNewsFeeds( ) { global $mainframe, $option; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( "$option.filter_order", 'filter_order', 'a.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( "$option.filter_state", 'filter_state', '', 'word' ); $filter_catid = $mainframe->getUserStateFromRequest( "$option.filter_catid", 'filter_catid', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where = array(); if ( $filter_catid ) { $where[] = 'a.catid = '.(int) $filter_catid; } if ($search) { $where[] = 'LOWER(a.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'a.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'a.published = 0'; } } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); if ($filter_order == 'a.ordering'){ $orderby = ' ORDER BY catname, a.ordering'; } else { $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', catname, a.ordering'; } // get the total number of records $query = 'SELECT COUNT(*) ' . ' FROM #__newsfeeds AS a' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); // get the subset (based on limits) of required records $query = 'SELECT a.*, c.title AS catname, u.name AS editor' . ' FROM #__newsfeeds AS a' . ' LEFT JOIN #__categories AS c ON c.id = a.catid' . ' LEFT JOIN #__users AS u ON u.id = a.checked_out' . $where . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // build list of categories $javascript = 'onchange="document.adminForm.submit();"'; $lists['catid'] = JHTML::_('list.category', 'filter_catid', 'com_newsfeeds', $filter_catid, $javascript ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; HTML_newsfeeds::showNewsFeeds( $rows, $lists, $pageNav, $option ); } /** * Creates a new or edits and existing user record */ function editNewsFeed($edit) { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $catid = JRequest::getVar( 'catid', 0, '', 'int' ); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); $option = JRequest::getCmd( 'option' ); JArrayHelper::toInteger($cid, array(0)); $row =& JTable::getInstance( 'newsfeed', 'Table' ); // load the row from the db table if($edit) $row->load( $cid[0] ); if ($edit) { // do stuff for existing records $row->checkout( $user->get('id') ); } else { // do stuff for new records $row->ordering = 0; $row->numarticles = 5; $row->cache_time = 3600; $row->published = 1; } // build the html select list for ordering $query = 'SELECT a.ordering AS value, a.name AS text' . ' FROM #__newsfeeds AS a' . ' ORDER BY a.ordering' ; if($edit) $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query ); else $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query ); // build list of categories $lists['category'] = JHTML::_('list.category', 'catid', $option, intval( $row->catid ) ); // build the html select list $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ); $rtl[] = JHTML::_('select.option', '0', JText::_( 'Site Language Direction' ) ); $rtl[] = JHTML::_('select.option', '1', JText::_( 'Left to Right Direction' ) ); $rtl[] = JHTML::_('select.option', '2', JText::_( 'Right to Left Direction' ) ); $lists['rtl'] = JHTML::_('select.genericlist', $rtl, 'rtl', 'class="inputbox"', 'value', 'text', intval( $row->rtl ) ); HTML_newsfeeds::editNewsFeed( $row, $lists, $option ); } /** * Saves the record from an edit form submit */ function saveNewsFeed( ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $task = JRequest::getVar( 'task'); $row =& JTable::getInstance( 'newsfeed', 'Table' ); if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError() ); } // Sets rtl value when rtl checkbox ticked $isRtl = JRequest::getInt('rtl'); // pre-save checks if (!$row->check()) { JError::raiseError(500, $row->getError() ); } // if new item, order last in appropriate group if (!$row->id) { $where = "catid = " . (int) $row->catid; $row->ordering = $row->getNextOrder( $where ); } // save the changes if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); switch ($task) { case 'apply': $msg = JText::_( 'Changes to Newsfeed saved' ); $link = 'index.php?option=com_newsfeeds&task=edit&cid[]='. $row->id ; break; case 'save': default: $msg = JText::_( 'Newsfeed saved' ); $link = 'index.php?option=com_newsfeeds'; break; } $mainframe->redirect( $link, $msg ); } /** * Publishes one or more modules */ function publishNewsFeeds( ) { changePublishNewsFeeds( 1 ); } /** * Unpublishes one or more modules */ function unPublishNewsFeeds( ) { changePublishNewsFeeds( 0 ); } /** * Publishes or Unpublishes one or more modules * @param integer 0 if unpublishing, 1 if publishing */ function changePublishNewsFeeds( $publish ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $cid = JRequest::getVar('cid', array(), '', 'array'); $option = JRequest::getCmd('option'); JArrayHelper::toInteger($cid); if (empty( $cid )) { JError::raiseWarning( 500, 'No items selected' ); $mainframe->redirect( 'index.php?option='. $option ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__newsfeeds' . ' SET published = '.(int) $publish . ' WHERE id IN ( '. $cids .' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id') .' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance( 'newsfeed', 'Table' ); $row->checkin( $cid[0] ); } $mainframe->redirect( 'index.php?option='. $option ); } /** * Removes records */ function removeNewsFeeds( ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $cid = JRequest::getVar('cid', array(), '', 'array'); $option = JRequest::getCmd('option'); JArrayHelper::toInteger($cid); if (count($cid) < 1) { JError::raiseWarning(500, JText::_( 'Select an item to delete', true ) ); $mainframe->redirect( 'index.php?option='. $option ); } $cids = implode( ',', $cid ); $query = 'DELETE FROM #__newsfeeds' . ' WHERE id IN ( '. $cids .' )' ; $db->setQuery( $query ); if (!$db->query()) { echo "\n"; } $mainframe->redirect( 'index.php?option='. $option ); } /** * Cancels an edit operation */ function cancelNewsFeed( ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $option = JRequest::getCmd('option'); $row =& JTable::getInstance( 'newsfeed', 'Table' ); $row->bind(JRequest::get('post')); $row->checkin(); $mainframe->redirect( 'index.php?option='. $option ); } /** * Moves the record up one position */ function moveUpNewsFeed( ) { orderNewsFeed( -1 ); } /** * Moves the record down one position */ function moveDownNewsFeed( ) { orderNewsFeed( 1 ); } /** * Moves the order of a record * @param integer The direction to reorder, +1 down, -1 up */ function orderNewsFeed( $inc ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $cid = JRequest::getVar('cid', array(0), '', 'array'); $option = JRequest::getCmd('option'); JArrayHelper::toInteger($cid, array(0)); $limit = JRequest::getVar( 'limit', 0, '', 'int' ); $limitstart = JRequest::getVar( 'limitstart', 0, '', 'int' ); $catid = JRequest::getVar( 'catid', 0, '', 'int' ); $row =& JTable::getInstance( 'newsfeed', 'Table' ); $row->load( $cid[0] ); $row->move( $inc, 'catid = '.(int) $row->catid.' AND published != 0' ); $mainframe->redirect( 'index.php?option='. $option ); } /** * Saves user reordering entry */ function saveOrder( ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order, array(0)); $row =& JTable::getInstance( 'newsfeed', 'Table' ); $groupings = array(); // update ordering values for( $i=0; $i < $total; $i++ ) { $row->load( (int) $cid[$i] ); // track categories $groupings[] = $row->catid; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError(500, $db->getErrorMsg() ); } } } // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('catid = '.(int) $group); } $msg = JText::_( 'New ordering saved' ); $mainframe->redirect( 'index.php?option=com_newsfeeds', $msg ); } joomla/joomla/administrator/components/com_search/0000777000000000000000000000000011266551125023663 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/search.xml0000766000000000000000000000077111234314100025641 0ustar adminadministrators Search Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 DESCSEARCH joomla/joomla/administrator/components/com_search/helpers/0000777000000000000000000000000011266551125025325 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/helpers/site.php0000766000000000000000000000201011234314100026755 0ustar adminadministratorsgetTag(); $ignoreFile = $lang->getLanguagePath().DS.$tag.DS.$tag.'.ignore.php'; if (file_exists($ignoreFile)) { include $ignoreFile; } // check for words to ignore $aterms = explode( ' ', JString::strtolower( $searchword ) ); // first case is single ignored word if ( count( $aterms ) == 1 && in_array( JString::strtolower( $searchword ), $search_ignore ) ) { $ignored = true; } // filter out search terms that are too small foreach( $aterms AS $aterm ) { if (JString::strlen( $aterm ) < 3) { $search_ignore[] = $aterm; } } // next is to remove ignored words from type 'all' or 'any' (not exact) searches with multiple words if ( count( $aterms ) > 1 && $searchphrase != 'exact' ) { $pruned = array_diff( $aterms, $search_ignore ); $searchword = implode( ' ', $pruned ); } return $ignored; } function limitSearchWord(&$searchword) { $restriction = false; // limit searchword to 20 characters if ( JString::strlen( $searchword ) > 20 ) { $searchword = JString::substr( $searchword, 0, 19 ); $restriction = true; } // searchword must contain a minimum of 3 characters if ( $searchword && JString::strlen( $searchword ) < 3 ) { $searchword = ''; $restriction = true; } return $restriction; } function logSearch( $search_term ) { global $mainframe; $db =& JFactory::getDBO(); $params = &JComponentHelper::getParams( 'com_search' ); $enable_log_searches = $params->get('enabled'); $search_term = $db->getEscaped( trim( $search_term) ); if ( @$enable_log_searches ) { $db =& JFactory::getDBO(); $query = 'SELECT hits' . ' FROM #__core_log_searches' . ' WHERE LOWER( search_term ) = "'.$search_term.'"' ; $db->setQuery( $query ); $hits = intval( $db->loadResult() ); if ( $hits ) { $query = 'UPDATE #__core_log_searches' . ' SET hits = ( hits + 1 )' . ' WHERE LOWER( search_term ) = "'.$search_term.'"' ; $db->setQuery( $query ); $db->query(); } else { $query = 'INSERT INTO #__core_log_searches VALUES ( "'.$search_term.'", 1 )'; $db->setQuery( $query ); $db->query(); } } } /** * Prepares results from search for display * * @param string The source string * @param int Number of chars to trim * @param string The searchword to select around * @return string */ function prepareSearchContent( $text, $length = 200, $searchword ) { // strips tags won't remove the actual jscript $text = preg_replace( "']*>.*?'si", "", $text ); $text = preg_replace( '/{.+?}/', '', $text); //$text = preg_replace( '/]*>([^<]+)<\/a>/is','\2', $text ); // replace line breaking tags with whitespace $text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text ); return SearchHelper::_smartSubstr( strip_tags( $text ), $length, $searchword ); } /** * Checks an object for search terms (after stripping fields of HTML) * * @param object The object to check * @param string Search words to check for * @param array List of object variables to check against * @returns boolean True if searchTerm is in object, false otherwise */ function checkNoHtml($object, $searchTerm, $fields) { $searchRegex = array( '#]*>.*?#si', '#]*>.*?#si', '##si', '#<[^>]*>#i' ); $terms = explode(' ', $searchTerm); if(empty($fields)) return false; foreach($fields AS $field) { if(!isset($object->$field)) continue; $text = $object->$field; foreach($searchRegex As $regex) { $text = preg_replace($regex, '', $text); } foreach($terms AS $term) { if(JString::stristr($text, $term) !== false) { return true; } } } return false; } /** * returns substring of characters around a searchword * * @param string The source string * @param int Number of chars to return * @param string The searchword to select around * @return string */ function _smartSubstr($text, $length = 200, $searchword) { $textlen = JString::strlen($text); $lsearchword = JString::strtolower($searchword); $wordfound = false; $pos = 0; while ($wordfound === false && $pos < $textlen) { if (($wordpos = @JString::strpos($text, ' ', $pos + $length)) !== false) { $chunk_size = $wordpos - $pos; } else { $chunk_size = $length; } $chunk = JString::substr($text, $pos, $chunk_size); $wordfound = JString::strpos(JString::strtolower($chunk), $lsearchword); if ($wordfound === false) { $pos += $chunk_size + 1; } } if ($wordfound !== false) { return (($pos > 0) ? '... ' : '') . $chunk . ' ...'; } else { if (($wordpos = @JString::strpos($text, ' ', $length)) !== false) { return JString::substr($text, 0, $wordpos) . ' ...'; } else { return JString::substr($text, 0, $length); } } } } joomla/joomla/administrator/components/com_search/helpers/index.html0000766000000000000000000000005411234314100027303 0ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/0000777000000000000000000000000011266551124025017 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/search/0000777000000000000000000000000011266551125026265 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/search/tmpl/0000777000000000000000000000000011266551125027241 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/search/tmpl/default.php0000766000000000000000000000565011234314100031366 0ustar adminadministrators
    : : enabled ? ''. JText::_( 'Enabled' ) .'' : ''. JText::_( 'Disabled' ) .'' ?> showResults ) : ?>
    showResults ) : ?> items); $i < $n; $i++) { $row =& $this->items[$i]; ?> showResults ) : ?>
    lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?>
    pageNav->getListFooter(); ?>
    pageNav->limitstart; ?> search_term, ENT_QUOTES, 'UTF-8'); ?> hits; ?> returns; ?>
    joomla/joomla/administrator/components/com_search/views/search/tmpl/index.html0000766000000000000000000000005411234314100031217 0ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/search/view.php0000766000000000000000000000415511234314100027737 0ustar adminadministratorssetTitle(JText::_('Search Statistics')); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( 'com_search.limitstart', 'limitstart', 0, 'int' ); $model = $this->getModel(); $items = $model->getItems(); $params = &JComponentHelper::getParams( 'com_search' ); $enabled = $params->get('enabled'); JHTML::_('behavior.tooltip'); jimport('joomla.html.pagination'); $pageNav = new JPagination( count($items), $limitstart, $limit ); $showResults = JRequest::getInt('search_results'); $search = $mainframe->getUserStateFromRequest( 'com_search.search', 'search', '', 'string' ); $this->assignRef('items', $items); $this->assignRef('enabled', $enabled); $this->assignRef('pageNav', $pageNav); $this->assignRef('search', $search ); $this->assignRef('lists', $model->lists ); $this->assignRef('showResults', $showResults); parent::display($tpl); } }joomla/joomla/administrator/components/com_search/views/search/index.html0000766000000000000000000000005411234314100030243 0ustar adminadministratorsjoomla/joomla/administrator/components/com_search/views/index.html0000766000000000000000000000005411234314100026776 0ustar adminadministratorsjoomla/joomla/administrator/components/com_search/controller.php0000766000000000000000000000225011234314100026540 0ustar adminadministratorsgetModel( 'Search' ); $view =& $this->getView( 'Search' ); $view->setModel( $model, true ); $view->display(); } /** * Reset Statistics */ function reset() { $model =& $this->getModel( 'Search' ); $model->reset(); $this->setRedirect('index.php?option=com_search'); } }joomla/joomla/administrator/components/com_search/search.php0000766000000000000000000000143511234314100025626 0ustar adminadministratorsexecute( JRequest::getCmd( 'task' ) ); $controller->redirect();joomla/joomla/administrator/components/com_search/index.html0000766000000000000000000000005411234314100025641 0ustar adminadministratorsjoomla/joomla/administrator/components/com_search/config.xml0000766000000000000000000000073511234314100025641 0ustar adminadministrators joomla/joomla/administrator/components/com_search/models/0000777000000000000000000000000011266551125025146 5ustar adminadministratorsjoomla/joomla/administrator/components/com_search/models/search.php0000766000000000000000000000704011234314100027107 0ustar adminadministratorssetQuery( 'DELETE FROM #__core_log_searches' ); $db->query(); } function getItems( ) { global $mainframe, $option; $db =& JFactory::getDBO(); $filter_order = $mainframe->getUserStateFromRequest( 'com_search.filter_order', 'filter_order', 'hits', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( 'com_search.filter_order_Dir', 'filter_order_Dir', '', 'word' ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( 'com_search.limitstart', 'limitstart', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( 'com_search.search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $showResults = JRequest::getInt('search_results'); // table ordering if ( $filter_order_Dir == 'ASC' ) { $this->lists['order_Dir'] = 'ASC'; } else { $this->lists['order_Dir'] = 'DESC'; } $this->lists['order'] = $filter_order; // search filter $this->lists['search']= $search; $where = array(); if ($search) { $where[] = 'LOWER( search_term ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', hits DESC'; // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__core_log_searches' . $where; $db->setQuery( $query ); $total = $db->loadResult(); jimport( 'joomla.html.pagination' ); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = ' SELECT * ' . ' FROM #__core_log_searches ' . $where . $orderby; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); JPluginHelper::importPlugin( 'search' ); if (!class_exists( 'JSite' )) { // This fools the routers in the search plugins into thinking it's in the frontend require_once( JPATH_COMPONENT.DS.'helpers'.DS.'site.php' ); } for ($i=0, $n = count($rows); $i < $n; $i++) { // determine if number of results for search item should be calculated // by default it is `off` as it is highly query intensive if ( $showResults ) { $results = $mainframe->triggerEvent( 'onSearch', array( $rows[$i]->search_term ) ); $count = 0; for ($j = 0, $n2 = count( $results ); $j < $n2; $j++) { $count += count( $results[$j] ); } $rows[$i]->returns = $count; } else { $rows[$i]->returns = null; } } return $rows; } }joomla/joomla/administrator/components/com_search/models/index.html0000766000000000000000000000005411234314100027124 0ustar adminadministratorsjoomla/joomla/administrator/components/index.html0000766000000000000000000000005411234314074023550 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/0000777000000000000000000000000011266551204023661 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/toolbar.config.html.php0000766000000000000000000000167611234314074030253 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/controllers/application.php0000766000000000000000000005544211234314074031253 0ustar adminadministratorsregisterTask( 'apply', 'save' ); } /** * Show the configuration edit form * @param string The URL option */ function showConfig() { // Initialize some variables $db =& JFactory::getDBO(); $row = new JConfig(); // compile list of the languages $langs = array (); $menuitems = array (); $lists = array (); // PRE-PROCESS SOME LIST // -- Editors -- // compile list of the editors $query = 'SELECT element AS value, name AS text' .' FROM #__plugins' .' WHERE folder = "editors"' .' AND published = 1' .' ORDER BY ordering, name' ; $db->setQuery($query); $edits = $db->loadObjectList(); // -- Show/Hide -- $show_hide = array (JHTML::_('select.option', 1, JText::_('Hide')), JHTML::_('select.option', 0, JText::_('Show')),); $show_hide_r = array (JHTML::_('select.option', 0, JText::_('Hide')), JHTML::_('select.option', 1, JText::_('Show')),); // -- menu items -- $query = 'SELECT id AS value, name AS text FROM #__menu' .' WHERE ( type="content_section" OR type="components" OR type="content_typed" )' .' AND published = 1' .' AND access = 0' .' ORDER BY name' ; $db->setQuery($query); $menuitems = array_merge($menuitems, $db->loadObjectList()); // SITE SETTINGS $lists['offline'] = JHTML::_('select.booleanlist', 'offline', 'class="inputbox"', $row->offline); if (!$row->editor) { $row->editor = ''; } // build the html select list $lists['editor'] = JHTML::_('select.genericlist', $edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $row->editor); $listLimit = array (JHTML::_('select.option', 5, 5), JHTML::_('select.option', 10, 10), JHTML::_('select.option', 15, 15), JHTML::_('select.option', 20, 20), JHTML::_('select.option', 25, 25), JHTML::_('select.option', 30, 30), JHTML::_('select.option', 50, 50), JHTML::_('select.option', 100, 100),); $lists['list_limit'] = JHTML::_('select.genericlist', $listLimit, 'list_limit', 'class="inputbox" size="1"', 'value', 'text', ($row->list_limit ? $row->list_limit : 50)); jimport('joomla.language.help'); $helpsites = array (); $helpsites = JHelp::createSiteList(JPATH_BASE.DS.'help'.DS.'helpsites-15.xml', $row->helpurl); array_unshift($helpsites, JHTML::_('select.option', '', JText::_('local'))); $lists['helpsites'] = JHTML::_('select.genericlist', $helpsites, 'helpurl', ' class="inputbox"', 'value', 'text', $row->helpurl); // DEBUG $lists['debug'] = JHTML::_('select.booleanlist', 'debug', 'class="inputbox"', $row->debug); $lists['debug_lang'] = JHTML::_('select.booleanlist', 'debug_lang', 'class="inputbox"', $row->debug_lang); // DATABASE SETTINGS // SERVER SETTINGS $lists['gzip'] = JHTML::_('select.booleanlist', 'gzip', 'class="inputbox"', $row->gzip); $errors = array (JHTML::_('select.option', -1, JText::_('System Default')), JHTML::_('select.option', 0, JText::_('None')), JHTML::_('select.option', E_ERROR | E_WARNING | E_PARSE, JText::_('Simple')), JHTML::_('select.option', E_ALL, JText::_('Maximum'))); $lists['xmlrpc_server'] = JHTML::_('select.booleanlist', 'xmlrpc_server', 'class="inputbox"', $row->xmlrpc_server); $lists['error_reporting'] = JHTML::_('select.genericlist', $errors, 'error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->error_reporting); $lists['enable_ftp'] = JHTML::_('select.booleanlist', 'ftp_enable', 'class="inputbox"', intval($row->ftp_enable)); $forceSSL = array( JHTML::_('select.option', 0, JText::_('None')), JHTML::_('select.option', 1, JText::_('Administrator Only')), JHTML::_('select.option', 2, JText::_('Entire Site')), ); $lists['force_ssl'] = JHTML::_('select.genericlist', $forceSSL, 'force_ssl', 'class="inputbox" size="1"', 'value', 'text', @$row->force_ssl); // LOCALE SETTINGS $timeoffset = array ( JHTML::_('select.option', -12, JText::_('(UTC -12:00) International Date Line West')), JHTML::_('select.option', -11, JText::_('(UTC -11:00) Midway Island, Samoa')), JHTML::_('select.option', -10, JText::_('(UTC -10:00) Hawaii')), JHTML::_('select.option', -9.5, JText::_('(UTC -09:30) Taiohae, Marquesas Islands')), JHTML::_('select.option', -9, JText::_('(UTC -09:00) Alaska')), JHTML::_('select.option', -8, JText::_('(UTC -08:00) Pacific Time (US & Canada)')), JHTML::_('select.option', -7, JText::_('(UTC -07:00) Mountain Time (US & Canada)')), JHTML::_('select.option', -6, JText::_('(UTC -06:00) Central Time (US & Canada), Mexico City')), JHTML::_('select.option', -5, JText::_('(UTC -05:00) Eastern Time (US & Canada), Bogota, Lima')), JHTML::_('select.option', -4.5, JText::_('(UTC -04:30) Venezuela')), JHTML::_('select.option', -4, JText::_('(UTC -04:00) Atlantic Time (Canada), Caracas, La Paz')), JHTML::_('select.option', -3.5, JText::_('(UTC -03:30) St. John\'s, Newfoundland, Labrador')), JHTML::_('select.option', -3, JText::_('(UTC -03:00) Brazil, Buenos Aires, Georgetown')), JHTML::_('select.option', -2, JText::_('(UTC -02:00) Mid-Atlantic')), JHTML::_('select.option', -1, JText::_('(UTC -01:00) Azores, Cape Verde Islands')), JHTML::_('select.option', 0, JText::_('(UTC 00:00) Western Europe Time, London, Lisbon, Casablanca')), JHTML::_('select.option', 1, JText::_('(UTC +01:00) Amsterdam, Berlin, Brussels, Copenhagen, Madrid, Paris')), JHTML::_('select.option', 2, JText::_('(UTC +02:00) Istanbul, Jerusalem, Kaliningrad, South Africa')), JHTML::_('select.option', 3, JText::_('(UTC +03:00) Baghdad, Riyadh, Moscow, St. Petersburg')), JHTML::_('select.option', 3.5, JText::_('(UTC +03:30) Tehran')), JHTML::_('select.option', 4, JText::_('(UTC +04:00) Abu Dhabi, Muscat, Baku, Tbilisi')), JHTML::_('select.option', 4.5, JText::_('(UTC +04:30) Kabul')), JHTML::_('select.option', 5, JText::_('(UTC +05:00) Ekaterinburg, Islamabad, Karachi, Tashkent')), JHTML::_('select.option', 5.5, JText::_('(UTC +05:30) Bombay, Calcutta, Madras, New Delhi, Colombo')), JHTML::_('select.option', 5.75, JText::_('(UTC +05:45) Kathmandu')), JHTML::_('select.option', 6, JText::_('(UTC +06:00) Almaty, Dhaka')), JHTML::_('select.option', 6.30, JText::_('(UTC +06:30) Yagoon')), JHTML::_('select.option', 7, JText::_('(UTC +07:00) Bangkok, Hanoi, Jakarta')), JHTML::_('select.option', 8, JText::_('(UTC +08:00) Beijing, Perth, Singapore, Hong Kong')), JHTML::_('select.option', 8.75, JText::_('(UTC +08:00) Western Australia')), JHTML::_('select.option', 9, JText::_('(UTC +09:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk')), JHTML::_('select.option', 9.5, JText::_('(UTC +09:30) Adelaide, Darwin, Yakutsk')), JHTML::_('select.option', 10, JText::_('(UTC +10:00) Eastern Australia, Guam, Vladivostok')), JHTML::_('select.option', 10.5, JText::_('(UTC +10:30) Lord Howe Island (Australia)')), JHTML::_('select.option', 11, JText::_('(UTC +11:00) Magadan, Solomon Islands, New Caledonia')), JHTML::_('select.option', 11.30, JText::_('(UTC +11:30) Norfolk Island')), JHTML::_('select.option', 12, JText::_('(UTC +12:00) Auckland, Wellington, Fiji, Kamchatka')), JHTML::_('select.option', 12.75, JText::_('(UTC +12:45) Chatham Island')), JHTML::_('select.option', 13, JText::_('(UTC +13:00) Tonga')), JHTML::_('select.option', 14, JText::_('(UTC +14:00) Kiribati')),); $lists['offset'] = JHTML::_('select.genericlist', $timeoffset, 'offset', 'class="inputbox" size="1"', 'value', 'text', $row->offset); // MAIL SETTINGS $mailer = array ( JHTML::_('select.option', 'mail', JText::_('PHP mail function')), JHTML::_('select.option', 'sendmail', JText::_('Sendmail')), JHTML::_('select.option', 'smtp', JText::_('SMTP Server'))); $lists['mailer'] = JHTML::_('select.genericlist', $mailer, 'mailer', 'class="inputbox" size="1"', 'value', 'text', $row->mailer); $smtpsecure = array ( JHTML::_('select.option', 'none', JText::_('None')), JHTML::_('select.option', 'ssl', 'SSL'), JHTML::_('select.option', 'tls', 'TLS')); $lists['smtpsecure'] = JHTML::_('select.genericlist', $smtpsecure, 'smtpsecure', 'class="inputbox" size="1"', 'value', 'text', (isset($row->smtpsecure) ? $row->smtpsecure : '')); $lists['smtpauth'] = JHTML::_('select.booleanlist', 'smtpauth', 'class="inputbox"', $row->smtpauth); // CACHE SETTINGS $lists['caching'] = JHTML::_('select.booleanlist', 'caching', 'class="inputbox"', $row->caching); jimport('joomla.cache.cache'); $stores = JCache::getStores(); $options = array(); foreach($stores as $store) { $options[] = JHTML::_('select.option', $store, JText::_(ucfirst($store)) ); } $lists['cache_handlers'] = JHTML::_('select.genericlist', $options, 'cache_handler', 'class="inputbox" size="1"', 'value', 'text', $row->cache_handler); // MEMCACHE SETTINGS if (!empty($row->memcache_settings) && !is_array($row->memcache_settings)) { $row->memcache_settings = unserialize(stripslashes($row->memcache_settings)); } $lists['memcache_persist'] = JHTML::_('select.booleanlist', 'memcache_settings[persistent]', 'class="inputbox"', @$row->memcache_settings['persistent']); $lists['memcache_compress'] = JHTML::_('select.booleanlist', 'memcache_settings[compression]', 'class="inputbox"', @$row->memcache_settings['compression']); // META SETTINGS $lists['MetaAuthor'] = JHTML::_('select.booleanlist', 'MetaAuthor', 'class="inputbox"', $row->MetaAuthor); $lists['MetaTitle'] = JHTML::_('select.booleanlist', 'MetaTitle', 'class="inputbox"', $row->MetaTitle); // SEO SETTINGS $lists['sef'] = JHTML::_('select.booleanlist', 'sef', 'class="inputbox"', $row->sef); $lists['sef_rewrite'] = JHTML::_('select.booleanlist', 'sef_rewrite', 'class="inputbox"', $row->sef_rewrite); $lists['sef_suffix'] = JHTML::_('select.booleanlist', 'sef_suffix', 'class="inputbox"', $row->sef_suffix); // FEED SETTINGS $formats = array (JHTML::_('select.option', 'RSS2.0', JText::_('RSS')), JHTML::_('select.option', 'Atom', JText::_('Atom'))); $summary = array (JHTML::_('select.option', 1, JText::_('Full Text')), JHTML::_('select.option', 0, JText::_('Intro Text')),); $lists['feed_limit'] = JHTML::_('select.genericlist', $listLimit, 'feed_limit', 'class="inputbox" size="1"', 'value', 'text', ($row->feed_limit ? $row->feed_limit : 10)); $emailOptions = array ( JHTML::_('select.option', 'author', JText::_('Author Email')), JHTML::_('select.option', 'site', JText::_('Site Email'))); $lists['feed_email'] = JHTML::_('select.genericlist', $emailOptions, 'feed_email', 'class="inputbox" size="1"', 'value', 'text', (@$row->feed_email) ? $row->feed_email : 'author'); // SESSION SETTINGS $stores = JSession::getStores(); $options = array(); foreach($stores as $store) { $options[] = JHTML::_('select.option', $store, JText::_(ucfirst($store)) ); } $lists['session_handlers'] = JHTML::_('select.genericlist', $options, 'session_handler', 'class="inputbox" size="1"', 'value', 'text', $row->session_handler); // SHOW EDIT FORM ConfigApplicationView::showConfig($row, $lists); } /** * Save the configuration */ function save() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $ftp = JClientHelper::getCredentials('ftp'); //Save user and media manager settings $table =& JTable::getInstance('component'); $userpost['params'] = JRequest::getVar('userparams', array(), 'post', 'array'); $userpost['option'] = 'com_users'; $table->loadByOption( 'com_users' ); $table->bind( $userpost ); // pre-save checks if (!$table->check()) { JError::raiseWarning( 500, $table->getError() ); return false; } // save the changes if (!$table->store()) { JError::raiseWarning( 500, $table->getError() ); return false; } $mediapost['params'] = JRequest::getVar('mediaparams', array(), 'post', 'array'); $mediapost['option'] = 'com_media'; //Sanitize $file_path and $image_path $file_path = $mediapost['params']['file_path']; $image_path = $mediapost['params']['image_path']; if(strpos($file_path, '/') === 0 || strpos($file_path, '\\') === 0) { //Leading slash. Kill it and default to /media $file_path = 'images'; } if(strpos($image_path, '/') === 0 || strpos($image_path, '\\') === 0) { //Leading slash. Kill it and default to /media $image_path = 'images/stories'; } if(strpos($file_path, '..') !== false) { //downward directories. Kill it and default to images/ $file_path = 'images'; } if(strpos($image_path, '..') !== false) { //downward directories Kill it and default to images/stories $image_path = 'images/stories'; } $mediapost['params']['file_path'] = $file_path; $mediapost['params']['image_path'] = $image_path; $table->loadByOption( 'com_media' ); $table->bind( $mediapost ); // pre-save checks if (!$table->check()) { JError::raiseWarning( 500, $table->getError() ); return false; } // save the changes if (!$table->store()) { JError::raiseWarning( 500, $table->getError() ); return false; } $config = new JRegistry('config'); $config_array = array(); // SITE SETTINGS $config_array['offline'] = JRequest::getVar('offline', 0, 'post', 'int'); $config_array['editor'] = JRequest::getVar('editor', 'tinymce', 'post', 'cmd'); $config_array['list_limit'] = JRequest::getVar('list_limit', 20, 'post', 'int'); $config_array['helpurl'] = JRequest::getVar('helpurl', 'http://help.joomla.org', 'post', 'string'); // DEBUG $config_array['debug'] = JRequest::getVar('debug', 0, 'post', 'int'); $config_array['debug_lang'] = JRequest::getVar('debug_lang', 0, 'post', 'int'); // SEO SETTINGS $config_array['sef'] = JRequest::getVar('sef', 0, 'post', 'int'); $config_array['sef_rewrite'] = JRequest::getVar('sef_rewrite', 0, 'post', 'int'); $config_array['sef_suffix'] = JRequest::getVar('sef_suffix', 0, 'post', 'int'); // FEED SETTINGS $config_array['feed_limit'] = JRequest::getVar('feed_limit', 10, 'post', 'int'); $config_array['feed_email'] = JRequest::getVar('feed_email', 'author', 'post', 'word'); // SERVER SETTINGS $config_array['secret'] = JRequest::getVar('secret', 0, 'post', 'string'); $config_array['gzip'] = JRequest::getVar('gzip', 0, 'post', 'int'); $config_array['error_reporting'] = JRequest::getVar('error_reporting', -1, 'post', 'int'); $config_array['xmlrpc_server'] = JRequest::getVar('xmlrpc_server', 0, 'post', 'int'); $config_array['log_path'] = JRequest::getVar('log_path', JPATH_ROOT.DS.'logs', 'post', 'string'); $config_array['tmp_path'] = JRequest::getVar('tmp_path', JPATH_ROOT.DS.'tmp', 'post', 'string'); $config_array['live_site'] = rtrim(JRequest::getVar('live_site','','post','string'), '/\\'); $config_array['force_ssl'] = JRequest::getVar('force_ssl', 0, 'post', 'int'); // LOCALE SETTINGS $config_array['offset'] = JRequest::getVar('offset', 0, 'post', 'float'); // CACHE SETTINGS $config_array['caching'] = JRequest::getVar('caching', 0, 'post', 'int'); $config_array['cachetime'] = JRequest::getVar('cachetime', 900, 'post', 'int'); $config_array['cache_handler'] = JRequest::getVar('cache_handler', 'file', 'post', 'word'); $config_array['memcache_settings'] = JRequest::getVar('memcache_settings', array(), 'post'); // FTP SETTINGS $config_array['ftp_enable'] = JRequest::getVar('ftp_enable', 0, 'post', 'int'); $config_array['ftp_host'] = JRequest::getVar('ftp_host', '', 'post', 'string'); $config_array['ftp_port'] = JRequest::getVar('ftp_port', '', 'post', 'int'); $config_array['ftp_user'] = JRequest::getVar('ftp_user', '', 'post', 'string'); $config_array['ftp_pass'] = JRequest::getVar('ftp_pass', '', 'post', 'string', JREQUEST_ALLOWRAW); $config_array['ftp_root'] = JRequest::getVar('ftp_root', '', 'post', 'string'); // DATABASE SETTINGS $config_array['dbtype'] = JRequest::getVar('dbtype', 'mysql', 'post', 'word'); $config_array['host'] = JRequest::getVar('host', 'localhost', 'post', 'string'); $config_array['user'] = JRequest::getVar('user', '', 'post', 'string'); $config_array['db'] = JRequest::getVar('db', '', 'post', 'string'); $config_array['dbprefix'] = JRequest::getVar('dbprefix', 'jos_', 'post', 'string'); // MAIL SETTINGS $config_array['mailer'] = JRequest::getVar('mailer', 'mail', 'post', 'word'); $config_array['mailfrom'] = JRequest::getVar('mailfrom', '', 'post', 'string'); $config_array['fromname'] = JRequest::getVar('fromname', 'Joomla 1.5', 'post', 'string'); $config_array['sendmail'] = JRequest::getVar('sendmail', '/usr/sbin/sendmail', 'post', 'string'); $config_array['smtpauth'] = JRequest::getVar('smtpauth', 0, 'post', 'int'); $config_array['smtpsecure'] = JRequest::getVar('smtpsecure', 'none', 'post', 'word'); $smtpport = JRequest::getVar('smtpport', '', 'post', 'int'); $config_array['smtpport'] = $smtpport ? $smtpport : '25'; $config_array['smtpuser'] = JRequest::getVar('smtpuser', '', 'post', 'string'); $config_array['smtppass'] = JRequest::getVar('smtppass', '', 'post', 'string', JREQUEST_ALLOWRAW); $config_array['smtphost'] = JRequest::getVar('smtphost', '', 'post', 'string'); // META SETTINGS $config_array['MetaAuthor'] = JRequest::getVar('MetaAuthor', 1, 'post', 'int'); $config_array['MetaTitle'] = JRequest::getVar('MetaTitle', 1, 'post', 'int'); // SESSION SETTINGS $config_array['lifetime'] = JRequest::getVar('lifetime', 0, 'post', 'int'); $config_array['session_handler'] = JRequest::getVar('session_handler', 'none', 'post', 'word'); //LANGUAGE SETTINGS //$config_array['lang'] = JRequest::getVar('lang', 'none', 'english', 'cmd'); //$config_array['language'] = JRequest::getVar('language', 'en-GB', 'post', 'cmd'); $config->loadArray($config_array); //override any possible database password change $config->setValue('config.password', $mainframe->getCfg('password')); // handling of special characters $sitename = htmlspecialchars( JRequest::getVar( 'sitename', '', 'post', 'string' ), ENT_COMPAT, 'UTF-8' ); $config->setValue('config.sitename', $sitename); $MetaDesc = htmlspecialchars( JRequest::getVar( 'MetaDesc', '', 'post', 'string' ), ENT_COMPAT, 'UTF-8' ); $config->setValue('config.MetaDesc', $MetaDesc); $MetaKeys = htmlspecialchars( JRequest::getVar( 'MetaKeys', '', 'post', 'string' ), ENT_COMPAT, 'UTF-8' ); $config->setValue('config.MetaKeys', $MetaKeys); // handling of quotes (double and single) and amp characters // htmlspecialchars not used to preserve ability to insert other html characters $offline_message = JRequest::getVar( 'offline_message', '', 'post', 'string' ); $offline_message = JFilterOutput::ampReplace( $offline_message ); $offline_message = str_replace( '"', '"', $offline_message ); $offline_message = str_replace( "'", ''', $offline_message ); $config->setValue('config.offline_message', $offline_message); //purge the database session table (only if we are changing to a db session store) if($mainframe->getCfg('session_handler') != 'database' && $config->getValue('session_handler') == 'database') { $table =& JTable::getInstance('session'); $table->purge(-1); } // Get the path of the configuration file $fname = JPATH_CONFIGURATION.DS.'configuration.php'; // Update the credentials with the new settings $oldconfig =& JFactory::getConfig(); $oldconfig->setValue('config.ftp_enable', $config_array['ftp_enable']); $oldconfig->setValue('config.ftp_host', $config_array['ftp_host']); $oldconfig->setValue('config.ftp_port', $config_array['ftp_port']); $oldconfig->setValue('config.ftp_user', $config_array['ftp_user']); $oldconfig->setValue('config.ftp_pass', $config_array['ftp_pass']); $oldconfig->setValue('config.ftp_root', $config_array['ftp_root']); JClientHelper::getCredentials('ftp', true); if(!$config->get('caching') && $oldconfig->get('caching')) { $cache = JFactory::getCache(); $cache->clean(); } // Try to make configuration.php writeable jimport('joomla.filesystem.path'); if (!$ftp['enabled'] && JPath::isOwner($fname) && !JPath::setPermissions($fname, '0644')) { JError::raiseNotice('SOME_ERROR_CODE', 'Could not make configuration.php writable'); } // Get the config registry in PHP class format and write it to configuation.php jimport('joomla.filesystem.file'); if (JFile::write($fname, $config->toString('PHP', 'config', array('class' => 'JConfig')))) { $msg = JText::_('The Configuration Details have been updated'); } else { $msg = JText::_('ERRORCONFIGFILE'); } // Redirect appropriately $task = $this->getTask(); switch ($task) { case 'apply' : $this->setRedirect('index.php?option=com_config', $msg); break; case 'save' : default : $this->setRedirect('index.php', $msg); break; } // Try to make configuration.php unwriteable //if (!$ftp['enabled'] && JPath::isOwner($fname) && !JPath::setPermissions($fname, '0444')) { if ($config_array['ftp_enable']==0 && !$ftp['enabled'] && JPath::isOwner($fname) && !JPath::setPermissions($fname, '0444')) { JError::raiseNotice('SOME_ERROR_CODE', 'Could not make configuration.php unwritable'); } } /** * Cancel operation */ function cancel() { // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $this->setRedirect( 'index.php' ); } function refreshHelp() { jimport('joomla.filesystem.file'); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); if (($data = file_get_contents('http://help.joomla.org/helpsites-15.xml')) === false ) { $this->setRedirect('index.php?option=com_config', JText::_('HELPREFRESH ERROR FETCH'), 'error'); } else if (!JFile::write(JPATH_BASE.DS.'help'.DS.'helpsites-15.xml', $data)) { $this->setRedirect('index.php?option=com_config', JText::_('HELPREFRESH ERROR STORE'), 'error'); } else { $this->setRedirect('index.php?option=com_config', JText::_('HELPREFRESH SUCCESS')); } } } joomla/joomla/administrator/components/com_config/controllers/component.php0000766000000000000000000000527211234314074030746 0ustar adminadministratorsregisterTask( 'apply', 'save' ); } /** * Show the configuration edit form * @param string The URL option */ function edit() { JRequest::setVar('tmpl', 'component'); //force the component template $component = JRequest::getCmd( 'component' ); if (empty( $component )) { JError::raiseWarning( 500, 'Not a valid component' ); return false; } // load the component's language file $lang = & JFactory::getLanguage(); $lang->load( $component ); $model = $this->getModel('Component' ); $table =& JTable::getInstance('component'); if (!$table->loadByOption( $component )) { JError::raiseWarning( 500, 'Not a valid component' ); return false; } $view = new ConfigViewComponent( ); $view->assignRef('component', $table); $view->setModel( $model, true ); $view->display(); } /** * Save the configuration */ function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $component = JRequest::getCmd( 'component' ); $table =& JTable::getInstance('component'); if (!$table->loadByOption( $component )) { JError::raiseWarning( 500, 'Not a valid component' ); return false; } $post = JRequest::get( 'post' ); $post['option'] = $component; $table->bind( $post ); // pre-save checks if (!$table->check()) { JError::raiseWarning( 500, $table->getError() ); return false; } // save the changes if (!$table->store()) { JError::raiseWarning( 500, $table->getError() ); return false; } //$this->setRedirect( 'index.php?option=com_config', $msg ); $this->edit(); } /** * Cancel operation */ function cancel() { $this->setRedirect( 'index.php' ); } }joomla/joomla/administrator/components/com_config/views/0000777000000000000000000000000011266551177025027 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/component/0000777000000000000000000000000011266551177027031 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/component/view.php0000766000000000000000000000441411234314074030504 0ustar adminadministratorsgetModel(); $params = &$model->getParams(); $component = JComponentHelper::getComponent(JRequest::getCmd( 'component' )); $document = & JFactory::getDocument(); $document->setTitle( JText::_('Edit Preferences') ); JHTML::_('behavior.tooltip'); ?>
    component->name) ?>
    render();?>
    joomla/joomla/administrator/components/com_config/views/index.html0000766000000000000000000000005411234314074027010 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/application/0000777000000000000000000000000011266551200027315 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/application/tmpl/0000777000000000000000000000000011266551203030274 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/application/tmpl/ftp.php0000766000000000000000000000162411234314074031600 0ustar adminadministrators
    ftp)): ?>

    ftp->message); ?>

    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_cache.php0000766000000000000000000000422411234314074033376 0ustar adminadministrators
    cache_handler == 'memcache' || $row->session_handler == 'memcache') : ?>
    :

    :
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_ftp.php0000766000000000000000000000444611234314074033132 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_seo.php0000766000000000000000000000260311234314074033120 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_system.php0000766000000000000000000000323611234314074033661 0ustar adminadministrators
    secret; ?>
    joomla/joomla/administrator/components/com_config/views/application/tmpl/navigation.php0000766000000000000000000000071411234314074033145 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_server.php0000766000000000000000000000310011234314074033631 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_locale.php0000766000000000000000000000115311234314074033570 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_debug.php0000766000000000000000000000152111234314074033416 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_metadata.php0000766000000000000000000000343711234314074034120 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/index.html0000766000000000000000000000005411234314074032267 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/views/application/tmpl/config_site.php0000766000000000000000000000475311234314074033306 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_database.php0000766000000000000000000000436211234314074034102 0ustar adminadministrators
     
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_mail.php0000766000000000000000000000711511234314074033257 0ustar adminadministrators
    joomla/joomla/administrator/components/com_config/views/application/tmpl/config_session.php0000766000000000000000000000200711234314074034013 0ustar adminadministrators
      
    joomla/joomla/administrator/components/com_config/views/application/view.php0000766000000000000000000001036011234314074031002 0ustar adminadministratorsloadByOption( 'com_users' ); $userparams = new JParameter( $table->params, JPATH_ADMINISTRATOR.DS.'components'.DS.'com_users'.DS.'config.xml' ); $table->loadByOption( 'com_media' ); $mediaparams = new JParameter( $table->params, JPATH_ADMINISTRATOR.DS.'components'.DS.'com_media'.DS.'config.xml' ); // Build the component's submenu $contents = ''; $tmplpath = dirname(__FILE__).DS.'tmpl'; ob_start(); require_once($tmplpath.DS.'navigation.php'); $contents = ob_get_contents(); ob_end_clean(); // Set document data $document =& JFactory::getDocument(); $document->setBuffer($contents, 'modules', 'submenu'); // Load settings for the FTP layer jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); ?>
    render('userparams'); ?>
    render('mediaparams'); ?>
    '; return $tip; } } joomla/joomla/administrator/components/com_config/views/application/index.html0000766000000000000000000000005411234314074031313 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/controller.php0000766000000000000000000000155011234314074026554 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/toolbar.config.php0000766000000000000000000000141311234314074027275 0ustar adminadministrators Configuration Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Configuration Manager joomla/joomla/administrator/components/com_config/admin.config.php0000766000000000000000000000271011234314074026724 0ustar adminadministratorsauthorize( 'com_config', 'manage' )) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); // Require specific controller if requested if($controller = JRequest::getWord('controller', 'application')) { $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; if (file_exists($path)) { require_once $path; } else { $controller = ''; } } // Create the controller $classname = 'ConfigController'.ucfirst($controller); $controller = new $classname( ); JResponse::setHeader( 'Expires', 'Mon, 26 Jul 1997 05:00:00 GMT', true ); // Perform the Request task $controller->execute( JRequest::getCmd( 'task' ) ); $controller->redirect();joomla/joomla/administrator/components/com_config/models/0000777000000000000000000000000011266551204025144 5ustar adminadministratorsjoomla/joomla/administrator/components/com_config/models/index.html0000766000000000000000000000005411234314074027136 0ustar adminadministratorsjoomla/joomla/administrator/components/com_config/models/component.php0000766000000000000000000000304711234314074027661 0ustar adminadministratorsloadByOption( $component ); // work out file path if ($path = JRequest::getString( 'path' )) { $path = JPath::clean( JPATH_SITE.DS.$path ); JPath::check( $path ); } else { $option = preg_replace( '#\W#', '', $table->option ); $path = JPATH_ADMINISTRATOR.DS.'components'.DS.$option.DS.'config.xml'; } if (file_exists( $path )) { $instance = new JParameter( $table->params, $path ); } else { $instance = new JParameter( $table->params ); } } return $instance; } }joomla/joomla/administrator/components/com_cpanel/0000777000000000000000000000000011266551172023662 5ustar adminadministratorsjoomla/joomla/administrator/components/com_cpanel/cpanel.xml0000766000000000000000000000107611234314100025632 0ustar adminadministrators Control Panel Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 The Control Panel is the Home Page of the Joomla! Administrator Back-end joomla/joomla/administrator/components/com_cpanel/admin.cpanel.html.php0000766000000000000000000000251011234314100027645 0ustar adminadministrators true)); echo $pane->startPane("content-pane"); foreach ($modules as $module) { $title = $module->title ; echo $pane->startPanel( $title, 'cpanel-panel-'.$module->name ); echo JModuleHelper::renderModule($module); echo $pane->endPanel(); } echo $pane->endPane(); } }joomla/joomla/administrator/components/com_cpanel/admin.cpanel.php0000766000000000000000000000155711234314100026714 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/0000777000000000000000000000000011266551154023477 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/assets/0000777000000000000000000000000011266551155025002 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/assets/medialist-thumbs.css0000766000000000000000000000334511234314106030761 0ustar adminadministrators/** * CSS Document for media manager thumbnail view * @version $Id: medialist-thumbs.css 10387 2008-06-03 10:59:16Z pasamio $ * @package Joomla * @copyright Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software and parts of it may contain or be derived from the * GNU General Public License or other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ div.imgOutline { float: left; border: 1px; border-right: 1px solid #f0f0f0; border-bottom: 1px solid #ccc; width:90px; } div.imgTotal { } div.imgBorder { height: 72px; vertical-align: middle; width: 88px; overflow: hidden; } div.imgBorder a { height: 72px; width: 88px; display: block; } div.imgBorder a:hover { height: 72px; width: 88px; background-color: #f0f0f0; color : #FF6600; } .imgBorderHover { background: #FFFFCC; cursor: hand; } div.controls { text-align: center; height: 20px; line-height: 20px; background: #f9fcf9; border-top: 1px solid #ddd; } div.controls input { vertical-align: middle; } div.controls img { vertical-align: middle; } div.controls:hover { display: block; } div.imginfoBorder { background: #f9f9f9; font-family: Arial, Helvetica, sans-serif; font-size: 10px; width: 88px; height: 15px; vertical-align: middle; text-align: center; overflow: hidden; } div.imgBorder a { cursor: pointer; } .buttonHover { border: 1px solid; border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; cursor: hand; background: #FFFFCC; } .buttonOut { border: 0px; } .imgCaption { font-size: 9pt; text-align: center; } .dirField { font-size: 9pt; width:110px; } div.image { padding-top: 10px; } joomla/joomla/administrator/components/com_media/assets/medialist-details.css0000766000000000000000000000176411234314106031107 0ustar adminadministrators/** * CSS Document for media manager list view * @version $Id: medialist-details.css 10387 2008-06-03 10:59:16Z pasamio $ * @package Joomla * @copyright Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software and parts of it may contain or be derived from the * GNU General Public License or other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ .outline { border: 1px solid #cccccc; background: #ffffff; padding: 2px; } .manager table td, .manager table th { font-family: Arial, helvetica, sans-serif; font-size: 11px; border-right: 1px dashed #E7E7E7; border-bottom: 1px solid #E7E7E7; border-left: 1px solid #fff; text-align: center; } .manager table td.description { text-align: left; } .manager table th { border-top: 1px solid #E7E7E7; border-right: 1px solid #E7E7E7; border-bottom: 1px solid #999; background: #F0F0F0; padding: 4px; color: #666; } joomla/joomla/administrator/components/com_media/assets/popup-imagelist.css0000766000000000000000000000254511234314106030626 0ustar adminadministrators/** * @version $Id: popup-imagelist.css 10387 2008-06-03 10:59:16Z pasamio $ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * ImageManager imagelist styling * * @author Johan Janssens * @package Joomla * @since 1.5 * @version 1.0 */ html, body { margin: 0 !important; padding: 0 !important; font: 10px Tahoma, Verdana, sans-serif; } .item { float: left; border: 1px solid #ccc; margin: 3px; position: relative; } .item a { display: table-cell !important; display: block; width: 80px; height: 90px; overflow: hidden; vertical-align: middle; text-align: center; text-decoration: none; color: black; line-height: 90px; } .item img { display: inline; margin-top: expression(( 80 - this.height ) / 2);} html>body .item img {margin: auto;} .item span { line-height: 100%; clear:both; display: block; width: 100%; position: absolute; bottom: 0; left: 0; padding: 2px 0; background-color: #eee; overflow: hidden; } joomla/joomla/administrator/components/com_media/assets/mediamanager.css0000766000000000000000000000353611234314106030122 0ustar adminadministrators/** * @version $Id: mediamanager.css 10387 2008-06-03 10:59:16Z pasamio $ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * MediaManager javascript behvaior styling * * @author Johan Janssens * @package Joomla * @since 1.5 * @version 1.0 */ #treeview { padding: 10px; width: 190px; overflow: auto; /*height: 390px;*/ border: 0; } #folderview { } #folderview .path { margin-bottom: 10px; } #folderview .view { display: block; margin: 0; padding: 0; height: 360px; } #folderview input#folderpath { width: 65%; background-color: #EEE; } #folderview input#foldername { width: 20%; } #folderview iframe#folderframe { height: 100%; } #uploads .upload { padding: 4px; } /** * Upload Widget CSS */ .upload-queue { list-style: none; } .upload-queue li { background: url(upload.png) no-repeat 0 5px; padding: 5px 0 5px 22px; } .upload-queue .queue-file { font-weight: bold; } .upload-queue .queue-size { color: #aaa; margin-left: 1em; font-size: 0.9em; } .upload-queue .queue-loader { position: relative; margin: 3px 15px; font-size: 0.9em; background-color: #ddd; color: #fff; border: 1px inset #ddd; } .upload-queue .queue-subloader { text-align: center; position: absolute; background-color: #81B466; height: 100%; width: 0%; left: 0; top: 0; } .upload-queue .input-delete { width: 16px; height: 16px; background: url(delete.png) no-repeat 0 0; text-decoration: none; border: none; float: right; } joomla/joomla/administrator/components/com_media/assets/delete.png0000766000000000000000000000131311234314106026735 0ustar adminadministratorsPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<]IDAT8˥KSa[nQP2wܦγL[,biaA\Cv_2MlZFjסNMjmkʷ`&.#z<ϓ bVPT3%I{GqRivȅ tz#E6EddJ`DR2<]N ;4Ѿ;m>78ɀQe6LIt殷cq!z |v j/Xi@ %1|hl !|! Y#uUNw]˼ H3u t]E>k%IfoRD:0`~ | (r on3oG0!$V *[W0_-+ dW&2ZfMFVJpiF&B > Rg- ~ CmڴER ឫ p5ްy+21Kawh` #aZ񽞆TZoLѓ`"(?'ˎJvKކ|:G9[aw82 Jw f'ymzsӘTsw__ιIrIENDB`joomla/joomla/administrator/components/com_media/assets/popup-imagemanager.css0000766000000000000000000000507411234314106031265 0ustar adminadministrators/** * @version $Id: popup-imagemanager.css 10387 2008-06-03 10:59:16Z pasamio $ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * ImageManager javascript behavior styling * * @author Johan Janssens * @package Joomla * @since 1.5 * @version 1.0 */ html, body { background-color: #F0F0F0; color: ButtonText; font: 11px Tahoma, Verdana, sans-serif; margin: 0px !important; padding: 0px !important; } img { border: 0 none; } form { padding: 0px; margin: 0 auto; width: 100%; } fieldset { border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; } button { padding: 3px; border: 1px solid #CCCCCC; font-weight: bold; color: #0B55C4; background-color: white; } button:hover { border: 1px solid #0B55C4; } select,input,button { font: 11px Tahoma, Verdana, sans-serif; } iframe { width: 100%; overflow-x: false; border: 0 none; margin: 0 0 0.5em 0; padding: 0;} iframe#imageframe { height: 195px; } a { padding: 5px; border: 1px solid ButtonFace; } a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; } .buttons { width: 70px; text-align: center; } #f_alt, #f_url, #f_title { width: 22em; } #messages { position: relative; left: 175px; top: 115px; background-color: white; width: 200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; } #message { font-size: 15px; font-weight: bold; color: #69c; } /** * Upload Widget CSS */ .upload-queue { list-style: none; } .upload-queue li { background: url(upload.png) no-repeat 0 5px; padding: 5px 0 5px 5px; } .upload-queue .queue-file { font-weight: bold; } .upload-queue .queue-size { color: #aaa; margin-left: 1em; font-size: 0.9em; } .upload-queue .queue-loader { position: relative; margin: 3px 15px; font-size: 0.9em; background-color: #ddd; color: #fff; border: 1px inset #ddd; } .upload-queue .queue-subloader { text-align: center; position: absolute; background-color: #81B466; height: 100%; width: 0%; left: 0; top: 0; } .upload-queue .input-delete { width: 16px; height: 16px; background: url(delete.png) no-repeat 0 0; text-decoration: none; border: none; float: right; } joomla/joomla/administrator/components/com_media/assets/progress.gif0000766000000000000000000000142611234314106027325 0ustar adminadministratorsGIF89a! NETSCAPE2.0!,7D ~z *Y+yMgN,z8*۷6UH!z]IS!,7#{4Ft6bԮ(`jltBQ!,4{TcIkNy9\灩6*4u~sUhC!,6!sX^v7(5یdhI.fCx^!,5!sXMcIyhsc؆#Ig{n(C֊=F!,6 z/*FE3eR#PVcꜬbb}k['k0CBf!,6!"{.F]8o4ezdG}@⸱*WHm~MzV?X8-$!,5 r"hHjjx8e'^)jH,E. k]x8ԏt@!,4!xٞūnNiZ 荨bi;j.;sr]仠!,5T˝"*ċMZ_Y般g\a49m~='CL;joomla/joomla/administrator/components/com_media/assets/index.html0000766000000000000000000000005411234314106026763 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/assets/popup-imagemanager.js0000766000000000000000000001366211234314106031113 0ustar adminadministrators/** * @version $Id: popup-imagemanager.js 10702 2008-08-21 09:31:31Z eddieajau $ * @package Joomla * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * JImageManager behavior for media component * * @package Joomla.Extensions * @subpackage Media * @since 1.5 */ var ImageManager = { initialize: function() { o = this._getUriObject(window.self.location.href); //console.log(o); q = $H(this._getQueryObject(o.query)); this.editor = decodeURIComponent(q.get('e_name')); // Setup image manager fields object this.fields = new Object(); this.fields.url = $("f_url"); this.fields.alt = $("f_alt"); this.fields.align = $("f_align"); this.fields.title = $("f_title"); this.fields.caption = $("f_caption"); // Setup image listing objects this.folderlist = $('folderlist'); this.frame = window.frames['imageframe']; this.frameurl = this.frame.location.href; // Setup imave listing frame this.imageframe = $('imageframe'); this.imageframe.manager = this; this.imageframe.addEvent('load', function(){ ImageManager.onloadimageview(); }); // Setup folder up button this.upbutton = $('upbutton'); this.upbutton.removeEvents('click'); this.upbutton.addEvent('click', function(){ ImageManager.upFolder(); }); }, onloadimageview: function() { // Update the frame url this.frameurl = this.frame.location.href; var folder = this.getImageFolder(); for(var i = 0; i < this.folderlist.length; i++) { if(folder == this.folderlist.options[i].value) { this.folderlist.selectedIndex = i; break; } } a = this._getUriObject($('uploadForm').getProperty('action')); //console.log(a); q = $H(this._getQueryObject(a.query)); q.set('folder', folder); var query = []; q.each(function(v, k){ if ($chk(v)) { this.push(k+'='+v); } }, query); a.query = query.join('&'); $('uploadForm').setProperty('action', a.scheme+'://'+a.domain+a.path+'?'+a.query); }, getImageFolder: function() { var url = this.frame.location.search.substring(1); var args = this.parseQuery(url); return args['folder']; }, onok: function() { extra = ''; // Get the image tag field information var url = this.fields.url.getValue(); var alt = this.fields.alt.getValue(); var align = this.fields.align.getValue(); var title = this.fields.title.getValue(); var caption = this.fields.caption.getValue(); if (url != '') { // Set alt attribute if (alt != '') { extra = extra + 'alt="'+alt+'" '; } else { extra = extra + 'alt="" '; } // Set align attribute if (align != '') { extra = extra + 'align="'+align+'" '; } // Set align attribute if (title != '') { extra = extra + 'title="'+title+'" '; } // Set align attribute if (caption != '') { extra = extra + 'class="caption" '; } var tag = ""; } window.parent.jInsertEditorText(tag, this.editor); return false; }, setFolder: function(folder) { //this.showMessage('Loading'); for(var i = 0; i < this.folderlist.length; i++) { if(folder == this.folderlist.options[i].value) { this.folderlist.selectedIndex = i; break; } } this.frame.location.href='index.php?option=com_media&view=imagesList&tmpl=component&folder=' + folder; }, getFolder: function() { return this.folderlist.getValue(); }, upFolder: function() { var currentFolder = this.getFolder(); if(currentFolder.length < 2) { return false; } var folders = currentFolder.split('/'); var search = ''; for(var i = 0; i < folders.length - 1; i++) { search += folders[i]; search += '/'; } // remove the trailing slash search = search.substring(0, search.length - 1); for(var i = 0; i < this.folderlist.length; i++) { var thisFolder = this.folderlist.options[i].value; if(thisFolder == search) { this.folderlist.selectedIndex = i; var newFolder = this.folderlist.options[i].value; this.setFolder(newFolder); break; } } }, populateFields: function(file) { $("f_url").value = image_base_path+file; }, showMessage: function(text) { var message = $('message'); var messages = $('messages'); if(message.firstChild) message.removeChild(message.firstChild); message.appendChild(document.createTextNode(text)); messages.style.display = "block"; }, parseQuery: function(query) { var params = new Object(); if (!query) { return params; } var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var KeyVal = pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) { continue; } var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ).replace(/\+ /g, ' '); params[key] = val; } return params; }, refreshFrame: function() { this._setFrameUrl(); }, _setFrameUrl: function(url) { if ($chk(url)) { this.frameurl = url; } this.frame.location.href = this.frameurl; }, _getQueryObject: function(q) { var vars = q.split(/[&;]/); var rs = {}; if (vars.length) vars.each(function(val) { var keys = val.split('='); if (keys.length && keys.length == 2) rs[encodeURIComponent(keys[0])] = encodeURIComponent(keys[1]); }); return rs; }, _getUriObject: function(u){ var bits = u.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/); return (bits) ? bits.associate(['uri', 'scheme', 'authority', 'domain', 'port', 'path', 'directory', 'file', 'query', 'fragment']) : null; } }; window.addEvent('domready', function(){ ImageManager.initialize(); }); joomla/joomla/administrator/components/com_media/assets/mediamanager.js0000766000000000000000000001324411234314106027743 0ustar adminadministrators/** * @version $Id: mediamanager.js 10710 2008-08-21 10:08:12Z eddieajau $ * @package Joomla * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * JMediaManager behavior for media component * * @package Joomla.Extensions * @subpackage Media * @since 1.5 */ var MediaManager = { initialize: function() { this.folderframe = $('folderframe'); this.folderpath = $('folderpath'); this.updatepaths = $$('input.update-folder'); this.frame = window.frames['folderframe']; this.frameurl = this.frame.location.href; //this.frameurl = window.frames['folderframe'].location.href; this.tree = new MooTreeControl({ div: 'media-tree_tree', mode: 'folders', grid: true, theme: 'components/com_media/assets/mootree.gif', onClick: function(node){ target = $chk(node.data.target) ? node.data.target : '_self'; window.frames[target].location.href = node.data.url; } },{ text: 'Media', open: true, data: { url: 'index.php?option=com_media&view=mediaList&tmpl=component', target: 'folderframe'}}); this.tree.adopt('media-tree'); }, submit: function(task) { form = window.frames['folderframe'].document.getElementById('mediamanager-form'); form.task.value = task; if ($('username')) { form.username.value = $('username').value; form.password.value = $('password').value; } form.submit(); }, onloadframe: function() { // Update the frame url this.frameurl = this.frame.location.href; var folder = this.getFolder(); if (folder) { this.updatepaths.each(function(path){ path.value =folder; }); this.folderpath.value = basepath+'/'+folder; node = this.tree.get('node_'+folder); node.toggle(false, true); } else { this.updatepaths.each(function(path){ path.value = ''; }); this.folderpath.value = basepath; node = this.tree.root; } if (node) { this.tree.select(node, true); } $(viewstyle).addClass('active'); a = this._getUriObject($('uploadForm').getProperty('action')); q = $H(this._getQueryObject(a.query)); q.set('folder', folder); var query = []; q.each(function(v, k){ if ($chk(v)) { this.push(k+'='+v); } }, query); a.query = query.join('&'); if (a.port) { $('uploadForm').setProperty('action', a.scheme+'://'+a.domain+':'+a.port+a.path+'?'+a.query); } else { $('uploadForm').setProperty('action', a.scheme+'://'+a.domain+a.path+'?'+a.query); } }, oncreatefolder: function() { if ($('foldername').value.length) { $('dirpath').value = this.getFolder(); submitbutton('createfolder'); } }, setViewType: function(type) { $(type).addClass('active'); $(viewstyle).removeClass('active'); viewstyle = type; var folder = this.getFolder(); this._setFrameUrl('index.php?option=com_media&view=mediaList&tmpl=component&folder='+folder+'&layout='+type); }, refreshFrame: function() { this._setFrameUrl(); }, getFolder: function() { var url = this.frame.location.search.substring(1); var args = this.parseQuery(url); if (args['folder'] == "undefined") { args['folder'] = ""; } return args['folder']; }, parseQuery: function(query) { var params = new Object(); if (!query) { return params; } var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var KeyVal = pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) { continue; } var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ).replace(/\+ /g, ' '); params[key] = val; } return params; }, _setFrameUrl: function(url) { if ($chk(url)) { this.frameurl = url; } this.frame.location.href = this.frameurl; }, _getQueryObject: function(q) { var vars = q.split(/[&;]/); var rs = {}; if (vars.length) vars.each(function(val) { var keys = val.split('='); if (keys.length && keys.length == 2) rs[encodeURIComponent(keys[0])] = encodeURIComponent(keys[1]); }); return rs; }, _getUriObject: function(u){ var bits = u.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/); return (bits) ? bits.associate(['uri', 'scheme', 'authority', 'domain', 'port', 'path', 'directory', 'file', 'query', 'fragment']) : null; } }; window.addEvent('domready', function(){ // Added to populate data on iframe load MediaManager.initialize(); MediaManager.trace = 'start'; document.updateUploader = function() { MediaManager.onloadframe(); }; MediaManager.onloadframe(); }); joomla/joomla/administrator/components/com_media/assets/upload.png0000766000000000000000000000136611234314106026767 0ustar adminadministratorsPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDAT8ˍkTWsg8ƷAmZ(RqB]UhtJB)?P .ˊ-Q4ąbiLRcHd2{"/Ňs?/WzX!-7=GnJS࿒ sʃ5`J$9u 3Nֻa-zGNtvX70p4:ZuSrQvvIENDB`joomla/joomla/administrator/components/com_media/assets/mootree.gif0000766000000000000000000003476711234314106027151 0ustar adminadministratorsGIF89aWm.@Y␐ssșཽغ{=U͑ɭxzLoIŠɫjޤ˄ڹ|ҕηuٝzg@ԾҶ|^Ε昹uכǿ_vQКEq]5ūT6ѲsY}ؼȋwBֵٮǝg߿j灛IƲÅ洰Wˬkċ۟Rԗ`zTĦca+<넄ַx׽Ӵuťd۽~ưSħkvb:zHsM޽}XE|hAϪɬq`n+B! XMP DataXMP Adobe Fireworks CS3 2007-01-04T22:10:31Z 2007-08-31T03:57:19Z image/gif ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<:9876543210/.-,+*)('&%$#"!  !, 8LȰ`C JH`Ċ)fȱǏ n8aɆ'C1eBHAdƗ@sbʤiʣ [*RM 65Rƈ4 Am ZŪSQY2}iܤs'7WsD6po߿ y˘-gxg+uaQ1"(ΟC.#݇D$x @@w[7oM1q /ox$[DhC{`"8'Ouփ`Cȋ ?rTؐ__WQ2CG@` 2MbN^1a - AU [(@ /p0>$# h E2h56AH0h,AwTOtdK $CAЎ^RjdFo%yfifde^lRu})(|i@(1BUO-dikPP@>餕24ʦFpo6*j cbR4p&+eñnD!jϒ駌Cj,۬а  D& oBKPNTy0!FjbxzNCoRjf$Pwcp1B ,l!<xTZ@ ; @l(j((,&İlsfpI:Ne\[ h!pA)Qjenv,+qv]CߘwADP$>7X| 6ևEm8Lr.8䀿Tv >oBXĎ79mN ^Ԡ:tan祢 JЃ< AjSORB}0t}o?J+t7H I7ֈP)A^eW:Q ;joomla/joomla/administrator/components/com_media/helpers/0000777000000000000000000000000011266551154025141 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/helpers/index.html0000766000000000000000000000005411234314110027116 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/helpers/media.php0000766000000000000000000001363611234314110026723 0ustar adminadministratorsget( 'upload_extensions' )); $ignored = explode(',', $params->get( 'ignore_extensions' )); if (!in_array($format, $allowable) && !in_array($format,$ignored)) { $err = 'WARNFILETYPE'; return false; } $maxSize = (int) $params->get( 'upload_maxsize', 0 ); if ($maxSize > 0 && (int) $file['size'] > $maxSize) { $err = 'WARNFILETOOLARGE'; return false; } $user = JFactory::getUser(); $imginfo = null; if($params->get('restrict_uploads',1) ) { $images = explode( ',', $params->get( 'image_extensions' )); if(in_array($format, $images)) { // if its an image run it through getimagesize if(($imginfo = getimagesize($file['tmp_name'])) === FALSE) { $err = 'WARNINVALIDIMG'; return false; } } else if(!in_array($format, $ignored)) { // if its not an image...and we're not ignoring it $allowed_mime = explode(',', $params->get('upload_mime')); $illegal_mime = explode(',', $params->get('upload_mime_illegal')); if(function_exists('finfo_open') && $params->get('check_mime',1)) { // We have fileinfo $finfo = finfo_open(FILEINFO_MIME); $type = finfo_file($finfo, $file['tmp_name']); if(strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) { $err = 'WARNINVALIDMIME'; return false; } finfo_close($finfo); } else if(function_exists('mime_content_type') && $params->get('check_mime',1)) { // we have mime magic $type = mime_content_type($file['tmp_name']); if(strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) { $err = 'WARNINVALIDMIME'; return false; } } else if(!$user->authorize( 'login', 'administrator' )) { $err = 'WARNNOTADMIN'; return false; } } } $xss_check = JFile::read($file['tmp_name'],false,256); $html_tags = array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE', '!--'); foreach($html_tags as $tag) { // A tag is '' if(stristr($xss_check, '<'.$tag.' ') || stristr($xss_check, '<'.$tag.'>')) { $err = 'WARNIEXSS'; return false; } } return true; } function parseSize($size) { if ($size < 1024) { return $size . ' bytes'; } else { if ($size >= 1024 && $size < 1024 * 1024) { return sprintf('%01.2f', $size / 1024.0) . ' Kb'; } else { return sprintf('%01.2f', $size / (1024.0 * 1024)) . ' Mb'; } } } function imageResize($width, $height, $target) { //takes the larger size of the width and height and applies the //formula accordingly...this is so this script will work //dynamically with any size image if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } //gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); return array($width, $height); } function countFiles( $dir ) { $total_file = 0; $total_dir = 0; if (is_dir($dir)) { $d = dir($dir); while (false !== ($entry = $d->read())) { if (substr($entry, 0, 1) != '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) && strpos($entry, '.html') === false && strpos($entry, '.php') === false) { $total_file++; } if (substr($entry, 0, 1) != '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry)) { $total_dir++; } } $d->close(); } return array ( $total_file, $total_dir ); } }joomla/joomla/administrator/components/com_media/controllers/0000777000000000000000000000000011266551154026045 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/controllers/index.html0000766000000000000000000000005411234314106030027 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/controllers/file.php0000766000000000000000000001261411234314106027467 0ustar adminadministratorsaddEntry(array('comment' => 'Invalid: '.$filepath.': '.$err)); header('HTTP/1.0 415 Unsupported Media Type'); jexit('Error. Unsupported Media Type!'); } else { JError::raiseNotice(100, JText::_($err)); // REDIRECT if ($return) { $mainframe->redirect(base64_decode($return).'&folder='.$folder); } return; } } if (JFile::exists($filepath)) { if ($format == 'json') { jimport('joomla.error.log'); $log = &JLog::getInstance('upload.error.php'); $log->addEntry(array('comment' => 'File already exists: '.$filepath)); header('HTTP/1.0 409 Conflict'); jexit('Error. File already exists'); } else { JError::raiseNotice(100, JText::_('Error. File already exists')); // REDIRECT if ($return) { $mainframe->redirect(base64_decode($return).'&folder='.$folder); } return; } } if (!JFile::upload($file['tmp_name'], $filepath)) { if ($format == 'json') { jimport('joomla.error.log'); $log = &JLog::getInstance('upload.error.php'); $log->addEntry(array('comment' => 'Cannot upload: '.$filepath)); header('HTTP/1.0 400 Bad Request'); jexit('Error. Unable to upload file'); } else { JError::raiseWarning(100, JText::_('Error. Unable to upload file')); // REDIRECT if ($return) { $mainframe->redirect(base64_decode($return).'&folder='.$folder); } return; } } else { if ($format == 'json') { jimport('joomla.error.log'); $log = &JLog::getInstance(); $log->addEntry(array('comment' => $folder)); jexit('Upload complete'); } else { $mainframe->enqueueMessage(JText::_('Upload complete')); // REDIRECT if ($return) { $mainframe->redirect(base64_decode($return).'&folder='.$folder); } return; } } } else { $mainframe->redirect('index.php', 'Invalid Request', 'error'); } } /** * Deletes paths from the current path * * @param string $listFolder The image directory to delete a file from * @since 1.5 */ function delete() { global $mainframe; JRequest::checkToken( 'request' ) or jexit( 'Invalid Token' ); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); // Get some data from the request $tmpl = JRequest::getCmd( 'tmpl' ); $paths = JRequest::getVar( 'rm', array(), '', 'array' ); $folder = JRequest::getVar( 'folder', '', '', 'path'); // Initialize variables $msg = array(); $ret = true; if (count($paths)) { foreach ($paths as $path) { if ($path !== JFile::makeSafe($path)) { JError::raiseWarning(100, JText::_('Unable to delete:').htmlspecialchars($path, ENT_COMPAT, 'UTF-8').' '.JText::_('WARNFILENAME')); continue; } $fullPath = JPath::clean(COM_MEDIA_BASE.DS.$folder.DS.$path); if (is_file($fullPath)) { $ret |= !JFile::delete($fullPath); } else if (is_dir($fullPath)) { $files = JFolder::files($fullPath, '.', true); $canDelete = true; foreach ($files as $file) { if ($file != 'index.html') { $canDelete = false; } } if ($canDelete) { $ret |= !JFolder::delete($fullPath); } else { JError::raiseWarning(100, JText::_('Unable to delete:').$fullPath.' '.JText::_('Not Empty!')); } } } } if ($tmpl == 'component') { // We are inside the iframe $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component'); } else { $mainframe->redirect('index.php?option=com_media&folder='.$folder); } } } joomla/joomla/administrator/components/com_media/controllers/folder.php0000766000000000000000000000734711234314106030032 0ustar adminadministratorsredirect('index.php?option=com_media&view=mediaList&folder='.$folder.'&tmpl=component'); } else { $mainframe->redirect('index.php?option=com_media&folder='.$folder); } } /** * Create a folder * * @param string $path Path of the folder to create * @since 1.5 */ function create() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $folder = JRequest::getCmd( 'foldername', ''); $folderCheck = JRequest::getVar( 'foldername', null, '', 'string', JREQUEST_ALLOWRAW); $parent = JRequest::getVar( 'folderbase', '', '', 'path' ); JRequest::setVar('folder', $parent); if (($folderCheck !== null) && ($folder !== $folderCheck)) { $mainframe->redirect('index.php?option=com_media&folder='.$parent, JText::_('WARNDIRNAME')); } if (strlen($folder) > 0) { $path = JPath::clean(COM_MEDIA_BASE.DS.$parent.DS.$folder); if (!is_dir($path) && !is_file($path)) { jimport('joomla.filesystem.*'); JFolder::create($path); JFile::write($path.DS."index.html", "\n\n\n"); } JRequest::setVar('folder', ($parent) ? $parent.'/'.$folder : $folder); } $mainframe->redirect('index.php?option=com_media&folder='.$parent); } } joomla/joomla/administrator/components/com_media/views/0000777000000000000000000000000011266551145024634 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/imageslist/0000777000000000000000000000000011266551145026775 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/imageslist/tmpl/0000777000000000000000000000000011266551145027751 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/imageslist/tmpl/default.php0000766000000000000000000000134211234314106032074 0ustar adminadministrators images) > 0 || count($this->folders) > 0) { ?>
    folders); $i<$n; $i++) : $this->setFolder($i); echo $this->loadTemplate('folder'); endfor; ?> images); $i<$n; $i++) : $this->setImage($i); echo $this->loadTemplate('image'); endfor; ?>
    joomla/joomla/administrator/components/com_media/views/imageslist/tmpl/default_image.php0000766000000000000000000000103011234314106033230 0ustar adminadministrators joomla/joomla/administrator/components/com_media/views/imageslist/tmpl/default_folder.php0000766000000000000000000000065511234314106033435 0ustar adminadministrators joomla/joomla/administrator/components/com_media/views/imageslist/tmpl/index.html0000766000000000000000000000005411234314106031733 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/imageslist/view.html.php0000766000000000000000000000362011234314106031412 0ustar adminadministratorsgetClientId() == 1) $append = 'administrator/'; JHTML::_('behavior.mootools'); JHTML::_('stylesheet', 'popup-imagelist.css', $append .'components/com_media/assets/'); $document =& JFactory::getDocument(); $document->addScriptDeclaration("var ImageManager = window.parent.ImageManager;"); $this->assign('baseURL', COM_MEDIA_BASEURL); $this->assignRef('images', $this->get('images')); $this->assignRef('folders', $this->get('folders')); $this->assignRef('state', $this->get('state')); parent::display($tpl); } function setFolder($index = 0) { if (isset($this->folders[$index])) { $this->_tmp_folder = &$this->folders[$index]; } else { $this->_tmp_folder = new JObject; } } function setImage($index = 0) { if (isset($this->images[$index])) { $this->_tmp_img = &$this->images[$index]; } else { $this->_tmp_img = new JObject; } } } joomla/joomla/administrator/components/com_media/views/imageslist/index.html0000766000000000000000000000005411234314106030757 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/images/0000777000000000000000000000000011266551145026101 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/images/tmpl/0000777000000000000000000000000011266551146027056 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/images/tmpl/default.php0000766000000000000000000001055611234314106031207 0ustar adminadministrators
    folderList; ?>
    get('allowed_media_usergroup')) { case '1': $acl->addACL( 'com_media', 'upload', 'users', 'publisher' ); break; case '2': $acl->addACL( 'com_media', 'upload', 'users', 'publisher' ); $acl->addACL( 'com_media', 'upload', 'users', 'editor' ); break; case '3': $acl->addACL( 'com_media', 'upload', 'users', 'publisher' ); $acl->addACL( 'com_media', 'upload', 'users', 'editor' ); $acl->addACL( 'com_media', 'upload', 'users', 'author' ); break; case '4': $acl->addACL( 'com_media', 'upload', 'users', 'publisher' ); $acl->addACL( 'com_media', 'upload', 'users', 'editor' ); $acl->addACL( 'com_media', 'upload', 'users', 'author' ); $acl->addACL( 'com_media', 'upload', 'users', 'registered' ); break; } ?> authorize('com_media', 'upload')); ?>
    joomla/joomla/administrator/components/com_media/views/images/tmpl/index.html0000766000000000000000000000005411234314106031037 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/images/view.html.php0000766000000000000000000000366311234314106030525 0ustar adminadministratorsgetClientId() == 1) $append = 'administrator/'; JHTML::_('script' , 'popup-imagemanager.js', $append .'components/com_media/assets/'); JHTML::_('stylesheet', 'popup-imagemanager.css', $append .'components/com_media/assets/'); if ($config->get('enable_flash', 0)) { JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ ImageManager.refreshFrame(); }')); } /* * Display form for FTP credentials? * Don't set them here, as there are other functions called before this one if there is any file write operation */ jimport('joomla.client.helper'); $ftp = !JClientHelper::hasCredentials('ftp'); $this->assignRef( 'session', JFactory::getSession()); $this->assignRef( 'config', $config); $this->assignRef( 'state', $this->get('state')); $this->assignRef( 'folderList', $this->get('folderList')); $this->assign('require_ftp', $ftp); parent::display($tpl); } } joomla/joomla/administrator/components/com_media/views/images/index.html0000766000000000000000000000005411234314106030063 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/media/0000777000000000000000000000000011266551144025712 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/media/tmpl/0000777000000000000000000000000011266551145026667 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/media/tmpl/default.php0000766000000000000000000001112111234314106031006 0ustar adminadministrators
    loadTemplate('folders'); ?>
    require_ftp): ?>
    /
    user->authorize('com_media', 'upload')); ?>
    [  config->get('upload_maxsize') / 1000000); ?>M ]
    joomla/joomla/administrator/components/com_media/views/media/tmpl/default_folders.php0000766000000000000000000000072611234314106032535 0ustar adminadministrators
      folders_id; ?>> folders['children'] as $folder) : ?>
    • name; ?>getFolderLevel($folder); ?>
    joomla/joomla/administrator/components/com_media/views/media/tmpl/index.html0000766000000000000000000000005411234314106030651 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/media/view.html.php0000766000000000000000000000744111234314106030335 0ustar adminadministratorsgetUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); $listStyle = " "; $document =& JFactory::getDocument(); $document->setBuffer($listStyle, 'modules', 'submenu'); JHTML::_('behavior.mootools'); $document->addScript('components/com_media/assets/mediamanager.js'); $document->addStyleSheet('components/com_media/assets/mediamanager.css'); JHTML::_('behavior.modal'); $document->addScriptDeclaration(" window.addEvent('domready', function() { document.preview = SqueezeBox; });"); JHTML::script('mootree.js'); JHTML::stylesheet('mootree.css'); if ($config->get('enable_flash', 0)) { JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }')); } if(DS == '\\') { $base = str_replace(DS,"\\\\",COM_MEDIA_BASE); } else { $base = COM_MEDIA_BASE; } $js = " var basepath = '".$base."'; var viewstyle = '".$style."'; " ; $document->addScriptDeclaration($js); /* * Display form for FTP credentials? * Don't set them here, as there are other functions called before this one if there is any file write operation */ jimport('joomla.client.helper'); $ftp = !JClientHelper::hasCredentials('ftp'); $this->assignRef('session', JFactory::getSession()); $this->assignRef('config', $config); $this->assignRef('state', $this->get('state')); $this->assign('require_ftp', $ftp); $this->assign('folders_id', ' id="media-tree"'); $this->assign('folders', $this->get('folderTree')); $user =& JFactory::getUser(); $this->assignRef('user', $user); // Set the toolbar $this->_setToolBar(); parent::display($tpl); echo JHTML::_('behavior.keepalive'); } function _setToolBar() { // Get the toolbar object instance $bar =& JToolBar::getInstance('toolbar'); // Set the titlebar text JToolBarHelper::title( JText::_( 'Media Manager' ), 'mediamanager.png'); // Add a delete button $title = JText::_('Delete'); $dhtml = " $title"; $bar->appendButton( 'Custom', $dhtml, 'delete' ); // Add a popup configuration button JToolBarHelper::help( 'screen.mediamanager' ); } function getFolderLevel($folder) { $this->folders_id = null; $txt = null; if (isset($folder['children']) && count($folder['children'])) { $tmp = $this->folders; $this->folders = $folder; $txt = $this->loadTemplate('folders'); $this->folders = $tmp; } return $txt; } } joomla/joomla/administrator/components/com_media/views/media/index.html0000766000000000000000000000005411234314106027675 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/medialist/0000777000000000000000000000000011266551143026605 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/medialist/tmpl/0000777000000000000000000000000011266551144027562 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/medialist/tmpl/details_img.php0000766000000000000000000000270011234314106032542 0ustar adminadministrators <?php echo $this->_tmp_img->name; ?> - <?php echo MediaHelper::parseSize($this->_tmp_img->size); ?> escape( $this->_tmp_img->name); ?> _tmp_img->width; ?> x _tmp_img->height; ?> _tmp_img->size); ?> <?php echo JText::_( 'Delete' ); ?> joomla/joomla/administrator/components/com_media/views/medialist/tmpl/default.php0000766000000000000000000000000011234314106031674 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/medialist/tmpl/details.php0000766000000000000000000000233511234314106031712 0ustar adminadministrators
    loadTemplate('up'); ?> folders); $i<$n; $i++) : $this->setFolder($i); echo $this->loadTemplate('folder'); endfor; ?> documents); $i<$n; $i++) : $this->setDoc($i); echo $this->loadTemplate('doc'); endfor; ?> images); $i<$n; $i++) : $this->setImage($i); echo $this->loadTemplate('img'); endfor; ?>
    joomla/joomla/administrator/components/com_media/views/medialist/tmpl/thumbs_up.php0000766000000000000000000000127111234314106032271 0ustar adminadministrators
     
    ..
    joomla/joomla/administrator/components/com_media/views/medialist/tmpl/thumbs_img.php0000766000000000000000000000277511234314106032433 0ustar adminadministrators joomla/joomla/administrator/components/com_media/views/medialist/tmpl/details_up.php0000766000000000000000000000114311234314106032412 0ustar adminadministrators .. ..       joomla/joomla/administrator/components/com_media/views/medialist/tmpl/index.html0000766000000000000000000000005411234314106031545 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/views/medialist/tmpl/details_doc.php0000766000000000000000000000165011234314106032536 0ustar adminadministrators <?php echo $this->_tmp_doc->name; ?> _tmp_doc->name; ?>   _tmp_doc->size); ?> <?php echo JText::_( 'Delete' ); ?> joomla/joomla/administrator/components/com_media/views/medialist/tmpl/thumbs_doc.php0000766000000000000000000000172011234314106032411 0ustar adminadministrators
    <?php echo JText::_( 'Delete' ); ?>
    _tmp_doc->name; ?>
    joomla/joomla/administrator/components/com_media/views/medialist/tmpl/thumbs_folder.php0000766000000000000000000000254411234314106033124 0ustar adminadministrators joomla/joomla/administrator/components/com_media/views/medialist/tmpl/details_folder.php0000766000000000000000000000242411234314106033244 0ustar adminadministrators <?php echo $this->_tmp_folder->name; ?> _tmp_folder->name; ?>     <?php echo JText::_( 'Delete' ); ?> joomla/joomla/administrator/components/com_media/views/medialist/tmpl/thumbs.php0000766000000000000000000000160211234314106031563 0ustar adminadministrators
    loadTemplate('up'); ?> folders); $i<$n; $i++) : $this->setFolder($i); echo $this->loadTemplate('folder'); endfor; ?> documents); $i<$n; $i++) : $this->setDoc($i); echo $this->loadTemplate('doc'); endfor; ?> images); $i<$n; $i++) : $this->setImage($i); echo $this->loadTemplate('img'); endfor; ?>
    joomla/joomla/administrator/components/com_media/views/medialist/view.html.php0000766000000000000000000000452311234314106031227 0ustar adminadministratorsgetUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); JHTML::_('behavior.mootools'); $document = &JFactory::getDocument(); $document->addStyleSheet('components/com_media/assets/medialist-'.$style.'.css'); $document->addScriptDeclaration(" window.addEvent('domready', function() { window.top.document.updateUploader && window.top.document.updateUploader(); $$('a.img-preview').each(function(el) { el.addEvent('click', function(e) { new Event(e).stop(); window.top.document.preview.fromElement(el); }); }); });"); $this->assign('baseURL', JURI::root()); $this->assignRef('images', $this->get('images')); $this->assignRef('documents', $this->get('documents')); $this->assignRef('folders', $this->get('folders')); $this->assignRef('state', $this->get('state')); parent::display($tpl); } function setFolder($index = 0) { if (isset($this->folders[$index])) { $this->_tmp_folder = &$this->folders[$index]; } else { $this->_tmp_folder = new JObject; } } function setImage($index = 0) { if (isset($this->images[$index])) { $this->_tmp_img = &$this->images[$index]; } else { $this->_tmp_img = new JObject; } } function setDoc($index = 0) { if (isset($this->documents[$index])) { $this->_tmp_doc = &$this->documents[$index]; } else { $this->_tmp_doc = new JObject; } } } joomla/joomla/administrator/components/com_media/views/medialist/index.html0000766000000000000000000000005411234314106030571 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/controller.php0000766000000000000000000000402111234314106026356 0ustar adminadministratorsgetUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); break; case 'media': default: $vName = 'media'; $vLayout = JRequest::getCmd( 'layout', 'default' ); $mName = 'manager'; break; } $document = &JFactory::getDocument(); $vType = $document->getType(); // Get/Create the view $view = &$this->getView( $vName, $vType); // Get/Create the model if ($model = &$this->getModel($mName)) { // Push the model into the view (as default) $view->setModel($model, true); } // Set the layout $view->setLayout($vLayout); // Display the view $view->display(); } function ftpValidate() { // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); } } joomla/joomla/administrator/components/com_media/images/0000777000000000000000000000000011266551151024741 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/images/terminal_16.png0000766000000000000000000000135411234314110027557 0ustar adminadministratorsPNG  IHDRaIDAT8OY{o< 0vE (@+"OMJA.#jKK(Zpc)B Yk1#EZl+ܟ=h#c@y R B!ZC!B1j{zg@phJ%()%4c a¶mނsܩHRJXq!RR(e$AلR /i²,F#DQJ)lF& .fi"sx4!L 㻌sbu11!ǘp8c ZkH)Ql6 |)%8sdY,˰2[#PJFPJ!"FJ)ضNYBieFP(,T*H)QE@u>VWWhZ0Miq j5\__q$9<4 c`dR,RJs]W* I9dY`0x}ttP(/..B~nt]w|pphi9?+pssX," xggJ? E6vwwUwݿ ÈJғ"KшzurjjO BחIENDB`joomla/joomla/administrator/components/com_media/images/edit_trash.gif0000766000000000000000000000022111234314106027542 0ustar adminadministratorsGIF89a3ff3fOOOӭ!,>IhL rlA@, /1 oroCI $;syZlN";joomla/joomla/administrator/components/com_media/images/folderup_32.png0000766000000000000000000000345111234314110027562 0ustar adminadministratorsPNG  IHDR szzIDATX͖]lTqw~kcX+6B (VZHRڗŨi%"7TUV}@y(HiPP/Q< lC^)xozݽW [Ř#;3f̜!|Ft-VRF 42 0$N [)=Ka}? 9:}؛Շguin#GZp,t>c W?= Yf͎G˾h PLX4\h:;ըn*~=vpU *%/ 2f7]@ u@(UnEqVy%RWdmʏT$6kjjC(P|G,,h ʪlp[-p8Ǻ@36h^Ub F'?[L} *@dM. Uk*Wڛ@ _=DRI!k!؎۾$h`+w*d*F Y+A4V0 H( Lk /~ WznaĹG'a  Rؾ ).e4Dff:89{q ݟ,EݛXMAH9up<,|Кm2o\< )ρqCZ},9PKr-&YVOVVQF+B5\X>ujUꗖ'ًo~^P^.ʉ lP,C/@#=̊,Ʋ2pg .Ju;:k^?|5ZOwFWR,>Zs#F_wR[;8qtuu7oҙ'Z{R$ =пs۶u45UUU۷455Ҏ611s%J)Kk͍1pc ͘V0" ;YBPTAsi۶())۶mmmmqqJ8\)ŔRNp뎸1rFcdtc u]Nu"ϟ RNΜ9ClyGLkM ZỏLB !DSJ5T3ƔSwRkjj={tKKK>Cm@ݡIENDB`joomla/joomla/administrator/components/com_media/images/spreadsheet_16.png0000766000000000000000000000104111234314106030251 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEٺܽøֳܶΞӤĽܬَ։Áʎyw`qsUmm~nbqZiTbbqSz[8}L3J:tRNSɦ pHYs B4tEXtSoftwareMacromedia Fireworks 8hxIDATE0 EۤM]c;='/7i!IXe4Z`aRoO }G@ g)t,RJc&+tvZ!e5ˁu4οf!zR OZ٨\Z)IENDB`joomla/joomla/administrator/components/com_media/images/uploading.gif0000766000000000000000000000202611234314110027376 0ustar adminadministratorsGIF89a0̵ޜޔތք{ff! NETSCAPE2.0!,0 "dihlp,@mx|pH,DƤrl:5$tJZ7)vzqگxLV:X3|N)PԖO;]5=[P2xb'#M/ a mWV_ }SgUؾˁ&0+/0F PU%`׭d` @N]1h5#cs%/{6ק; hKJk@ F/FcqNHiX썋QPa[=?b#絒^.jX$LՍ2Y4`PQ@w&OamWV<@x]I @xCd7A4@ $EEGj q  eAI)v9Jz~g %:I~Idh" !N*Hhw駠*ꨤ!,| I$4bzk! ,0$dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~7 $$ c#d!;joomla/joomla/administrator/components/com_media/images/btnFolderNew.gif0000766000000000000000000000113411234314110030004 0ustar adminadministratorsGIF89aqbMVծ?Ɏssvʀn>¥Uйxط_ǿӍġ?xzsiʱjժ]̙3˯ps^҉ٷtiS"ԼβO_჏۸sֵR)Ο;Z۹]ѣGuvlWʣ:سlYٹX!O,O"55OOX%TTIZ:O:1^BOL5\QQUOAKH.FWU(7C,=$3[ 95 " O'VYQ>//+R+#<8NJ)/ OG8Q; Сɋ!T(`cA"2e'02@G(pA'eQK0;joomla/joomla/administrator/components/com_media/images/presentation_16.png0000766000000000000000000000076511234314106030471 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEԾھάɷժݮצݭ՜۾ɚϩѩ̞Āywtgcc~{zzzrrrn>3tRNSf pHYs B4tEXtSoftwareMacromedia Fireworks 8hxIDAT] F]˪kc8I9 `w,M'ެOw6Ql 8NY{F)8xX8r3,-$/Ĝv~4!BfiZ8IENDB`joomla/joomla/administrator/components/com_media/images/folderup.png0000766000000000000000000000125211234314106027260 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEW «E.͍lz,}zLl)>ܮ݈jd+nGÇ.u:Fs~GK哴Ϟo]j5Yb:삭Qv)%@ɕߓPi/ϯHt:ӻبC|c)pjH}Oތsk7@ʕQ,QtRNS)G pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT]0`T\Tp8@ZJnPbb<0/LSL"q_Pɼ -@CC `!A1\S븮a)kC}ø-8NХP87cpeb7YVe갰bUՁI$2Qry~p>4+L:IENDB`joomla/joomla/administrator/components/com_media/images/folder.png0000766000000000000000000000422711234314110026713 0ustar adminadministratorsPNG  IHDRPPsBITOPLTEhT,ÄȪmJmlg֤ԕp=dڹͤҰnĵ×yTϼTت _ʹasb>֔ݾRӥӽ}غ{Ɔ̔}ny­ŲQtOƺ̯uq]7ݿܝ᥿fŦl̎象RВgxwrϽoI׸zޭʹ|iCԶՙ{Dlвrݽ}zlRŸ[̪eKԿǦJr[1qJÛ˝ua:zkMzݣɫrϷ׻ťdϪZZ妌|WaִŌȋŴsRyd<μpì{Ͱx]ս蓌}[yyy~Nմs͍֪֬β}nZ1pBޭzf@Ǜtslﴦ~qRӸ_Κ̽Ɠ˯ޥŢ]¯ͭlʧb؜ħqvH欽Zs_5ЃqAТƵֽۻ|Lؾŵ{k{ÛU઒c`{{sεWޭʳ"tRNSFq pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATXWZeqd+r"QYƗژQZ`$$L6b:ptM8H36wi/NϽ׋ <~޿<܇K?H%mkpvvkq_O,9xp|Wlllt}?4;\rn݊bjUtoמ[] _*ST.U԰8]Ur \PS%3 4ZS!/](:U]LdD`ԐQ4[N<@dWк}FWi.Р~@ 4T p~*Y&<F Ir2`РӨ`m/ar T#+  \΂әΡ$3 2(> 6cAtpSBi`1 3AbAcѸ| 7i.Gk0xMMM H0B:7 =Hd:0 wl,Bo+iPFH~P?z;$b>|q$Oǂ-Ba.ԔC2| ,xGFwz#ţO!ӫPyhX]\ssLB1q$-]Kt4uS(&Rkmm>(&vPK60;6'۹pmV]*M&B3 ȣOGfSN:DuGoտ(bi o --JC~p#9n{<ᙇ`1sS %wvxЈis]nۛH$Dk͙`~X^n`ʻq;Arތ-sq୬@qBo:$#9]Rrf{O[eL KJȌvm(A BJ%8ސ6mX={vqswɰ\]fް^_գ3zr{'f&wStsD=WszhffO:;gb簘$'s 㘰=59yo-s>17joomla/joomla/administrator/components/com_media/images/mime-icon-16/0000777000000000000000000000000011266551154027045 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/images/mime-icon-16/mp4.png0000766000000000000000000000133311234314106030241 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE愨mssd^VO..pq;4&_S󼼼kܫ赽צ"!fQ5Z]Zj_Ĵxx+帹▹ϧjkk0E+p_M! |RP;NE6bcu9=8ՓeX@K+;YF1teT{RJih۵[87pje΋\V#lV8# zYP{ j]Pޠoh}@89֋_TP!\tRNS`0n pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcptD Fz -j uQyg`FyY(nPP/?T@f9D@ $|!j\\jG)7fV$U` G;/ osaCu>V4L X&\8::Bbc7(H ނG222IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/pdf.png0000766000000000000000000000117111234314106030312 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE==ؒUІ~עⱪa`̇^Uїpgpۘથݘṵ؃wgaᢘᥛ擰SF㸲71Њٙ䳫ӤѦگjb龶X98HtRNS# pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATMi[@q<Ŗ<:D[YBо7j3 (ܯ(65čin/J/* [1XHDڞH&`?_:O:>a K0jhu ]^PJ,ϺpoϮL (dIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/tar.png0000766000000000000000000000135511234314106030333 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEDÄrټfqަķ޶[γ{ƱOɛ󬞀ȼծYũn̎׻gՠvPμԵ޿~ÑYޝĥd˼ȬqHȫŵ֔궰ٹubhdžɍܽUͶϭi歴eŨnKi׹y̌MϰpQZצɶD_tRNSU5 pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcpG pub`.XSM?ET $.'``6ҊUCcXA|!!!F `w (ڊsYAbA>ެ 3ye$ \X)8HI3j@Q:\@&"aaV@Zqtt a }5<0IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/odc.png0000766000000000000000000000134511234314106030311 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTERJꅮlmcIͿɚc[ρDt؎~}rt&Ώ[UWmȱjގޯ˫Bŗ߾ƒ\`ɽ˾jΓcߢUTĞʃKׇY\Ѱ˛Ҝ \tRNS`0n pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT=R@,IDdb93IJQB=F~Um!zh-1qwEQc@2I$ ,!=;S0.~h- 0OoL@\X8I)6waؿ: JOVÓPJ|eÛUtpxE Bsg׻}V*%D^l9]őm3WTQIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/ogg.png0000766000000000000000000000136711234314106030324 0ustar adminadministratorsPNG  IHDRasBIT|d pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxnIDAT8KA? hE(*A:Wq\S7WB V\䢂P:ڠUKJ !1Ѷ:ԼM]{pp<>wZ X__E*@nvh1u/GO0c YO0Xa?3)@Dl$$I1&ht&91Ff08ݾ1U@ǀAE1^\uo_fAFz\^6b7(u/@)%7ϩ댌P*( ݂ PipZQJf9<D@ D\ *!<^bm[0;HDC]C5C*IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/doc.png0000766000000000000000000000103111234314106030301 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE}wѬԅu{4繶ęޫǣ}֏ضϽ溄Dºߝﳽʵد숱ܻ\}5tRNSw9a pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATE0 DQ 8Ee<&YX+p>^ú#PmUًئt;!cͮu Pz9Hc"A( 9@IQ Pq6|)D*LQ/{]<IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/avi.png0000766000000000000000000000133311234314106030320 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE愨mssd^VO..pq;4&_S󼼼kܫ赽צ"!fQ5Z]Zj_Ĵxx+帹▹ϧjkk0E+p_M! |RP;NE6bcu9=8ՓeX@K+;YF1teT{RJih۵[87pje΋\V#lV8# zYP{ j]Pޠoh}@89֋_TP!\tRNS`0n pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcptD Fz -j uQyg`FyY(nPP/?T@f9D@ $|!j\\jG)7fV$U` G;/ osaCu>V4L X&\8::Bbc7(H ނG222IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/xls.png0000766000000000000000000000127211234314106030351 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEWVƸ{iѤ~mhƶ?ةn֫ѷ뗸qó͍ؑӴ|꾏ZT[ƻpyއͽ^W_P{iޔ]VФϿ`u'b]mTtRNS pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATMN@஀XY+肧IB [Ÿ͗̌}-b֘5fmE+zs`@9U5|),>BRr ;Wtzok;]-U9׷%:IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/svg.png0000766000000000000000000000125511234314106030343 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEin֧pՇ֗ʦ{}}͟űmҏɘ۴̾螽ȌꎫvÈުqwٲs}{zճmvŽֵΉʑ뜽PtRNSݵ pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATMR0bj#VJ6 Z< I \|8oZkEj)4 ~`!F$7x>a<&Q}L,V5q Z~v@=9)mNf?< 8,j)w_=JAMPmJ=oLRTPPc껧'm#rIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/rtf.png0000766000000000000000000000101511234314106030331 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE}wѬ֫}{4vP~琶壛}갽抺ػю纄D߽دSԎ_2tRNS6 pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATE0 ki) $\Q9Cb0z]BB BdƑQ60n7[Rbj0J)q^A"N(Gae! G-@l}uA>d7 Y{!V%b`B\OmAyمW*4V{ IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/index.html0000766000000000000000000000005411234314106031027 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/images/mime-icon-16/mp3.png0000766000000000000000000000136411234314106030244 0ustar adminadministratorsPNG  IHDRasBIT|d pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxkIDAT8K\A{{jX-D*B X[l*m @" v6*!6RE1’,q}fR}f``|̹3bY=[\\\Xk#kh!Ij0⹮~, 0==tttycb!)߮k~zub˯ 6I$AR|iQRfzIpǻ{?c,(/UHcDQ|w"pL=.wHMz_\X.wGDTU5mq|ߧj ###t\ ݥX,fh4 R.)JHVE|>x lmm.KKK$IuVlnn1A@%ծl6T*DQDVY㘛00&u ~1331Ze&&&hDQB@U9( 83??1wӾ  A}>z^ lx;IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/rar.png0000766000000000000000000000135711234314106030333 0ustar adminadministratorsPNG  IHDR(-SsBITO PLTED޿~Ь͌xYvũnÑަγ{ж[hdžHȫԵՠfϭiYݣO׻ޝƱgμٹuiÄɍᶭPe׹ybưܽU֔ķϰpĥdKŨnɶȬqM̎ɛͶʶ^צQ6`tRNS` pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcpC pi\]#"L9@A2Qvvlz FFcI@]]0E ǧ14P $ Z,, XK.G8vvv1kaj4PX $bl`aaɫ2CXD"*l5I1c8Ze5 $m!.am  Z*46IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/sxd.png0000766000000000000000000000142511234314106030341 0ustar adminadministratorsPNG  IHDR(-SsBITO8PLTEA76眻˖v{zsr_XQ˟5¯թπ|դVWRBϢjy״ۧӜTKEÙJ`Kw헜9ٮ⣩愤Xa?ҥeaYϮԖ||̽][XѮRRN޻塾ۛhtRNSn pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcE `̣LRյ Ԍve  RjVp(+mg2XKG__@I"`h' llaEMEX"6ԏ$Ԣln&V'H TЍS4 冘!-à宧gV55u簀)0sqxB 2!fmkj8geIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/zip.png0000766000000000000000000000140011234314106030336 0ustar adminadministratorsPNG  IHDR(-SsBITO,PLTED޿~EuqюYμ̼vũnγ{ަȫ[hHԵƱɍÄՠ。fϭiᮒYOޝÑgoٹui﷓Peŵ׻}bdžUͶ֔ѺķϰpĥdK׹yŨnȬqM̎^צQɛɶܽ dtRNSC pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcA pXSKTN$'og$'`edTt׏R!+@14I  Z, .  A 8[v@xI{0qV4PX $`jee+h2CMQP*,$l=B"cZ.u!!!7]  ;XDFX=g`qqq"@B8*ғIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/tgz.png0000766000000000000000000000136511234314106030352 0ustar adminadministratorsPNG  IHDR(-SsBITO#PLTEDÄwּfӱަķҶ[γ{Ʊ£Oɛ󼵒箒Yũn㶭̎׻gՠvPμԵ޿~ÑYޝĥd˻ȬqzȲHȫŵ֔궱ٹubhdžɍܽUͶϭi歴eŨnKӾi׹y̌MϰpQZצɶȌatRNSK pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcB pdpp.XS]ԃKVT$˗dobd`dt3W>rCXA | fw 8F:qYA~~~ 3ye% CC+H8:3j AeW:Rb@vRRv@{qll0a 6bǢIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/wma.png0000766000000000000000000000105211234314106030323 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE|ibbbFFF似۾333%%%c̑{{{wXVUطqqq999 )))[[[nnnUUUBBBk 8tRNS+o pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT]0 ` jP͆"437_KӃ1d1NGD)4jk pTV3=sL To4HJ1Pắ{ ϓE $ "ʱȄ.Px^pVK-fD_*azqTq^[h41IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/ppt.png0000766000000000000000000000112011234314106030336 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTEfff߽hY׆ϼyxwؾy}hɊµoa~ÿꝵy貲ӧԭᶖgO?tRNSO pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATE0FI-EU:c,Mky>39X+St %qu9BIn pS lN0a1$^!lJNAs"B>pM!lPDY6Ti`r]3pArCcZ9794*sfIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-16/odt.png0000766000000000000000000000110211234314106030321 0ustar adminadministratorsPNG  IHDR(-SsBITOPLTE^̳D곱я絽אޯѭuǺУƯuю{4ܿޢཽLjクӻ鴸֭팿@=tRNSmz pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT50@Ql@`$(]Ǔ(i 9M* >6N܁ʮT@Fp: M ِúٞݞƕs{hf`ޢ޽%?btRNSv pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATE{7A"+bKIZEw]ryi%lwc bApGX9H$} !1ӽ/.1(~?Kz{}8YyD$ BL<ΝrݭF kj>"ɝ^8-#w\/bgkg|>}fESx=2T$\[ 2{/yzlj݉#yz33l/DzEeJH+# ڄ.8Ցk&y!t;X$ؠڂD@FHS= k)40e("" ;g;:I[&ߒb.܌ssBBB[ jR"Ŷ>>xiڀ赌s!,1IY*-O2NF:XI\BPU4$9G&_ $ND1P4))'$/"Q$)8LL#ĺ5MW<[Z$J%F?ùMMOO ͹><ܮ݈jd+nGÇ.u:Fs~GK哴Ϟo]j5Yb:삭Qv)%@ɕߓPi/ϯHt:ӻبC|c)pjH}Oތsk7@ʕQ,QtRNS)G pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT]0`T\Tp8@ZJnPbb<0/LSL"q_Pɼ -@CC `!A1\S븮a)kC}ø-8NХP87cpeb7YVe갰bUՁI$2Qry~p>4+L:IENDB`joomla/joomla/administrator/components/com_media/images/dots.gif0000766000000000000000000000026511234314110026370 0ustar adminadministratorsGIF89a 挵f! NETSCAPE2.0!, 0I8MC` BrN!,  8CL3! , H0I8M`BrN;joomla/joomla/administrator/components/com_media/images/mime-icon-32/0000777000000000000000000000000011266551151027040 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/images/mime-icon-32/mp4.png0000766000000000000000000000325111234314110030233 0ustar adminadministratorsPNG  IHDR DsBITOPLTElsxxEIIf׿{l%--JI`H'j7 架$5i)TzpeM@)fffސfQ3 zחᅈdVG>1%qaJvuDC75*ECB""zjS3&$^ 䳳 b$ʛskbUXYҋF-UB*ofO;KJ333$8c3n_P;87rQRS};0B-YJ:d^XZw1-]H)?Q2AHG֍ҭH/.wtx0>$.**q bQ>F! ؓ뗞m]Kis),fiiqpuuYWVpcV!"RJJH:id_~毷,"ߝrlPN(:TF411:GM.WTTus19 B4&)5#帉Tq懨4{k]PF98̽ŋm^Z[[}}~ JBBSD1݂<3dWJfS7((* 478HP2܁exsƱhU7ٚpfo g_X4.(s))!uskR'"!B9)씊 tRNSM pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxyIDAT8c$@M@ lm` l8@  m@ ` 6΁@U)G/0`J@V'׆gc(@MH^<}0iW܄` 0կXjgDr %&BHx7ݹ(Pon)#/o#"+klؤ dkl޼YrslMٛm%pqj(smjCR'EZR*X#[z-g6n@Q%{(JquHYr%<3GDw7 ER< zU%Pp(hJHHXtܐRP^jqd#GfZ*-EW[R]SEWi/_/#DQ.s8餤ϻuA'g(|]=Y>k|gÄs "`r`q80ݛpaFc֚ p5-sH&x`3X^ ;ի.oD(HRt8p@Fp ۷I-٧ UL QFܼq#0mԷiK-,wo [hæs!WIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/pdf.png0000766000000000000000000000236311234314106030314 0ustar adminadministratorsPNG  IHDR DsBITOPLTE؄VӀxgf᫥0#wЄ~11޿TPᙎdqnϩ!K<ⶰpdޑD>ޓ ؠ]T?3ڻxki\gݼxnZ擹^Wю,&孥tܢla؍ ÿvjۤkOD̼[Yp昋f[Ó߿ZޝڦֻkZ徹浯ۯL@D;1(xpvfUapg¼Нۄ؊h`ޔ]P{sf\ۙtRNS% pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8O1cN뫨U ;ylRԹ1gaB\|Ɖ;NHS6!F3Fc?=r2C;Y<8QJ0L !ԃbVQoߌ*53ñخP9ynjvv` On$ P: :zÞ++)_pJ^!s@.D: >7)N >NTXOΔ H>~[ZMPF$SP L&n#`h${TNR{[@Fg!ٲ ƑڤK'}ci@(߽|ڙЄX+\_D^,2OX #eU$a^Ƒ}IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/tar.png0000766000000000000000000000262411234314106030331 0ustar adminadministratorsPNG  IHDR DsBITO PLTE~JÅSɰ{`Ҩ|“Yódìlʨeݝ綘\JøΤ׹zy䥌ϲtsZkŅdӖ񚡏ޯE¹R\ߣμYɫmָzÿ½̐ˍwؾ৊Qlٴo֛KߢZμ`U~ŠͱεMåkГıw_ضõέl;ȋᅷֺޝǭsʿֹY⦅cizγ|򳠃JUȪPֽ͸oεcťdZյsֵח۽}﯋GhؙXXOŌϸȺż{ŭ޵ԪέcŽ`\tRNSk4 pHYs  ~tEXtSoftwareMacromedia Fireworks 8hx˼{fWU%(ʊ޾ʋS XڦrZI3e5 @;er.W JSDͥ$xcȗAh;M@QQSZ,<%; T'Bs;w† xKB(NFp65(YF."ϻ ~qRvC mGrg$"Wu@Y4.ABbZP, &dM fG$"o5Xɣ=ηWS.%'V:Zg@ }FEDE -6PSTQiIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/odc.png0000766000000000000000000000271011234314106030304 0ustar adminadministratorsPNG  IHDR DsBITO%PLTEQly+BYo2|qrv_g~EϜfgcő^hŻ\`Uv䪳բGs \W،qߜ;Ou/ͽu[o^w}?ϭjzkx+ǂHc^Ђցܞsö^aܒ_mq!dwxţz2ֹ=}Rdq]u'lXݤǽ|۫︻z{w㎘x.t,̴ۘ|}7edv*d_|gt}2hs{?bocl͠_ԟviؖÏ%`tRNS3* pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxLIDAT8S@[JZJTY֪`u;^xQotM:t:ތ6ih"?$3;۷J|8RP숀$I$[)G3fK FH68vsivaʱ7߽ǫsG-lFT>̕[- gN^띻w1`ԠhZfJfKA%x$m2S;~N{ &' JǦm/Fk·OuwbX\$kOc[.?`@n2- ,K`Xb [`,085Ȱ]*wuXPshA UqΌ< yc@< 4ʬ wj{y!cPsJ& eUU]nTUl6[P߿!^}޾JIS8XF[qBG`Svו50[/ jۦ M"섎_|4t 3ކt:ʍG edvz#>"` T $,I M•!8\C |ckYܓMVG$欿q؁K`!]IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/ogg.png0000766000000000000000000000353411234314110030313 0ustar adminadministratorsPNG  IHDR szzsBIT|d pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATXŖQhT3s$q3JET`M*](,4TCS DlEv.ZcC DѭqcL:$w{d&wn&.}9̹ws֚𠯯oMZk4jhB(V VJJih4--- x+044'OUAu^k]0ǯX,!@XZ۶{B?:=;)#ȨQ7]XmJ) x<=g<]3]_9?,+H6Lkwyrяׅ@Ji2G;pۻx֊3[rך֚ˬ<^-)ƃG0"0X4 %/W"HP 2Djq&ʛ,:u a6ԾAVGaν!5?='yv'%R. [2'Wb-(wA)l i5Af!Ç:/V).`" TNiRg;w%7Rq7ZkL)@),˪.Y[/d5Ȧ_^X,Fj.Os>2reXbZ\Fkၔ o/ 3M'O駟rڵ sHk^?FMJٿ?n۴4T4:YG QRJ,yW^q|V:kI՚%8drMl^>ZkHpz_H)Z311V\B)X6&7?lRJROGGض###T0MF0-RJ^|8doN<0 ǑRF|%]d !u]$q\ݳNʨ5o-¶m,BJܻwbȡChiiaxxT*tvvHSi*h}ss3KKKΒfimm .\Wȑ#[q$~]5551>>יT*9|0dطowٳLMMa6/^ qu OXD"ӧOdݻB@>gddrGeǎtuu1339vBaM]Z fcZk0Ѝ7}D"A*"ˑJXZZ܄Iww7XӧO300m۔J%RxČ^DZj4M:: 455%0*+U[* Tc_;wn:ʙ# @IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/wmv.png0000766000000000000000000000321511234314110030344 0ustar adminadministratorsPNG  IHDR DsBITOPLTEwsxxEIIf׿{l%--JI`H'x7 $5i)zpeM@)TffffQ3 zdVG>1%жqaJvuDC75*ECBc""zjS3&$^ 䳳 b$ʛskbUXYߊF-օUB*ofO;õKJ333$8c3n_P;87QRS};0B-YJ:d^X؅ڢ尸w1-]H)?Q2AHG֭H/.wt0>$.**wq bQ>F! m]KiZ),fiiqpuu~YWVpcV!"RJJƮЗ̋H:id_쯷,"rlPN(:TF411:GM.WTTyms19 B4&)5#Ә4k]PҢF98̽ŊmZ[[}}~ JBBSD1蝤<3dWJfS7((* 478HP2exshU7pfo g_X4.(s))!uskR'"!}B9);tRNSpb pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxmIDAT8c%@F@` A &lUa ւ @#cuKj{@ngvs(ܹ{rX>k'e};=[ Siy¼]6ŧ@("+/šX~I \ QGjZ(@V` !;P(YfuZ`c $7s\3`!+HZNr#"F.T$e$Nl1%qaJ]vuDC75*ECB""zjS3&$^ 䳳 b$ʛskbUXY獯ŋF-օUB*ofO;KJ333l$8c3n_P;87QRS};0B-YJ:d^X⤾Ώw1-]H)?Q2AHG֭H/.wts0>$Z.**q bQ>F! ϗm]Ki),fiiqpuu~YWVpcV!"RJJH:id_毷,"rlPN(:TF411:GM.WTTs19 B4&)5#Œظ갸4k]PF98̽mUZ[[}}~ JBBSD1<3dWJfS7((* 478HP2exsαhU7Ӛpfwo g_X4.(s))!u~skR'"!B9)lj aUtRNSj$3} pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxsIDAT8c#@ꞄH@ A^;{JAc1*TX9yF;ͰYX(˻$8&&f[` P"yA QNnڤEҫLL54j 0u0+xW޸QWW'uPoV@^d=JJ @VgZ%*[MHdpp(]^rj]n$e$eˬ޽ZF @R;#D\gEtZ$'ʣ( oܸ([+9 t(U@S]"!!a%t^BCCAzuׂvPnFPWTGcQ0c҉'IKo_X*m6^qUg^Ǣ}^ion|Y_E2@UۗynPRdL([""(T)VV#GLjqpLF2}T6 4>4~u/z"y{{o/++.tG=@Tx9z P{P\)7WUʕ= aJWw ]IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/doc.png0000766000000000000000000000212611234314110030300 0ustar adminadministratorsPNG  IHDR DsBITOJPLTEHlD˿}ØUbŸĸjbߓfȋLḑ}z戹ھv(µ֙cbœًМmu3hߦˮŗ̼ۊuzuYq隧ŵߨyfԭ|Τ΂ɳck{2sǺ(2ntRNSK; pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8s0Q#0reJ@qe7ӴSn:WJqlX5Iv%M]e@l:1)c}vl],mnnl,^D0FGbgFcf迹 Pv闫Kz2Fh]{sݟ?/- a MOؤ92/7li&,+C@ F,Q*GB© TE/D_n7 x^  (w9iF YwTj.1P˱@_OBh9? ! jn/_2[&SG~|#DRT_~.YdzLNɏ+'J:>ӉO/n9Em"֑l"M(ꥩ!2Z1@ɋy ((T G,$iT$dDok+d;\UA"7]$:LX³XXIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/avi.png0000766000000000000000000000325111234314110030312 0ustar adminadministratorsPNG  IHDR DsBITOPLTElsxxEIIf׿{l%--JI`H'j7 架$5i)TzpeM@)fffސfQ3 zחᅈdVG>1%qaJvuDC75*ECB""zjS3&$^ 䳳 b$ʛskbUXYҋF-UB*ofO;KJ333$8c3n_P;87rQRS};0B-YJ:d^XZw1-]H)?Q2AHG֍ҭH/.wtx0>$.**q bQ>F! ؓ뗞m]Kis),fiiqpuuYWVpcV!"RJJH:id_~毷,"ߝrlPN(:TF411:GM.WTTus19 B4&)5#帉Tq懨4{k]PF98̽ŋm^Z[[}}~ JBBSD1݂<3dWJfS7((* 478HP2܁exsƱhU7ٚpfo g_X4.(s))!uskR'"!B9)씊 tRNSM pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxyIDAT8c$@M@ lm` l8@  m@ ` 6΁@U)G/0`J@V'׆gc(@MH^<}0iW܄` 0կXjgDr %&BHx7ݹ(Pon)#/o#"+klؤ dkl޼YrslMٛm%pqj(smjCR'EZR*X#[z-g6n@Q%{(JquHYr%<3GDw7 ER< zU%Pp(hJHHXtܐRP^jqd#GfZ*-EW[R]SEWi/_/#DQ.s8餤ϻuA'g(|]=Y>k|gÄs "`r`q80ݛpaFc֚ p5-sH&x`3X^ ;ի.oD(HRt8p@Fp ۷I-٧ UL QFܼq#0mԷiK-,wo [hæs!WIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/xls.png0000766000000000000000000000256711234314106030357 0ustar adminadministratorsPNG  IHDR DsBITOPLTE]\tp"YT띲lɝu1yZ{޽ĞO}yjazؐn^hÂ9ɰv×qswǷnqګx5݁t'Ű?`y/يd]cZ[HġȃH𢭵{1w{娸de񂮳}u!v)ͺbxˢŁqſHpo~;Ğ{cb_x+呗覨utﭭSxs͚__έ~tRNS uq pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxcIDAT8s AzW$h#mHFq 0ŕ\Q5-Zv;.MM1c=%iLn2{ϳ|7cPx и0w g1#\V8ZuԀ/;*7D9Yim=wpVA*%J*lk](<\)+qb79Xٹa4k$O,yYkR0FrDTͦjc:/=U5$j身m`7 uAQmҵmso 2ɌPϽ7e d@L/TP˾!o,5[F,r; ˖ D,YmUQBhzr.;KK¶EsrnxEBeH,ǯ^.kD!& 蘩s6v~?37wsӳ\Ps6~ͥkk'T: q4vf,iT:sqX2f]$#DLqWTĈA,W* Ke]!e@бjgb 8^4%:VP5}rMţc匤PM63]6TqIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/svg.png0000766000000000000000000000225611234314110030336 0ustar adminadministratorsPNG  IHDR DsBITOPLTEoyw˗V綶tԊvßu}ϴϯޅ΅Âmts[۪y͖owtwoεǗ䖷z敲^ty΀r|rx任xł~΁ߧ٭ꚧ}لYtǀ؊|̗ãxm~|c⣭rss~°Ơ_`m6tRNSL pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8S0gHhա D#^s~ ̩'~L4Y2]{7o~mCHЂcJp) eYo7N(D O|^;rbrqAѓc;S?٪h$9;Wl<~bl3%~c*fW.T>e m+rHdrxw;4f/#?O%caY)Ƹ/P]FLi|`X Jk!=z2!jR8 Q _$>o E綯wVH@ QJYRq(']hgjЎ.4 8&#T 7ɂ8A8=E,(`RR(A :uAGfu _ZnmP3`0%fD-`Q O& SB3\oIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/rtf.png0000766000000000000000000000215711234314110030332 0ustar adminadministratorsPNG  IHDR DsBITOYPLTEHlD˿gƘbГf̧}b𼼼Uơbµťv(揰jncb¿ȋLǺyԅݧcu3^ѵˮvkYuzĸΗwyfԭ|_cɓkŵλ{{2޳mrustRNSjo pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8io1õ C W-r )0VK[N!f콄nc;3vJה%ykhA4kIN丷[L"`-gD?&WW?|Y{?~[: oewwn[po[y9MO,.ZZxqnb;8hIusSAn4ڌif6KIJA(#@1@Q,TFC 1$pc}IZ_ߏnj@MTF2PvB\D5*uTpB&n}~L?joomla/joomla/administrator/components/com_media/images/mime-icon-32/mp3.png0000766000000000000000000000352711234314110030240 0ustar adminadministratorsPNG  IHDR szzsBIT|d pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATXŖ_hT?;3w،Rb+*M;bM .,leićSO}Rw!b/"[Z(HjSh"kkbI'6sg=>LfrĥOa9s~ZkfgZ Q@k-B)mhPZi4QJhFpGS}DX7x%)ęI x^`uχu!,{y!Jd]#m5B 9^nmM1=?zaX>3.]5RMqf*#3W[ɯ.#} Z?S0 °>BT"s/M1^l|o1YyȒ0L ^hH _L R C HL ey]ߚ#P bE_qhNܼǫ5 ! Bz@d>۵;wH*k1-(E",Y]/8?;*fd/T@QX,ÙOO!1xX+yT*!Ztx`Y<,_8z#J5b͌뺤R)<\QXYYرcܹN8<||~C]Z fsZk0ύ7RL&qauu|&]]]b1N>M?mS,QJRcir9,l62㰶ضmH)B(BXuqD"A6%ϣ&<ϣJRU Ez}.$BD/1m0lٲ.={F6\JUKr[Ji'$ ;֜Q5}}}:t/_J)"L^?NTk .>v"A"ukQXd\|'NP*XZZX,r)m)Z&К@;$p֭L3VUj\t3gΐdhkkc޽IPjɤM< &{W1Mv)%X .y Vy ۷')d&Q!"W/W,򘦥\ |_ʅ_;wn6*bIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/rar.png0000766000000000000000000000264611234314110030326 0ustar adminadministratorsPNG  IHDR DsBITOPLTE~JÅSɰ{`g“̠Yóÿwʨeݝw涘\J̐øhӖ׹zϲt˵䴕ZkdŅE¹ì޹zʶRμߣYYɫmָz½ˍҨؾQlٴox|cΤ֛装Kߢμ`ͱU~MåkГı֣ζyõέl;ȋŌޝǭsʿYƿֹciγ|᠃JԪPֽ͸vmcťdZյsֵח۽}GWhؙRXOϸȺżݺŭέcŽԪࠦtRNSgG} pHYs  ~tEXtSoftwareMacromedia Fireworks 8hx:IDAT8{oPu*"8M3*h Pn8-v:ႃia/[/1 ==^a! $y^si9g7y5(vHų=לwtNVRmo^6)?R?A$2 ]c^Aj)̪0؎2U +/t-> %: yyNjU*(<8.-ӕ$OA6)gbQm(-bLκ)L 1n_Nt M}V;zX\AJ8~O>o*di(˥41%92Z"gUd) YWqIc?K%AW*@Ҹ]}k BS$К}a ^&`".F}y8h]Fݒ +> -0 , /(7Jx̴xR OD'd0 IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/sxd.png0000766000000000000000000000326711234314106030345 0ustar adminadministratorsPNG  IHDR DsBITOPLTE"! ͡}{w|$Σ3IYbUIL%-{‡~mdbʸ{ޥCr`l뿿OMIH`ͰvstͳIvqikw333\hҘiЃ畓߯LH@y؋yy``fBĖѷ82,Y^]\4C6ڪw`JD=Ĭdkuy,,*£M~ЅťbtFS|pyjmPkpkcC=7sTY *7*ȺךƉ8=WSJˮdzƙל綒ƓWlcxմ˓Xiqmۭլԣɏ~zkkc~zsΝ̦T̴EBB/.,ʹe_Wlzл~oPLDŭqޑգݮ۞s:11Şpli̖֧ސÛTQH_קʡ_{uo{sksSW)\XNÉ~mmhε̺iz'xjtRNS pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxoIDAT8c$Xqzz9P!躂] 9{ȑ~mh&(A=s vƌ"( w #{Lj2G,θjm P7 )7튤^qI?iqLO`yo'nEǠ3A;1\iJ~9C" WE _2l}A( <.V,No۹n_~GоV]aq.]@ M CR ׷7-`T9^0蘍ꆠO ]ra|$_!"3(vݷ4ŵS BS0g"І e,bK.t(PT?y2X?ky <T=)cΆُ C6Gw*9-̶o(򾎦 H}H[\'*G(Q= g9_IeÇvCr&.o`0E"!v^PyOg ggGuW8EemlD3AxkrN$Qϧ\\" XyySK\S!@0u*t<ٝuv8 tvF3/4AZ# H#U!IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/zip.png0000766000000000000000000000264011234314110030336 0ustar adminadministratorsPNG  IHDR DsBITOPLTE~JÅY`Ҩv“ϲtYϸìݝ\sزJΤɫmμ[׹z洕ZŅdӖEϿkγ|ֵRoߣYЩ`ÿy̐ıˍذ流Q;låkٴo֛Kߢǭsøμ`]UŠ{ͱֵM~ГiV}شȋޝʨeֹYclż½iュJPʿֽ͸e˵`wcťdZյsָzח۽}έlGhؙXؾOɰ{õŌóȺYŭԪŵzxܻsŽ}atRNS pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxtRNSr pHYs  ~tEXtSoftwareMacromedia Fireworks 8hx7IDAT8o`q*sN<&rULGV۝@n"]cފAj- Ϫ谝XgWXg5:ڼ|K]Sgmd< v06z^+y; ɢa.P>@\.e(Wg ]"&]mQ qV%0v#"u|Q v] ˱[rRK !+- D(K|w .m 5uYtj6q 6Z=:00j`nz)@DE4ͲF 4D'*mE-kO~AfE/IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/wma.png0000766000000000000000000000170511234314110030321 0ustar adminadministratorsPNG  IHDR DsBITOPLTEsZRRR⣣333rrr!!!YfffBBBjأGuzzz)))̙p涶~;;;lllYYYJJJެ[dv{̪Îܮԅeު{s֧įiyc[tRNS pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8 s0pԡ>c ͊ZԮnWy /kK9qpxKP QvS4_\K,+|\;?nzx[|bn9?>x=ݟׯN'aZәL&~`Luf3!bL ȹǖy2#a'$[A!дHkgX8}j\mZtܱ2hJ;sqPwd)tf.m9"zcbS7DYie0r9:ص2Mi%*^t9J|B Ԁ+ GѾꉗh*BO(zrX< Ri @!({a Xߨ B ?oCYKic=oj%jIENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/ppt.png0000766000000000000000000000237311234314110030342 0ustar adminadministratorsPNG  IHDR DsBITOPLTE333雺l>srrr𽽼aSVh}ٌ֋UHHH]u̅nĜ}]rsǬmmm꜄暤|ûCxAAAгǵ޹PPPaaao}y츛rwPt:::XʾʤZwwާbֆѝ{WWVɏ洵]JzʛѨֽ步`væ᠄̼pk)tRNSJW pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDAT8S0ǧ%j5ZQP *-hMTTN/Mp"S9Ϸ'[ו~~'ܷM{qTIt 41ssM ӷggӹm/XP0|zOtQuh sJb, W]=pkjoj&jApzyGF&'S+c{^,!=`b3`{ X9<|蛯xAd@f ]:R)*U(@h*[9mslEhhJ؊0\00TE8ea`5*@*aF,ajCSh AN =,=eYg]hJon RqBYȜ/91IENDB`joomla/joomla/administrator/components/com_media/images/mime-icon-32/odt.png0000766000000000000000000000237611234314110030330 0ustar adminadministratorsPNG  IHDR DsBITOPLTE/G˿ch~eƌSrз؞^uWj񞩒gwv(iŕς;擝眡[νmUl衩NjI̳гί~tP^􎦗ӬxyЅbu4z̧~_lާw޶改ѓvķͿxgΧt|=My]qftkՊz3px8tRNS{, pHYs  ~tEXtSoftwareMacromedia Fireworks 8hx2IDAT8S1ǩM[(OXA<vWTDQ$񙌙1ߙ~vghY"RJI 1PTLy>_C'cH)R=Z1n{Ǫ҇}h 5 ʽ ๸ˡoB<\YzjΙ-0ҩ=J9Rt'6)5S\BP,2NAaմ;Rm}O|Y$%F1 Q&ZcFC'HޡHt=w|>wQp~Z Tz.pjrnzZ)3mۅKM]ŷ`(@+ E$Bou`iCb:V OGNL<((@`ۧ\Ai "G]y1̷ù=83P$3%YizҮƭܪ7I9zY]"؝ݭyumäǫՓǝHB=ȶؔ|xkӢPLA˴-+$|͖鎌RJJ˖廿˛ϥn997]XPݯЯ|֏Mqldcl|u̙ςC@mmPo)6Xu@rn>o9ApTye0 4W)hP=1[X Il3 (*o VܴA 1 LME ; JJJK7oVp:1x^ڠIENDB`joomla/joomla/administrator/components/com_media/images/con_info.png0000766000000000000000000000152711234314106027237 0ustar adminadministratorsPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxbd@*q_Ll @G~Ⅿ'/@V@0Z~ei-l, Qî#֮ɋ @C?\{ j) ΋((120s0010|73ؠ?j'b8~yP @@*Ô f`Y +0uqا_ f v~~^R @̪{~re$203Bla&  K7gx,%, SВe8_F` r ߀?~ ( 4}b`6expQ<@ׁCT~0h-Ug2d;" ߿70^bed@9 ф/=p-981 Ͽ00*gl ۏBE!ԧH M; (|7 b2v$u XUV% Dl16ﬨ|ЎNsϳjp%x.33 6| ^_y Tz张>p.g[vhg&I ^%"d mi }gxv >?zvT@ArĈnd[0 sg//߂ 5dgb&IENDB`joomla/joomla/administrator/components/com_media/images/folder.gif0000766000000000000000000000241511234314106026676 0ustar adminadministratorsGIF89aPPm4aqqq٪fcY̙߿SוhؿrߪxlEҍtѫ9f߹Ч+yIՂٳA篯ݷܼ] ͝o恡by$ٱ:ѲSlfRK{u֬1̉棣Ô}ߨp]ӣ9|||Tٳ+޵Rݞs'rҡŞ9#ҥܶGDpgJϝֹdZ~]0٫)Tvfffl~s1Hӭ;x!~,PP~?@YnE؏@c&*%XDB6٤E+%Òe\rRGoaChIOH Hix' ™Jrj衆jQ¤Vj饖*:G C*j 7Y 葂꫰z*뮼jjf0ő)`B&¡jApG,J*9hp_( 0B\ Y+YZ(@0P@4a* 7jA {F{> A~/.' gk1Th164@(#` K! DrOWmXg\w`-dmhv ;joomla/joomla/administrator/components/com_media/images/noimages.gif0000766000000000000000000000141411234314110027216 0ustar adminadministratorsGIF89a0!,00I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZ`r7گs-/[yӟ^m|r}v1dh yq1nzbsu0o9sz v jtYdvl  [o Z^ű[Ɯ { { z2sq4ڝI.n,6")B5L@_NR ۂxƢ8˳Q$m f*VA8cJcetZUxCQ'F\*6R$N=YR|zs^`0-!œ%c WO%xټu^H5t^B{g،8a9@%B.V)Y2>`!zf #ŐGv>Vo3qσj۩G͗P/;ڦU HxzWxVUQSw_6G[T B>AtYwH#.d_byVgP}#="Q'tZ[-*HZeVq X@__`C#JB2Hdl hT. ͉tB@wU_"&*(裐F*餔Vj饘f馜v駠*ꨤR;joomla/joomla/administrator/components/com_media/images/btnFolderUp.gif0000766000000000000000000000112711234314110027641 0ustar adminadministratorsGIF89afGџ p;:؝|z%zG߷LlD3fاXCڅI$\.5$y)dPüW3ګ#Ǥ{߭[\1,Ҕu֭1[ώz_\ޱ;ٔF}<OK<u/-!wq]fݯ5ݻU؊$dרr9E*#(Mn; {IB:ޢݴQf3\L,fexPRp8CބL&0#ܮ,޹b;)ܾbѓ8J{;+!!U,UdY1!.I!SQc%`l,{nX24 s*889_X;D5UEO-gfX DL&&U0 > Wy(GG@:[^R d7 zi]7 =AoP'H Uh/TeV$p"&CC# JB:DD ?:!49$qA)ؑݰNT%;joomla/joomla/administrator/components/com_media/index.html0000766000000000000000000000005411234314106025461 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/config.xml0000766000000000000000000000453511234314106025463 0ustar adminadministrators joomla/joomla/administrator/components/com_media/models/0000777000000000000000000000000011266551146024763 5ustar adminadministratorsjoomla/joomla/administrator/components/com_media/models/list.php0000766000000000000000000001221111234314110026424 0ustar adminadministratorssetState('folder', $folder); $parent = str_replace("\\", "/", dirname($folder)); $parent = ($parent == '.') ? null : $parent; $this->setState('parent', $parent); $set = true; } return parent::getState($property); } function getImages() { $list = $this->getList(); return $list['images']; } function getFolders() { $list = $this->getList(); return $list['folders']; } function getDocuments() { $list = $this->getList(); return $list['docs']; } /** * Build imagelist * * @param string $listFolder The image directory to display * @since 1.5 */ function getList() { static $list; // Only process the list once per request if (is_array($list)) { return $list; } // Get current path from request $current = $this->getState('folder'); // If undefined, set to empty if ($current == 'undefined') { $current = ''; } // Initialize variables if (strlen($current) > 0) { $basePath = COM_MEDIA_BASE.DS.$current; } else { $basePath = COM_MEDIA_BASE; } $mediaBase = str_replace(DS, '/', COM_MEDIA_BASE.'/'); $images = array (); $folders = array (); $docs = array (); // Get the list of files and folders from the given folder $fileList = JFolder::files($basePath); $folderList = JFolder::folders($basePath); // Iterate over the files if they exist if ($fileList !== false) { foreach ($fileList as $file) { if (is_file($basePath.DS.$file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html') { $tmp = new JObject(); $tmp->name = $file; $tmp->path = str_replace(DS, '/', JPath::clean($basePath.DS.$file)); $tmp->path_relative = str_replace($mediaBase, '', $tmp->path); $tmp->size = filesize($tmp->path); $ext = strtolower(JFile::getExt($file)); switch ($ext) { // Image case 'jpg': case 'png': case 'gif': case 'xcf': case 'odg': case 'bmp': case 'jpeg': $info = @getimagesize($tmp->path); $tmp->width = @$info[0]; $tmp->height = @$info[1]; $tmp->type = @$info[2]; $tmp->mime = @$info['mime']; $filesize = MediaHelper::parseSize($tmp->size); if (($info[0] > 60) || ($info[1] > 60)) { $dimensions = MediaHelper::imageResize($info[0], $info[1], 60); $tmp->width_60 = $dimensions[0]; $tmp->height_60 = $dimensions[1]; } else { $tmp->width_60 = $tmp->width; $tmp->height_60 = $tmp->height; } if (($info[0] > 16) || ($info[1] > 16)) { $dimensions = MediaHelper::imageResize($info[0], $info[1], 16); $tmp->width_16 = $dimensions[0]; $tmp->height_16 = $dimensions[1]; } else { $tmp->width_16 = $tmp->width; $tmp->height_16 = $tmp->height; } $images[] = $tmp; break; // Non-image document default: $iconfile_32 = JPATH_ADMINISTRATOR.DS."components".DS."com_media".DS."images".DS."mime-icon-32".DS.$ext.".png"; if (file_exists($iconfile_32)) { $tmp->icon_32 = "components/com_media/images/mime-icon-32/".$ext.".png"; } else { $tmp->icon_32 = "components/com_media/images/con_info.png"; } $iconfile_16 = JPATH_ADMINISTRATOR.DS."components".DS."com_media".DS."images".DS."mime-icon-16".DS.$ext.".png"; if (file_exists($iconfile_16)) { $tmp->icon_16 = "components/com_media/images/mime-icon-16/".$ext.".png"; } else { $tmp->icon_16 = "components/com_media/images/con_info.png"; } $docs[] = $tmp; break; } } } } // Iterate over the folders if they exist if ($folderList !== false) { foreach ($folderList as $folder) { $tmp = new JObject(); $tmp->name = basename($folder); $tmp->path = str_replace(DS, '/', JPath::clean($basePath.DS.$folder)); $tmp->path_relative = str_replace($mediaBase, '', $tmp->path); $count = MediaHelper::countFiles($tmp->path); $tmp->files = $count[0]; $tmp->folders = $count[1]; $folders[] = $tmp; } } $list = array('folders' => $folders, 'docs' => $docs, 'images' => $images); return $list; } }joomla/joomla/administrator/components/com_media/models/manager.php0000766000000000000000000000737611234314110027103 0ustar adminadministratorssetState('folder', $folder); $parent = str_replace("\\", "/", dirname($folder)); $parent = ($parent == '.') ? null : $parent; $this->setState('parent', $parent); $set = true; } return parent::getState($property); } /** * Image Manager Popup * * @param string $listFolder The image directory to display * @since 1.5 */ function getFolderList($base = null) { global $mainframe; // Get some paths from the request if (empty($base)) { $base = COM_MEDIA_BASE; } // Get the list of folders jimport('joomla.filesystem.folder'); $folders = JFolder::folders($base, '.', true, true); // Load appropriate language files $lang = & JFactory::getLanguage(); $lang->load('', JPATH_ADMINISTRATOR); $lang->load(JRequest::getCmd( 'option' ), JPATH_ADMINISTRATOR); $document =& JFactory::getDocument(); $document->setTitle(JText::_('Insert Image')); // Build the array of select options for the folder list $options[] = JHTML::_('select.option', "","/"); foreach ($folders as $folder) { $folder = str_replace(COM_MEDIA_BASE, "", $folder); $value = substr($folder, 1); $text = str_replace(DS, "/", $folder); $options[] = JHTML::_('select.option', $value, $text); } // Sort the folder list array if (is_array($options)) { sort($options); } // Create the drop-down folder select list $list = JHTML::_('select.genericlist', $options, 'folderlist', "class=\"inputbox\" size=\"1\" onchange=\"ImageManager.setFolder(this.options[this.selectedIndex].value)\" ", 'value', 'text', $base); return $list; } function getFolderTree($base = null) { // Get some paths from the request if (empty($base)) { $base = COM_MEDIA_BASE; } $mediaBase = str_replace(DS, '/', COM_MEDIA_BASE.'/'); // Get the list of folders jimport('joomla.filesystem.folder'); $folders = JFolder::folders($base, '.', true, true); $tree = array(); foreach ($folders as $folder) { $folder = str_replace(DS, '/', $folder); $name = substr($folder, strrpos($folder, '/') + 1); $relative = str_replace($mediaBase, '', $folder); $absolute = $folder; $path = explode('/', $relative); $node = (object) array('name' => $name, 'relative' => $relative, 'absolute' => $absolute); $tmp = &$tree; for ($i=0,$n=count($path); $i<$n; $i++) { if (!isset($tmp['children'])) { $tmp['children'] = array(); } if ($i == $n-1) { // We need to place the node $tmp['children'][$relative] = array('data' =>$node, 'children' => array()); break; } if (array_key_exists($key = implode('/', array_slice($path, 0, $i+1)), $tmp['children'])) { $tmp = &$tmp['children'][$key]; } } } $tree['data'] = (object) array('name' => JText::_('Media'), 'relative' => '', 'absolute' => $base); return $tree; } }joomla/joomla/administrator/components/com_media/models/index.html0000766000000000000000000000005411234314110026737 0ustar adminadministratorsjoomla/joomla/administrator/components/com_media/media.php0000766000000000000000000000471211234314106025261 0ustar adminadministratorsauthorize( 'com_media', 'manage' )) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } $params =& JComponentHelper::getParams('com_media'); // Load the admin HTML view require_once( JPATH_COMPONENT.DS.'helpers'.DS.'media.php' ); // Set the path definitions $view = JRequest::getCmd('view',null); $popup_upload = JRequest::getCmd('pop_up',null); $path = "file_path"; if(substr(strtolower($view),0,6) == "images" || $popup_upload == 1) $path = "image_path"; define('COM_MEDIA_BASE', JPATH_ROOT.DS.$params->get($path, 'images/stories')); define('COM_MEDIA_BASEURL', JURI::root().$params->get($path, 'images/stories')); // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); $cmd = JRequest::getCmd('task', null); if (strpos($cmd, '.') != false) { // We have a defined controller/task pair -- lets split them out list($controllerName, $task) = explode('.', $cmd); // Define the controller name and path $controllerName = strtolower($controllerName); $controllerPath = JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php'; // If the controller file path exists, include it ... else lets die with a 500 error if (file_exists($controllerPath)) { require_once($controllerPath); } else { JError::raiseError(500, 'Invalid Controller'); } } else { // Base controller, just set the task :) $controllerName = null; $task = $cmd; } // Set the name for the controller and instantiate it $controllerClass = 'MediaController'.ucfirst($controllerName); if (class_exists($controllerClass)) { $controller = new $controllerClass(); } else { JError::raiseError(500, 'Invalid Controller Class'); } // Perform the Request task $controller->execute($task); // Redirect if set by the controller $controller->redirect(); joomla/joomla/administrator/components/com_media/media.xml0000766000000000000000000000104611234314106025267 0ustar adminadministrators Media Manager Joomla! Project April 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component manages site media joomla/joomla/administrator/components/com_modules/0000777000000000000000000000000011266551132024064 5ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/modules.xml0000766000000000000000000000100511234314102026240 0ustar adminadministrators Module Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Module Manager joomla/joomla/administrator/components/com_modules/helpers/0000777000000000000000000000000011266551133025527 5ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/helpers/xml.php0000766000000000000000000000231511234314102027026 0ustar adminadministrators $row) { if ($row->module == '') { $rows[$i]->name = 'custom'; $rows[$i]->module = 'custom'; $rows[$i]->descrip = 'Custom created module, using Module Manager `New` function'; } else { $data = JApplicationHelper::parseXMLInstallFile( $row->path.DS.$row->file); if ( $data['type'] == 'module' ) { $rows[$i]->name = $data['name']; $rows[$i]->descrip = $data['description']; } } } } }joomla/joomla/administrator/components/com_modules/helpers/index.html0000766000000000000000000000005411234314102027510 0ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/admin.modules.php0000766000000000000000000000224011234314102027320 0ustar adminadministratorsauthorize( 'com_modules', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); // Create the controller $controller = new ModulesController( array( 'default_task' => 'view' )); // Perform the Request task $controller->execute( JRequest::getCmd('task', 'view') ); // Redirect if set by the controller $controller->redirect(); joomla/joomla/administrator/components/com_modules/admin.modules.html.php0000766000000000000000000005022111234314102030265 0ustar adminadministrators
    :
    id == 0 ) { ?> id .'&task=edit&cid[]='. $row->id ); $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> "> id == 0 ) { ?>
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->title; } else { ?> title; ?> orderUpIcon( $i, ($row->position == @$rows[$i-1]->position), 'orderup', 'Move Up', $ordering ); ?> orderDownIcon( $i, $n, ($row->position == @$rows[$i+1]->position),'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> position; ?> pages )) { echo JText::_( 'None' ); } else if ($row->pages > 0) { echo JText::_( 'Varies' ); } else { echo JText::_( 'All' ); } ?> module ? $row->module : JText::_( 'User' );?> id;?>
    $row is passed with the id * property set to 0. * @param JTableCategory The category object * @param array

    The modules of the left side. The array elements are in the form * $leftorder[order] = label * where order is the module order from the db table and label is a * text label associciated with the order.

    * @param array See notes for leftorder * @param array An array of select lists * @param object Parameters */ function edit( &$model, &$row, &$orders2, &$lists, &$params, $client ) { JRequest::setVar( 'hidemainmenu', 1 ); // clean item data JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'content' ); // Check for component metadata.xml file //$path = JApplicationHelper::getPath( 'mod'.$client->id.'_xml', $row->module ); //$params = new JParameter( $row->params, $path ); $document =& JFactory::getDocument(); JHTML::_('behavior.combobox'); jimport('joomla.html.pane'); // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $pane = &JPane::getInstance('sliders', array('allowAllClose' => true)); $editor =& JFactory::getEditor(); JHTML::_('behavior.tooltip'); ?>
    : module); ?>
    :
    :
    : id; ?>
    : description); ?>
    : client_id != 1) : ?> pages == 'all') { ?> pages == 'none') { ?>
    :
    client_id != 1) : ?> pages == 'all') { ?> pages == 'none') { ?>
    startPane("menu-pane"); echo $pane->startPanel(JText :: _('Module Parameters'), "param-page"); $p = $params; if($params = $p->render('params')) : echo $params; else : echo "
    ".JText::_('There are no parameters for this item')."
    "; endif; echo $pane->endPanel(); if ($p->getNumParams('advanced')) { echo $pane->startPanel(JText :: _('Advanced Parameters'), "advanced-page"); if($params = $p->render('params', 'advanced')) : echo $params; else : echo "
    ".JText::_('There are no advanced parameters for this item')."
    "; endif; echo $pane->endPanel(); } if ($p->getNumParams('legacy')) { echo $pane->startPanel(JText :: _('Legacy Parameters'), "legacy-page"); if($params = $p->render('params', 'legacy')) : echo $params; else : echo "
    ".JText::_('There are no legacy parameters for this item')."
    "; endif; echo $pane->endPanel(); } if ($p->getNumParams('other')) { echo $pane->startPanel(JText :: _('Other Parameters'), "other-page"); if($params = $p->render('params', 'other')) : echo $params; else : echo "
    ".JText::_('There are no other parameters for this item')."
    "; endif; echo $pane->endPanel(); } echo $pane->endPane(); ?>
    module || $row->module == 'custom' || $row->module == 'mod_custom' ) { ?>
    display( 'content', $row->content, '100%', '400', '60', '20', array('pagebreak', 'readmore') ) ; ?>
    = $count) : ?> module . '&created=1&client=' . $client->id; ?>
     
      name, ENT_QUOTES, 'UTF-8'); ?>
    registerTask( 'apply', 'save' ); $this->registerTask( 'unpublish', 'publish' ); $this->registerTask( 'orderup', 'reorder' ); $this->registerTask( 'orderdown', 'reorder' ); $this->registerTask( 'accesspublic', 'access' ); $this->registerTask( 'accessregistered','access' ); $this->registerTask( 'accessspecial', 'access' ); } /** * Compiles a list of installed or defined modules */ function view() { global $mainframe; // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $option = 'com_modules'; $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'm.position', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $option.'filter_state', 'filter_state', '', 'word' ); $filter_position = $mainframe->getUserStateFromRequest( $option.'filter_position', 'filter_position', '', 'cmd' ); $filter_type = $mainframe->getUserStateFromRequest( $option.'filter_type', 'filter_type', '', 'cmd' ); $filter_assigned = $mainframe->getUserStateFromRequest( $option.'filter_assigned', 'filter_assigned', '', 'cmd' ); $search = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where[] = 'm.client_id = '.(int) $client->id; $joins[] = 'LEFT JOIN #__users AS u ON u.id = m.checked_out'; $joins[] = 'LEFT JOIN #__groups AS g ON g.id = m.access'; $joins[] = 'LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id'; // used by filter if ( $filter_assigned ) { $joins[] = 'LEFT JOIN #__templates_menu AS t ON t.menuid = mm.menuid'; $where[] = 't.template = '.$db->Quote($filter_assigned); } if ( $filter_position ) { $where[] = 'm.position = '.$db->Quote($filter_position); } if ( $filter_type ) { $where[] = 'm.module = '.$db->Quote($filter_type); } if ( $search ) { $where[] = 'LOWER( m.title ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'm.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'm.published = 0'; } } $where = ' WHERE ' . implode( ' AND ', $where ); $join = ' ' . implode( ' ', $joins ); if ($filter_order == 'm.ordering') { $orderby = ' ORDER BY m.position, m.ordering '. $filter_order_Dir; } else { $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', m.ordering ASC'; } // get the total number of records $query = 'SELECT COUNT(DISTINCT m.id)' . ' FROM #__modules AS m' . $join . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT m.*, u.name AS editor, g.name AS groupname, MIN(mm.menuid) AS pages' . ' FROM #__modules AS m' . $join . $where . ' GROUP BY m.id' . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } // get list of Positions for dropdown filter $query = 'SELECT m.position AS value, m.position AS text' . ' FROM #__modules as m' . ' WHERE m.client_id = '.(int) $client->id . ' GROUP BY m.position' . ' ORDER BY m.position' ; $positions[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Position' ) .' -' ); $db->setQuery( $query ); $positions = array_merge( $positions, $db->loadObjectList() ); $lists['position'] = JHTML::_('select.genericlist', $positions, 'filter_position', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', "$filter_position" ); // get list of Positions for dropdown filter $query = 'SELECT module AS value, module AS text' . ' FROM #__modules' . ' WHERE client_id = '.(int) $client->id . ' GROUP BY module' . ' ORDER BY module' ; $db->setQuery( $query ); $types[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Type' ) .' -' ); $types = array_merge( $types, $db->loadObjectList() ); $lists['type'] = JHTML::_('select.genericlist', $types, 'filter_type', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', "$filter_type" ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // template assignment filter $query = 'SELECT DISTINCT(template) AS text, template AS value'. ' FROM #__templates_menu' . ' WHERE client_id = '.(int) $client->id; $db->setQuery( $query ); $assigned[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Template' ) .' -' ); $assigned = array_merge( $assigned, $db->loadObjectList() ); $lists['assigned'] = JHTML::_('select.genericlist', $assigned, 'filter_assigned', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', "$filter_assigned" ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; require_once( JApplicationHelper::getPath( 'admin_html' ) ); HTML_modules::view( $rows, $client, $pageNav, $lists ); } /** * Compiles information to add or edit a module * @param string The current GET/POST option * @param integer The unique id of the record to edit */ function copy() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $n = count( $cid ); if ($n == 0) { return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); } $row =& JTable::getInstance('module'); $tuples = array(); foreach ($cid as $id) { // load the row from the db table $row->load( (int) $id ); $row->title = JText::sprintf( 'Copy of', $row->title ); $row->id = 0; $row->iscore = 0; $row->published = 0; if (!$row->check()) { return JError::raiseWarning( 500, $row->getError() ); } if (!$row->store()) { return JError::raiseWarning( 500, $row->getError() ); } $row->checkin(); $row->reorder( 'position='.$db->Quote( $row->position ).' AND client_id='.(int) $client->id ); $query = 'SELECT menuid' . ' FROM #__modules_menu' . ' WHERE moduleid = '.(int) $cid[0] ; $db->setQuery( $query ); $rows = $db->loadResultArray(); foreach ($rows as $menuid) { $tuples[] = '('.(int) $row->id.','.(int) $menuid.')'; } } if (!empty( $tuples )) { // Module-Menu Mapping: Do it in one query $query = 'INSERT INTO #__modules_menu (moduleid,menuid) VALUES '.implode( ',', $tuples ); $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } } $msg = JText::sprintf( 'Items Copied', $n ); $this->setRedirect( 'index.php?option=com_modules&client='. $client->id, $msg ); } /** * Saves the module after an edit form submit */ function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); global $mainframe; // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $post = JRequest::get( 'post' ); // fix up special html fields $post['content'] = JRequest::getVar( 'content', '', 'post', 'string', JREQUEST_ALLOWRAW ); $post['client_id'] = $client->id; $row =& JTable::getInstance('module'); if (!$row->bind( $post, 'selections' )) { return JError::raiseWarning( 500, $row->getError() ); } if (!$row->check()) { return JError::raiseWarning( 500, $row->getError() ); } // if new item, order last in appropriate group if (!$row->id) { $where = 'position='.$db->Quote( $row->position ).' AND client_id='.(int) $client->id ; $row->ordering = $row->getNextOrder( $where ); } if (!$row->store()) { return JError::raiseWarning( 500, $row->getError() ); } $row->checkin(); $menus = JRequest::getVar( 'menus', '', 'post', 'word' ); $selections = JRequest::getVar( 'selections', array(), 'post', 'array' ); JArrayHelper::toInteger($selections); // delete old module to menu item associations $query = 'DELETE FROM #__modules_menu' . ' WHERE moduleid = '.(int) $row->id ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } // check needed to stop a module being assigned to `All` // and other menu items resulting in a module being displayed twice if ( $menus == 'all' ) { // assign new module to `all` menu item associations $query = 'INSERT INTO #__modules_menu' . ' SET moduleid = '.(int) $row->id.' , menuid = 0' ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } } else { foreach ($selections as $menuid) { // this check for the blank spaces in the select box that have been added for cosmetic reasons if ( (int) $menuid >= 0 ) { // assign new module to menu item associations $query = 'INSERT INTO #__modules_menu' . ' SET moduleid = '.(int) $row->id .', menuid = '.(int) $menuid ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getError() ); } } } } // clean cache for all 3 front-end user groups (guest, reg, special) $cache =& JFactory::getCache(); $cache->remove($row->id . '0', $row->module); $cache->remove($row->id . '1', $row->module); $cache->remove($row->id . '2', $row->module); // clean content cache because of loadposition plugin $cache->clean( 'com_content' ); $this->setMessage( JText::_( 'Item saved' ) ); switch ($this->getTask()) { case 'apply': $this->setRedirect( 'index.php?option=com_modules&client='. $client->id .'&task=edit&id='. $row->id ); break; } } /** * Compiles information to add or edit a module * @param string The current GET/POST option * @param integer The unique id of the record to edit */ function edit( ) { // Initialize some variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $module = JRequest::getVar( 'module', '', '', 'cmd' ); $id = JRequest::getVar( 'id', 0, 'method', 'int' ); $cid = JRequest::getVar( 'cid', array( $id ), 'method', 'array' ); JArrayHelper::toInteger($cid, array(0)); $model = &$this->getModel('module'); $model->setState( 'id', $cid[0] ); $model->setState( 'clientId', $client->id ); $lists = array(); $row =& JTable::getInstance('module'); // load the row from the db table $row->load( (int) $cid[0] ); // fail if checked out not by 'me' if ($row->isCheckedOut( $user->get('id') )) { $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); return JError::raiseWarning( 500, JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The module' ), $row->title ) ); } $row->content = htmlspecialchars($row->content, ENT_COMPAT, 'UTF-8'); if ( $cid[0] ) { $row->checkout( $user->get('id') ); } // if a new record we must still prime the JTableModel object with a default // position and the order; also add an extra item to the order list to // place the 'new' record in last position if desired if ($cid[0] == 0) { $row->position = 'left'; $row->showtitle = true; $row->published = 1; //$row->ordering = $l; $row->module = $module; } if ($client->id == 1) { $where = 'client_id = 1'; $lists['client_id'] = 1; $path = 'mod1_xml'; } else { $where = 'client_id = 0'; $lists['client_id'] = 0; $path = 'mod0_xml'; } $query = 'SELECT position, ordering, showtitle, title' . ' FROM #__modules' . ' WHERE '. $where . ' ORDER BY ordering' ; $db->setQuery( $query ); $orders = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } $orders2 = array(); $l = 0; $r = 0; for ($i=0, $n=count( $orders ); $i < $n; $i++) { $ord = 0; if (array_key_exists( $orders[$i]->position, $orders2 )) { $ord =count( array_keys( $orders2[$orders[$i]->position] ) ) + 1; } $orders2[$orders[$i]->position][] = JHTML::_('select.option', $ord, $ord.'::'.addslashes( $orders[$i]->title ) ); } // get selected pages for $lists['selections'] if ( $cid[0] ) { $query = 'SELECT menuid AS value' . ' FROM #__modules_menu' . ' WHERE moduleid = '.(int) $row->id ; $db->setQuery( $query ); $lookup = $db->loadObjectList(); if (empty( $lookup )) { $lookup = array( JHTML::_('select.option', '-1' ) ); $row->pages = 'none'; } elseif (count($lookup) == 1 && $lookup[0]->value == 0) { $row->pages = 'all'; } else { $row->pages = null; } } else { $lookup = array( JHTML::_('select.option', 0, JText::_( 'All' ) ) ); $row->pages = 'all'; } if ( $row->access == 99 || $row->client_id == 1 || $lists['client_id'] ) { $lists['access'] = 'Administrator'; $lists['showtitle'] = 'N/A '; $lists['selections'] = 'N/A'; } else { if ( $client->id == '1' ) { $lists['access'] = 'N/A'; $lists['selections'] = 'N/A'; } else { $lists['access'] = JHTML::_('list.accesslevel', $row ); $selections = JHTML::_('menu.linkoptions'); $lists['selections'] = JHTML::_('select.genericlist', $selections, 'selections[]', 'class="inputbox" size="15" multiple="multiple"', 'value', 'text', $lookup, 'selections' ); } $lists['showtitle'] = JHTML::_('select.booleanlist', 'showtitle', 'class="inputbox"', $row->showtitle ); } // build the html select list for published $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ); $row->description = ''; $lang =& JFactory::getLanguage(); if ( $client->id != '1' ) { $lang->load( trim($row->module), JPATH_SITE ); } else { $lang->load( trim($row->module) ); } // xml file for module if ($row->module == 'custom') { $xmlfile = JApplicationHelper::getPath( $path, 'mod_custom' ); } else { $xmlfile = JApplicationHelper::getPath( $path, $row->module ); } $data = JApplicationHelper::parseXMLInstallFile($xmlfile); if ($data) { foreach($data as $key => $value) { $row->$key = $value; } } // get params definitions $params = new JParameter( $row->params, $xmlfile, 'module' ); require_once( JApplicationHelper::getPath( 'admin_html' ) ); HTML_modules::edit( $model, $row, $orders2, $lists, $params, $client ); } /** * Displays a list to select the creation of a new module */ function add() { global $mainframe; // Initialize some variables $modules = array(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); // path to search for modules if ($client->id == '1') { $path = JPATH_ADMINISTRATOR.DS.'modules'; $langbase = JPATH_ADMINISTRATOR; } else { $path = JPATH_ROOT.DS.'modules'; $langbase = JPATH_ROOT; } jimport('joomla.filesystem.folder'); $dirs = JFolder::folders( $path ); $lang =& JFactory::getLanguage(); foreach ($dirs as $dir) { if (substr( $dir, 0, 4 ) == 'mod_') { $files = JFolder::files( $path.DS.$dir, '^([_A-Za-z0-9]*)\.xml$' ); $module = new stdClass; $module->file = $files[0]; $module->module = str_replace( '.xml', '', $files[0] ); $module->path = $path.DS.$dir; $modules[] = $module; $lang->load( $module->module, $langbase ); } } require_once( JPATH_COMPONENT.DS.'helpers'.DS.'xml.php' ); ModulesHelperXML::parseXMLModuleFile( $modules, $client ); $n = count($modules); for ($i = 0; $i < $n; $i++) { $modules[$i]->name = JText::_(stripslashes($modules[$i]->name)); } // sort array of objects alphabetically by name JArrayHelper::sortObjects( $modules, 'name' ); require_once( JApplicationHelper::getPath( 'admin_html' ) ); HTML_modules::add( $modules, $client ); } /** * Deletes one or more modules * * Also deletes associated entries in the #__module_menu table. * @param array An array of unique category id numbers */ function remove() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger( $cid ); if (empty( $cid )) { return JError::raiseWarning( 500, 'No items selected' ); } $cids = implode( ',', $cid ); // pasamio: Disabled this as it breaks the uninstall ability! /*$query = 'SELECT id, module, title, iscore, params' . ' FROM #__modules WHERE id IN ('.$cids.')' ; $db->setQuery( $query ); if (!($rows = $db->loadObjectList())) { return JError::raiseError( 500, $db->getErrorMsg() ); }*/ // remove mappings first (lest we leave orphans) $query = 'DELETE FROM #__modules_menu' . ' WHERE moduleid IN ( '.$cids.' )' ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseError( 500, $db->getErrorMsg() ); } // remove module $query = 'DELETE FROM #__modules' . ' WHERE id IN ('.$cids.')' ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseError( 500, $db->getErrorMsg() ); } $this->setMessage( JText::sprintf( 'Items removed', count( $cid ) ) ); } /** * Publishes or Unpublishes one or more modules */ function publish() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cache = & JFactory::getCache(); $cache->clean( 'com_content' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $task = $this->getTask(); $publish = ($task == 'publish'); if (empty( $cid )) { return JError::raiseWarning( 500, 'No items selected' ); } $cids = implode( ',', $cid ); $query = 'UPDATE #__modules' . ' SET published = ' . intval( $publish ) . ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ) )' ; $db->setQuery( $query ); if (!$db->query()) { return JError::raiseWarning( 500, $db->getErrorMsg() ); } if (count( $cid ) == 1) { $row =& JTable::getInstance('module'); $row->checkin( $cid[0] ); } } /** * Cancels an edit operation */ function cancel() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $row =& JTable::getInstance('module'); // ignore array elements $row->bind(JRequest::get('post'), 'selections params' ); $row->checkin(); } /** * Moves the order of a record */ function reorder() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $task = $this->getTask(); $inc = ($task == 'orderup' ? -1 : 1); if (empty( $cid )) { return JError::raiseWarning( 500, 'No items selected' ); } $row =& JTable::getInstance('module'); $row->load( (int) $cid[0] ); $row->move( $inc, 'position = '.$db->Quote( $row->position ).' AND client_id='.(int) $client->id ); } /** * Changes the access level of a record */ function access() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); $task = JRequest::getCmd( 'task' ); if (empty( $cid )) { return JError::raiseWarning( 500, 'No items selected' ); } switch ( $task ) { case 'accesspublic': $access = 0; break; case 'accessregistered': $access = 1; break; case 'accessspecial': $access = 2; break; } $row =& JTable::getInstance('module'); $row->load( (int) $cid[0] ); $row->access = $access; if ( !$row->check() ) { JError::raiseWarning( 500, $row->getError() ); } if ( !$row->store() ) { JError::raiseWarning( 500, $row->getError() ); } } /** * Saves the orders of the supplied list */ function saveOrder() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db =& JFactory::getDBO(); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $this->setRedirect( 'index.php?option=com_modules&client='.$client->id ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (empty( $cid )) { return JError::raiseWarning( 500, 'No items selected' ); } $total = count( $cid ); $row =& JTable::getInstance('module'); $groupings = array(); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order); // update ordering values for ($i = 0; $i < $total; $i++) { $row->load( (int) $cid[$i] ); // track postions $groupings[] = $row->position; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { return JError::raiseWarning( 500, $db->getErrorMsg() ); } } } // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('position = '.$db->Quote($group).' AND client_id = '.(int) $client->id); } $this->setMessage (JText::_( 'New ordering saved' )); } function preview() { $document =& JFactory::getDocument(); $document->setTitle(JText::_('Module Preview')); require_once( JApplicationHelper::getPath( 'admin_html' ) ); HTML_modules::preview( ); } } joomla/joomla/administrator/components/com_modules/toolbar.modules.html.php0000766000000000000000000000441711234314102030645 0ustar adminadministrators[ '. JText::_( 'New' ) .' ]', 'module.png' ); JToolBarHelper::customX( 'edit', 'forward.png', 'forward_f2.png', 'Next', true ); JToolBarHelper::cancel(); if ($client->name == 'site') { JToolBarHelper::help( 'screen.modulessite.edit' ); } else { JToolBarHelper::help( 'screen.modulesadministrator.edit'); } } /** * Draws the menu for Editing an existing module */ function _EDIT( $client ) { $moduleType = JRequest::getCmd( 'module' ); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); JArrayHelper::toInteger($cid, array(0)); JToolBarHelper::title( JText::_( 'Module' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'module.png' ); if($moduleType == 'custom') { JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client='.$client->id.'&pollid='.$cid[0]); } JToolBarHelper::save(); JToolBarHelper::apply(); if ( $cid[0] ) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.modules.edit' ); } function _DEFAULT($client) { JToolBarHelper::title( JText::_( 'Module Manager' ), 'module.png' ); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::custom( 'copy', 'copy.png', 'copy_f2.png', 'Copy', true ); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::help( 'screen.modules' ); } } joomla/joomla/administrator/components/com_modules/index.html0000766000000000000000000000005411234314102026046 0ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/models/0000777000000000000000000000000011266551132025347 5ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/models/index.html0000766000000000000000000000005411234314102027331 0ustar adminadministratorsjoomla/joomla/administrator/components/com_modules/models/module.php0000766000000000000000000001013311234314102027331 0ustar adminadministratorsgetTable( 'Module', 'JTable' ); if ($id = $this->getState( 'id' )) { $instance->load( (int) $id ); } } return $instance; } function &_getXML() { if (!$this->_xml) { $clientId = $this->getState( 'clientId', 0 ); $path = ($clientId == 1) ? 'mod1_xml' : 'mod0_xml'; $module = &$this->getModule(); if ($module->module == 'custom') { $xmlpath = JApplicationHelper::getPath( $path, 'mod_custom' ); } else { $xmlpath = JApplicationHelper::getPath( $path, $module->module ); } if (file_exists($xmlpath)) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($xmlpath)) { $this->_xml = &$xml; } } } return $this->_xml; } function &getParams() { // Get the state parameters $module =& $this->getModule(); $params = new JParameter($module->params); if ($xml =& $this->_getXML()) { if ($ps = & $xml->document->params) { foreach ($ps as $p) { $params->setXML( $p ); } } } return $params; } function getPositions() { jimport('joomla.filesystem.folder'); $client =& JApplicationHelper::getClientInfo($this->getState('clientId')); if ($client === false) { return false; } //Get the database object $db =& JFactory::getDBO(); // template assignment filter $query = 'SELECT DISTINCT(template) AS text, template AS value'. ' FROM #__templates_menu' . ' WHERE client_id = '.(int) $client->id; $db->setQuery( $query ); $templates = $db->loadObjectList(); // Get a list of all module positions as set in the database $query = 'SELECT DISTINCT(position)'. ' FROM #__modules' . ' WHERE client_id = '.(int) $client->id; $db->setQuery( $query ); $positions = $db->loadResultArray(); $positions = (is_array($positions)) ? $positions : array(); // Get a list of all template xml files for a given application // Get the xml parser first for ($i = 0, $n = count($templates); $i < $n; $i++ ) { $path = $client->path.DS.'templates'.DS.$templates[$i]->value; $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($path.DS.'templateDetails.xml')) { $p =& $xml->document->getElementByPath('positions'); if (is_a($p, 'JSimpleXMLElement') && count($p->children())) { foreach ($p->children() as $child) { if (!in_array($child->data(), $positions)) { $positions[] = $child->data(); } } } } } if(defined('_JLEGACY') && _JLEGACY == '1.0') { $positions[] = 'left'; $positions[] = 'right'; $positions[] = 'top'; $positions[] = 'bottom'; $positions[] = 'inset'; $positions[] = 'banner'; $positions[] = 'header'; $positions[] = 'footer'; $positions[] = 'newsflash'; $positions[] = 'legals'; $positions[] = 'pathway'; $positions[] = 'breadcrumb'; $positions[] = 'user1'; $positions[] = 'user2'; $positions[] = 'user3'; $positions[] = 'user4'; $positions[] = 'user5'; $positions[] = 'user6'; $positions[] = 'user7'; $positions[] = 'user8'; $positions[] = 'user9'; $positions[] = 'advert1'; $positions[] = 'advert2'; $positions[] = 'advert3'; $positions[] = 'debug'; $positions[] = 'syndicate'; } $positions = array_unique($positions); sort($positions); return $positions; } } joomla/joomla/administrator/components/com_modules/toolbar.modules.php0000766000000000000000000000175311234314102027702 0ustar adminadministrators 'rounded', 'id' => 'section-box')); echo $module; } function login() { global $mainframe; // Check for request forgeries JRequest::checkToken('request') or jexit( 'Invalid Token' ); $credentials = array(); $credentials['username'] = JRequest::getVar('username', '', 'method', 'username'); $credentials['password'] = JRequest::getVar('passwd', '', 'post', 'string', JREQUEST_ALLOWRAW); $result = $mainframe->login($credentials); if (!JError::isError($result)) { $mainframe->redirect('index.php'); } LoginController::display(); } function logout() { global $mainframe; $result = $mainframe->logout(); if (!JError::isError($result)) { $mainframe->redirect('index.php?option=com_login'); } LoginController::display(); } } joomla/joomla/administrator/components/com_login/index.html0000766000000000000000000000005411234314104025510 0ustar adminadministratorsjoomla/joomla/administrator/components/com_templates/0000777000000000000000000000000011266551123024412 5ustar adminadministratorsjoomla/joomla/administrator/components/com_templates/admin.templates.html.php0000766000000000000000000004102011234314074031146 0ustar adminadministratorsauthorUrl) && $row->authorUrl != '') { $row->authorUrl = str_replace('http://', '', $row->authorUrl); } JHTML::_('behavior.tooltip'); ?>
    id == 1) { ?> authorEmail . '
    ' . @ $row->authorUrl; ?> id == 1) { ?>
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out )) { ?>   id == 1 ? JURI::root().'administrator' : $mainframe->getSiteURL() ).'/templates/'.$row->directory.'/template_thumbnail.png'; ?> name;?> published == 1) { ?> <?php echo JText::_( 'Published' ); ?>   published == 1) { ?> <?php echo JText::_( 'Default' ); ?>   assigned == 1) { ?> <?php echo JText::_( 'Assigned' ); ?>   version; ?> creationdate; ?> author != '' ? $row->author : ' '; ?>
    id ? JURI::base() : $mainframe->getSiteURL(); ?>
    '_blank')); ?>
    'previewFrame')) ?>

    message); ?>

    : name); ?>
    : description); ?>
    pages != 'all' && $client->id != 1) : ?>
    : id == 1) { echo JText::_('Cannot assign administrator template'); } elseif ($row->pages == 'all') { echo JText::_('Cannot assign default template'); echo ''; } elseif ($row->pages == 'none') { ?>
    : pages == 'none') { ?>
    path.$templatefile) ? JText::sprintf('PARAMSWRITABLE', $templatefile):JText::sprintf('PARAMSUNWRITABLE', $templatefile); ?>
    render(); } else { echo '' . JText :: _('No Parameters') . ''; } ?>
    path .DS. 'templates' .DS. $template .DS. 'index.php'; ?>

    message); ?>

     
    /
    '. JText::_( 'Writable' ) .'' : ' '. JText::_( 'Unwritable' ) .'' ?>
    path.DS.'templates'.DS.$template.DS.'css'.DS.$filename; ?>

    message); ?>

    id == '1') { JToolBarHelper::makeDefault('publish'); } else { JToolBarHelper::makeDefault(); } JToolBarHelper::editListX( 'edit', 'Edit' ); //JToolBarHelper::addNew(); JToolBarHelper::help( 'screen.templates' ); } function _VIEW(&$client){ JToolBarHelper::title( JText::_( 'Template Manager' ), 'thememanager' ); JToolBarHelper::back(); } function _EDIT_SOURCE(&$client){ JToolBarHelper::title( JText::_( 'Template HTML Editor' ), 'thememanager' ); JToolBarHelper::save( 'save_source' ); JToolBarHelper::apply( 'apply_source' ); JToolBarHelper::cancel('edit'); JToolBarHelper::help( 'screen.templates' ); } function _EDIT(&$client){ JToolBarHelper::title( JText::_( 'Template' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'thememanager' ); JToolBarHelper::custom('preview', 'preview.png', 'preview_f2.png', 'Preview', false, false); JToolBarHelper::custom( 'edit_source', 'html.png', 'html_f2.png', 'Edit HTML', false, false ); JToolBarHelper::custom( 'choose_css', 'css.png', 'css_f2.png', 'Edit CSS', false, false ); JToolBarHelper::save( 'save' ); JToolBarHelper::apply(); JToolBarHelper::cancel( 'cancel', 'Close' ); JToolBarHelper::help( 'screen.templates' ); } function _CHOOSE_CSS(&$client){ JToolBarHelper::title( JText::_( 'Template CSS Editor' ), 'thememanager' ); JToolBarHelper::custom( 'edit_css', 'edit.png', 'edit_f2.png', 'Edit', true ); JToolBarHelper::cancel('edit'); JToolBarHelper::help( 'screen.templates' ); } function _EDIT_CSS(&$client){ JToolBarHelper::title( JText::_( 'Template Manager' ), 'thememanager' ); JToolBarHelper::save( 'save_css' ); JToolBarHelper::apply( 'apply_css'); JToolBarHelper::cancel('choose_css'); JToolBarHelper::help( 'screen.templates' ); } }joomla/joomla/administrator/components/com_templates/helpers/0000777000000000000000000000000011266551124026055 5ustar adminadministratorsjoomla/joomla/administrator/components/com_templates/helpers/index.html0000766000000000000000000000005411234314074030046 0ustar adminadministratorsjoomla/joomla/administrator/components/com_templates/helpers/template.php0000766000000000000000000000615211234314074030402 0ustar adminadministratorssetQuery($query); $defaultemplate = $db->loadResult(); return $defaultemplate == $template ? 1 : 0; } function isTemplateAssigned($template) { $db =& JFactory::getDBO(); // check if template is assigned $query = 'SELECT COUNT(*)' . ' FROM #__templates_menu' . ' WHERE client_id = 0' . ' AND template = '.$db->Quote($template) . ' AND menuid <> 0'; $db->setQuery($query); return $db->loadResult() ? 1 : 0; } function parseXMLTemplateFiles($templateBaseDir) { // Read the template folder to find templates jimport('joomla.filesystem.folder'); $templateDirs = JFolder::folders($templateBaseDir); $rows = array(); // Check that the directory contains an xml file foreach ($templateDirs as $templateDir) { if(!$data = TemplatesHelper::parseXMLTemplateFile($templateBaseDir, $templateDir)){ continue; } else { $rows[] = $data; } } return $rows; } function parseXMLTemplateFile($templateBaseDir, $templateDir) { // Check of the xml file exists if(!is_file($templateBaseDir.DS.$templateDir.DS.'templateDetails.xml')) { return false; } $xml = JApplicationHelper::parseXMLInstallFile($templateBaseDir.DS.$templateDir.DS.'templateDetails.xml'); if ($xml['type'] != 'template') { return false; } $data = new StdClass(); $data->directory = $templateDir; foreach($xml as $key => $value) { $data->$key = $value; } $data->checked_out = 0; $data->mosname = JString::strtolower(str_replace(' ', '_', $data->name)); return $data; } function createMenuList($template) { $db =& JFactory::getDBO(); // get selected pages for $menulist $query = 'SELECT menuid AS value' . ' FROM #__templates_menu' . ' WHERE client_id = 0' . ' AND template = '.$db->Quote($template); $db->setQuery($query); $lookup = $db->loadObjectList(); if (empty( $lookup )) { $lookup = array( JHTML::_('select.option', '-1' ) ); } // build the html select list $options = JHTML::_('menu.linkoptions'); $result = JHTML::_('select.genericlist', $options, 'selections[]', 'class="inputbox" size="15" multiple="multiple"', 'value', 'text', $lookup, 'selections' ); return $result; } }joomla/joomla/administrator/components/com_templates/toolbar.templates.php0000766000000000000000000000232211234314074030557 0ustar adminadministratorsgetUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option.'.'.$client->id.'.limitstart', 'limitstart', 0, 'int'); $select[] = JHTML::_('select.option', '0', JText::_('Site')); $select[] = JHTML::_('select.option', '1', JText::_('Administrator')); $lists['client'] = JHTML::_('select.genericlist', $select, 'client', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $client->id); $tBaseDir = $client->path.DS.'templates'; //get template xml file info $rows = array(); $rows = TemplatesHelper::parseXMLTemplateFiles($tBaseDir); // set dynamic template information for($i = 0; $i < count($rows); $i++) { $rows[$i]->assigned = TemplatesHelper::isTemplateAssigned($rows[$i]->directory); $rows[$i]->published = TemplatesHelper::isTemplateDefault($rows[$i]->directory, $client->id); } jimport('joomla.html.pagination'); $page = new JPagination(count($rows), $limitstart, $limit); $rows = array_slice($rows, $page->limitstart, $page->limit); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::showTemplates($rows, $lists, $page, $option, $client); } /** * Show the template with module position in an iframe */ function previewTemplate() { $template = JRequest::getVar('id', '', 'method', 'cmd'); $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); if (!$template) { return JError::raiseWarning( 500, JText::_('Template not specified') ); } // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::previewTemplate($template, true, $client, $option); } /** * Publish, or make current, the selected template */ function publishTemplate() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db = & JFactory::getDBO(); $cid = JRequest::getVar('cid', array(), 'method', 'array'); $cid = array(JFilterInput::clean(@$cid[0], 'cmd')); $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); if ($cid[0]) { $query = 'DELETE FROM #__templates_menu' . ' WHERE client_id = '.(int) $client->id . ' AND (menuid = 0 OR template = '.$db->Quote($cid[0]).')'; $db->setQuery($query); $db->query(); $query = 'INSERT INTO #__templates_menu' . ' SET client_id = '.(int) $client->id .', template = '.$db->Quote($cid[0]).', menuid = 0'; $db->setQuery($query); $db->query(); } $mainframe->redirect('index.php?option='.$option.'&client='.$client->id); } function editTemplate() { jimport('joomla.filesystem.path'); // Initialize some variables $db = & JFactory::getDBO(); $cid = JRequest::getVar('cid', array(), 'method', 'array'); $cid = array(JFilterInput::clean(@$cid[0], 'cmd')); $template = $cid[0]; $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); if (!$cid[0]) { return JError::raiseWarning( 500, JText::_('Template not specified') ); } $tBaseDir = JPath::clean($client->path.DS.'templates'); if (!is_dir( $tBaseDir . DS . $template )) { return JError::raiseWarning( 500, JText::_('Template not found') ); } $lang =& JFactory::getLanguage(); $lang->load( 'tpl_'.$template, JPATH_ADMINISTRATOR ); $ini = $client->path.DS.'templates'.DS.$template.DS.'params.ini'; $xml = $client->path.DS.'templates'.DS.$template.DS.'templateDetails.xml'; $row = TemplatesHelper::parseXMLTemplateFile($tBaseDir, $template); jimport('joomla.filesystem.file'); // Read the ini file if (JFile::exists($ini)) { $content = JFile::read($ini); } else { $content = null; } $params = new JParameter($content, $xml, 'template'); $assigned = TemplatesHelper::isTemplateAssigned($row->directory); $default = TemplatesHelper::isTemplateDefault($row->directory, $client->id); if($client->id == '1') { $lists['selections'] = JText::_('Cannot assign an administrator template'); } else { $lists['selections'] = TemplatesHelper::createMenuList($template); } if ($default) { $row->pages = 'all'; } elseif (!$assigned) { $row->pages = 'none'; } else { $row->pages = null; } // Set FTP credentials, if given jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::editTemplate($row, $lists, $params, $option, $client, $ftp, $template); } function saveTemplate() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $db = & JFactory::getDBO(); $template = JRequest::getVar('id', '', 'method', 'cmd'); $option = JRequest::getVar('option', '', '', 'cmd'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $menus = JRequest::getVar('selections', array(), 'post', 'array'); $params = JRequest::getVar('params', array(), 'post', 'array'); $default = JRequest::getBool('default'); JArrayHelper::toInteger($menus); if (!$template) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::_('No template specified.')); } // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $ftp = JClientHelper::getCredentials('ftp'); $file = $client->path.DS.'templates'.DS.$template.DS.'params.ini'; jimport('joomla.filesystem.file'); if (JFile::exists($file) && count($params)) { $registry = new JRegistry(); $registry->loadArray($params); $txt = $registry->toString(); // Try to make the params file writeable if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0755')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template parameter file writable')); } $return = JFile::write($file, $txt); // Try to make the params file unwriteable if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0555')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template parameter file unwritable')); } if (!$return) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::sprintf('Failed to open file for writing.', $file)); } } // Reset all existing assignments $query = 'DELETE FROM #__templates_menu' . ' WHERE client_id = 0' . ' AND template = '.$db->Quote( $template ); $db->setQuery($query); $db->query(); if ($default) { $menus = array( 0 ); } foreach ($menus as $menuid) { // If 'None' is not in array if ((int) $menuid >= 0) { // check if there is already a template assigned to this menu item $query = 'DELETE FROM #__templates_menu' . ' WHERE client_id = 0' . ' AND menuid = '.(int) $menuid; $db->setQuery($query); $db->query(); $query = 'INSERT INTO #__templates_menu' . ' SET client_id = 0, template = '. $db->Quote( $template ) .', menuid = '.(int) $menuid; $db->setQuery($query); $db->query(); } } $task = JRequest::getCmd('task'); if($task == 'apply') { $mainframe->redirect('index.php?option='.$option.'&task=edit&cid[]='.$template.'&client='.$client->id); } else { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id); } } function cancelTemplate() { global $mainframe; // Initialize some variables $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $mainframe->redirect('index.php?option='.$option.'&client='.$client->id); } function editTemplateSource() { global $mainframe; // Initialize some variables $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $template = JRequest::getVar('id', '', 'method', 'cmd'); $file = $client->path.DS.'templates'.DS.$template.DS.'index.php'; // Read the source file jimport('joomla.filesystem.file'); $content = JFile::read($file); if ($content !== false) { // Set FTP credentials, if given jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $content = htmlspecialchars($content, ENT_COMPAT, 'UTF-8'); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::editTemplateSource($template, $content, $option, $client, $ftp); } else { $msg = JText::sprintf('Operation Failed Could not open', $file); $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, $msg); } } function saveTemplateSource() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $template = JRequest::getVar('id', '', 'method', 'cmd'); $filecontent = JRequest::getVar('filecontent', '', 'post', 'string', JREQUEST_ALLOWRAW); if (!$template) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::_('No template specified.')); } if (!$filecontent) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::_('Content empty.')); } // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $ftp = JClientHelper::getCredentials('ftp'); $file = $client->path.DS.'templates'.DS.$template.DS.'index.php'; // Try to make the template file writeable if (!$ftp['enabled'] && !JPath::setPermissions($file, '0755')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template file writable')); } jimport('joomla.filesystem.file'); $return = JFile::write($file, $filecontent); // Try to make the template file unwriteable if (!$ftp['enabled'] && !JPath::setPermissions($file, '0555')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template file unwritable')); } if ($return) { $task = JRequest::getCmd('task'); switch($task) { case 'apply_source': $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&task=edit_source&id='.$template, JText::_('Template source saved')); break; case 'save_source': default: $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&task=edit&cid[]='.$template, JText::_('Template source saved')); break; } } else { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::sprintf('Failed to open file for writing.', $file)); } } function chooseTemplateCSS() { global $mainframe; // Initialize some variables $option = JRequest::getCmd('option'); $template = JRequest::getVar('id', '', 'method', 'cmd'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); // Determine template CSS directory $dir = $client->path.DS.'templates'.DS.$template.DS.'css'; // List template .css files jimport('joomla.filesystem.folder'); $files = JFolder::files($dir, '\.css$', false, false); // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::chooseCSSFiles($template, $dir, $files, $option, $client); } function editTemplateCSS() { global $mainframe; // Initialize some variables $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $template = JRequest::getVar('id', '', 'method', 'cmd'); $filename = JRequest::getVar('filename', '', 'method', 'cmd'); jimport('joomla.filesystem.file'); if (JFile::getExt($filename) !== 'css') { $msg = JText::_('Wrong file type given, only CSS files can be edited.'); $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&task=choose_css&id='.$template, $msg, 'error'); } $content = JFile::read($client->path.DS.'templates'.DS.$template.DS.'css'.DS.$filename); if ($content !== false) { // Set FTP credentials, if given jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); $content = htmlspecialchars($content, ENT_COMPAT, 'UTF-8'); require_once (JPATH_COMPONENT.DS.'admin.templates.html.php'); TemplatesView::editCSSSource($template, $filename, $content, $option, $client, $ftp); } else { $msg = JText::sprintf('Operation Failed Could not open', $client->path.$filename); $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, $msg); } } function saveTemplateCSS() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Initialize some variables $option = JRequest::getCmd('option'); $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int')); $template = JRequest::getVar('id', '', 'post', 'cmd'); $filename = JRequest::getVar('filename', '', 'post', 'cmd'); $filecontent = JRequest::getVar('filecontent', '', 'post', 'string', JREQUEST_ALLOWRAW); if (!$template) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::_('No template specified.')); } if (!$filecontent) { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id, JText::_('Operation Failed').': '.JText::_('Content empty.')); } // Set FTP credentials, if given jimport('joomla.client.helper'); JClientHelper::setCredentialsFromRequest('ftp'); $ftp = JClientHelper::getCredentials('ftp'); $file = $client->path.DS.'templates'.DS.$template.DS.'css'.DS.$filename; // Try to make the css file writeable if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0755')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the css file writable')); } jimport('joomla.filesystem.file'); $return = JFile::write($file, $filecontent); // Try to make the css file unwriteable if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0555')) { JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the css file unwritable')); } if ($return) { $task = JRequest::getCmd('task'); switch($task) { case 'apply_css': $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&task=edit_css&id='.$template.'&filename='.$filename, JText::_('File Saved')); break; case 'save_css': default: $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&task=edit&cid[]='.$template, JText::_('File Saved')); break; } } else { $mainframe->redirect('index.php?option='.$option.'&client='.$client->id.'&id='.$template.'&task=choose_css', JText::_('Operation Failed').': '.JText::sprintf('Failed to open file for writing.', $file)); } } } joomla/joomla/administrator/components/com_templates/admin.templates.php0000766000000000000000000000534011234314074030210 0ustar adminadministratorsauthorize('com_templates', 'manage')) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } // Set the table directory JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_templates'.DS.'tables'); // Import file dependencies require_once (JPATH_COMPONENT.DS.'helpers'.DS.'template.php'); require_once (JPATH_COMPONENT.DS.'controller.php'); $task = JRequest::getCmd('task'); $client = JRequest::getVar('client', 0, '', 'int'); if ($client == 1) { JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0'); JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1', true); } elseif ($client == 0 && !$task) { JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0', true); JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1'); } else { JSubMenuHelper::addEntry(JText::_('Site'), 'index.php?option=com_templates&client=0'); JSubMenuHelper::addEntry(JText::_('Administrator'), 'index.php?option=com_templates&client=1'); } switch ($task) { case 'edit' : TemplatesController::editTemplate(); break; case 'save' : case 'apply' : TemplatesController::saveTemplate(); break; case 'edit_source' : TemplatesController::editTemplateSource(); break; case 'save_source' : case 'apply_source' : TemplatesController::saveTemplateSource(); break; case 'choose_css' : TemplatesController::chooseTemplateCSS(); break; case 'edit_css' : TemplatesController::editTemplateCSS(); break; case 'save_css' : case 'apply_css' : TemplatesController::saveTemplateCSS(); break; case 'publish' : case 'default' : TemplatesController::publishTemplate(); break; case 'cancel' : TemplatesController::cancelTemplate(); break; case 'save_positions' : TemplatesController::savePositions(); break; case 'preview' : TemplatesController::previewTemplate(); break; default : TemplatesController::viewTemplates(); break; }joomla/joomla/administrator/components/com_templates/templates.xml0000766000000000000000000000101111234314074027121 0ustar adminadministrators Template Manager Joomla! Project 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 Template Manager joomla/joomla/administrator/components/com_templates/index.html0000766000000000000000000000005411234314074026404 0ustar adminadministratorsjoomla/joomla/administrator/components/com_sections/0000777000000000000000000000000011266551124024244 5ustar adminadministratorsjoomla/joomla/administrator/components/com_sections/toolbar.sections.html.php0000766000000000000000000000425111234314072031205 0ustar adminadministrators[ '. $text.' ]', 'sections.png' ); JToolBarHelper::save(); JToolBarHelper::apply(); if ( $edit ) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.sections.edit' ); } /** * Draws the menu for Copying existing sections * @param int The published state (to display the inverse button) */ function _COPY() { JToolBarHelper::title( JText::_( 'Section' ) .': [ '. JText::_( 'Copy' ).' ]', 'section.png' ); //JToolBarHelper::title( JText::_( 'Copy Section' ), 'sections.png' ); JToolBarHelper::save( 'copysave' ); JToolBarHelper::cancel(); } /** * Draws the menu for Editing an existing category */ function _DEFAULT(){ JToolBarHelper::title( JText::_( 'Section Manager' ), 'sections.png' ); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::customX( 'copyselect', 'copy.png', 'copy_f2.png', 'Copy', true ); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::help( 'screen.sections' ); } }joomla/joomla/administrator/components/com_sections/admin.sections.php0000766000000000000000000004530211234314072027672 0ustar adminadministratorsgetUserStateFromRequest( $option.'.filter_order', 'filter_order', 's.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'.filter_order_Dir', 'filter_order_Dir', '', 'word' ); $filter_state = $mainframe->getUserStateFromRequest( $option.'.filter_state', 'filter_state', '', 'word' ); $search = $mainframe->getUserStateFromRequest( $option.'.search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where[] = 's.scope = '.$db->Quote($scope); if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 's.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 's.published = 0'; } } if ($search) { $where[] = 'LOWER(s.title) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); $orderby = ' ORDER BY '.$filter_order.' '. $filter_order_Dir .', s.ordering'; // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__sections AS s' . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT s.*, g.name AS groupname, u.name AS editor' . ' FROM #__sections AS s' . ' LEFT JOIN #__content AS cc ON s.id = cc.sectionid' . ' LEFT JOIN #__users AS u ON u.id = s.checked_out' . ' LEFT JOIN #__groups AS g ON g.id = s.access' . $where . ' GROUP BY s.id' . $orderby ; $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $db->loadObjectList(); if ($db->getErrorNum()) { echo $db->stderr(); return false; } $count = count( $rows ); // number of Active Categories for ( $i = 0; $i < $count; $i++ ) { $query = 'SELECT COUNT( a.id )' . ' FROM #__categories AS a' . ' WHERE a.section = '.$db->Quote($rows[$i]->id) . ' AND a.published <> -2' ; $db->setQuery( $query ); $active = $db->loadResult(); $rows[$i]->categories = $active; } // number of Active Items for ( $i = 0; $i < $count; $i++ ) { $query = 'SELECT COUNT( a.id )' . ' FROM #__content AS a' . ' WHERE a.sectionid = '.(int) $rows[$i]->id . ' AND a.state <> -2' ; $db->setQuery( $query ); $active = $db->loadResult(); $rows[$i]->active = $active; } // number of Trashed Items for ( $i = 0; $i < $count; $i++ ) { $query = 'SELECT COUNT( a.id )' . ' FROM #__content AS a' . ' WHERE a.sectionid = '.(int) $rows[$i]->id . ' AND a.state = -2' ; $db->setQuery( $query ); $trash = $db->loadResult(); $rows[$i]->trash = $trash; } // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; sections_html::show( $rows, $scope, $user->get('id'), $pageNav, $option, $lists ); } /** * Compiles information to add or edit a section * @param database A database connector object * @param string The name of the category section * @param integer The unique id of the category to edit (0 if new) * @param string The name of the current user */ function editSection( $edit) { global $mainframe; $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $option = JRequest::getCmd( 'option'); $scope = JRequest::getCmd( 'scope' ); $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); JArrayHelper::toInteger($cid, array(0)); $row =& JTable::getInstance('section'); // load the row from the db table if ($edit) $row->load( $cid[0] ); // fail if checked out not by 'me' if ($row->isCheckedOut( $user->get('id') )) { $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The section' ), $row->title ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $row->scope, $msg ); } if ( $edit ) { $row->checkout( $user->get('id') ); } else { $row->scope = $scope; $row->published = 1; } // build the html select list for ordering $query = 'SELECT ordering AS value, title AS text' . ' FROM #__sections' . ' WHERE scope='.$db->Quote($row->scope).' ORDER BY ordering' ; if($edit) $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query ); else $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query ); // build the select list for the image positions $active = ( $row->image_position ? $row->image_position : 'left' ); $lists['image_position'] = JHTML::_('list.positions', 'image_position', $active, NULL, 0 ); // build the html select list for images $lists['image'] = JHTML::_('list.images', 'image', $row->image ); // build the html select list for the group access $lists['access'] = JHTML::_('list.accesslevel', $row ); // build the html radio buttons for published $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ); sections_html::edit( $row, $option, $lists ); } /** * Saves the catefory after an edit form submit * @param database A database connector object * @param string The name of the category section */ function saveSection( $option, $scope, $task ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $menu = JRequest::getVar( 'menu', 'mainmenu', 'post', 'string' ); $menuid = JRequest::getVar( 'menuid', 0, 'post', 'int' ); $oldtitle = JRequest::getVar( 'oldtitle', '', '', 'post', 'string' ); $post = JRequest::get('post'); // fix up special html fields $post['description'] = JRequest::getVar( 'description', '', 'post', 'string', JREQUEST_ALLOWRAW ); $row =& JTable::getInstance('section'); if (!$row->bind($post)) { JError::raiseError(500, $row->getError() ); } if (!$row->check()) { JError::raiseError(500, $row->getError() ); } if ( $oldtitle ) { if ( $oldtitle <> $row->title ) { $query = 'UPDATE #__menu' . ' SET name = '.$db->Quote($row->title) . ' WHERE name = '.$db->Quote($oldtitle) . ' AND type = "content_section"' ; $db->setQuery( $query ); $db->query(); } } // if new item order last in appropriate group if (!$row->id) { $row->ordering = $row->getNextOrder(); } if (!$row->store()) { JError::raiseError(500, $row->getError() ); } $row->checkin(); switch ( $task ) { case 'go2menu': $mainframe->redirect( 'index.php?option=com_menus&menutype='. $menu ); break; case 'go2menuitem': $mainframe->redirect( 'index.php?option=com_menus&menutype='. $menu .'&task=edit&id='. $menuid ); break; case 'apply': $msg = JText::_( 'Changes to Section saved' ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope .'&task=edit&cid[]='. $row->id, $msg ); break; case 'save': default: $msg = JText::_( 'Section saved' ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope, $msg ); break; } } /** * Deletes one or more categories from the categories table * @param database A database connector object * @param string The name of the category section * @param array An array of unique category id numbers */ function removeSections( $cid, $scope, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select a section to delete', true ) ); } JArrayHelper::toInteger( $cid ); $cids = implode( ',', $cid ); $query = 'SELECT s.id, s.title, COUNT(c.id) AS numcat' . ' FROM #__sections AS s' . ' LEFT JOIN #__categories AS c ON c.section=s.id' . ' WHERE s.id IN ( '.$cids.' )' . ' GROUP BY s.id' ; $db->setQuery( $query ); if (!($rows = $db->loadObjectList())) { echo "\n"; } $name = array(); $err = array(); $cid = array(); foreach ($rows as $row) { if ($row->numcat == 0) { $cid[] = (int) $row->id; $name[] = $row->title; } else { $err[] = $row->title; } } if (count( $cid )) { $cids = implode( ',', $cid ); $query = 'DELETE FROM #__sections' . ' WHERE id IN ( '.$cids.' )' ; $db->setQuery( $query ); if (!$db->query()) { echo "\n"; } } if (count( $err )) { $cids = implode( ', ', $err ); $msg = JText::sprintf( 'DESCCANNOTBEREMOVED', $cids ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope, $msg ); } $names = implode( ', ', $name ); $msg = JText::sprintf( 'Sections successfully deleted', $names ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope, $msg ); } /** * Publishes or Unpublishes one or more categories * @param database A database connector object * @param string The name of the category section * @param integer A unique category id (passed from an edit form) * @param array An array of unique category id numbers * @param integer 0 if unpublishing, 1 if publishing * @param string The name of the current user */ function publishSections( $scope, $cid=null, $publish=1, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $user =& JFactory::getUser(); JArrayHelper::toInteger($cid); if ( count( $cid ) < 1 ) { $action = $publish ? 'publish' : 'unpublish'; JError::raiseError(500, JText::_( 'Select a section to '.$action, true ) ); } $cids = implode( ',', $cid ); $count = count( $cid ); $query = 'UPDATE #__sections' . ' SET published = '.(int) $publish . ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ) )' ; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError(500, $db->getErrorMsg() ); } if ( $count == 1 ) { $row =& JTable::getInstance('section'); $row->checkin( $cid[0] ); } // check if section linked to menu items if unpublishing if ( $publish == 0 ) { $query = 'SELECT id' . ' FROM #__menu' . ' WHERE type = "content_section"' . ' AND componentid IN ( '.$cids.' )' ; $db->setQuery( $query ); $menus = $db->loadObjectList(); if ($menus) { foreach ($menus as $menu) { $query = 'UPDATE #__menu' . ' SET published = '.(int) $publish . ' WHERE id = '.(int) $menu->id ; $db->setQuery( $query ); $db->query(); } } } $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope ); } /** * Cancels an edit operation * @param database A database connector object * @param string The name of the category section * @param integer A unique category id */ function cancelSection( $option, $scope ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('section'); $row->bind(JRequest::get('post')); $row->checkin(); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope ); } /** * Moves the order of a record * @param integer The increment to reorder by */ function orderSection( $uid, $inc, $option, $scope ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('section'); $row->load( $uid ); $row->move( $inc, 'scope = '.$db->Quote($row->scope) ); $mainframe->redirect( 'index.php?option='. $option .'&scope='. $scope ); } /** * Form for copying item(s) to a specific menu */ function copySectionSelect( $option, $cid, $section ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); JArrayHelper::toInteger($cid); if ( count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to move', true ) ); } ## query to list selected categories $cids = implode( ',', $cid ); $query = 'SELECT a.title, a.id' . ' FROM #__categories AS a' . ' WHERE a.section IN ( '.$cids.' )' ; $db->setQuery( $query ); $categories = $db->loadObjectList(); ## query to list items from categories $query = 'SELECT a.title, a.id' . ' FROM #__content AS a' . ' WHERE a.sectionid IN ( '.$cids.' )' . ' ORDER BY a.sectionid, a.catid, a.title' ; $db->setQuery( $query ); $contents = $db->loadObjectList(); sections_html::copySectionSelect( $option, $cid, $categories, $contents, $section ); } /** * Save the item(s) to the menu selected */ function copySectionSave( $sectionid, $scope ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $title = JRequest::getString( 'title' ); $contentid = JRequest::getVar( 'content' ); $categoryid = JRequest::getVar( 'category' ); JArrayHelper::toInteger($contentid); JArrayHelper::toInteger($categoryid); // copy section $section =& JTable::getInstance('section'); foreach( $sectionid as $id ) { $section->load( $id ); $section->id = NULL; $section->title = $title; $section->name = $title; if ( !$section->check() ) { copySectionSelect('com_sections', $sectionid, $scope ); JError::raiseWarning(500, $section->getError() ); return; } if ( !$section->store() ) { JError::raiseError(500, $section->getError() ); } $section->checkin(); $section->reorder( 'scope = '.$db->Quote($section->scope) ); // stores original catid $newsectids[]["old"] = $id; // pulls new catid $newsectids[]["new"] = $section->id; } $sectionMove = $section->id; // copy categories $category =& JTable::getInstance('category'); foreach( $categoryid as $id ) { $category->load( $id ); $category->id = NULL; $category->section = $sectionMove; foreach( $newsectids as $newsectid ) { if ( $category->section == $newsectid["old"] ) { $category->section = $newsectid["new"]; } } if (!$category->check()) { JError::raiseError(500, $category->getError() ); } if (!$category->store()) { JError::raiseError(500, $category->getError() ); } $category->checkin(); $category->reorder( 'section = '.$db->Quote($category->section) ); // stores original catid $newcatids[]["old"] = $id; // pulls new catid $newcatids[]["new"] = $category->id; } $content =& JTable::getInstance('content'); foreach( $contentid as $id) { $content->load( $id ); $content->id = NULL; $content->hits = 0; foreach( $newsectids as $newsectid ) { if ( $content->sectionid == $newsectid["old"] ) { $content->sectionid = $newsectid["new"]; } } foreach( $newcatids as $newcatid ) { if ( $content->catid == $newcatid["old"] ) { $content->catid = $newcatid["new"]; } } if (!$content->check()) { JError::raiseError(500, $content->getError() ); } if (!$content->store()) { JError::raiseError(500, $content->getError() ); } $content->checkin(); } $sectionOld =& JTable::getInstance('section'); $sectionOld->load( $sectionMove ); $msg = JText::sprintf( 'DESCCATANDITEMSCOPIED', $sectionOld-> name, $title ); $mainframe->redirect( 'index.php?option=com_sections&scope=content', $msg ); } /** * changes the access level of a record * @param integer The increment to reorder by */ function accessMenu( $uid, $access, $option ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('section'); $row->load( $uid ); $row->access = $access; if ( !$row->check() ) { return $row->getError(); } if ( !$row->store() ) { return $row->getError(); } $mainframe->redirect( 'index.php?option='. $option .'&scope='. $row->scope ); } function saveOrder( &$cid ) { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $row =& JTable::getInstance('section'); $total = count( $cid ); $order = JRequest::getVar( 'order', array(0), 'post', 'array' ); JArrayHelper::toInteger($order, array(0)); // update ordering values for( $i=0; $i < $total; $i++ ) { $row->load( (int) $cid[$i] ); if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { JError::raiseError(500, $db->getErrorMsg() ); } } } $row->reorder( ); $msg = JText::_( 'New ordering saved' ); $mainframe->redirect( 'index.php?option=com_sections&scope=content', $msg ); }joomla/joomla/administrator/components/com_sections/toolbar.sections.php0000766000000000000000000000173011234314072030241 0ustar adminadministratorsjoomla/joomla/administrator/components/com_sections/admin.sections.html.php0000766000000000000000000003102511234314072030632 0ustar adminadministrators
    :
    id; $access = JHTML::_('grid.access', $row, $i ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); ?> ">
    getListFooter(); ?>
    getRowOffset( $i ); ?> get ('id'), $row->checked_out ) ) { echo $row->title; } else { ?> title; ?> orderUpIcon( $i, true, 'orderup', 'Move Up', $ordering ); ?> orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> categories; ?> active; ?> trash; ?> id; ?>
    $row is passed with the id * property set to 0. Note that the section property must be defined * even for a new record. * @param JTableCategory The category object * @param string The html for the image list select list * @param string The html for the image position select list * @param string The html for the ordering list * @param string The html for the groups select list */ function edit( &$row, $option, &$lists ) { JRequest::setVar( 'hidemainmenu', 1 ); global $mainframe; $editor =& JFactory::getEditor(); if ( $row->name != '' ) { $name = $row->name; } else { $name = JText::_( 'New Section' ); } if ($row->image == '') { $row->image = 'blank.png'; } JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'description' ); ?>
    : scope; ?>
    :
    image != 'blank.png') { $path.= 'stories/'; } ?> <?php echo JText::_( 'Preview' ); ?>
    display( 'description', $row->description, '550', '300', '60', '20', array('pagebreak', 'readmore') ) ; ?>
    .
    :


    :
    "; foreach ( $categories as $category ) { echo "
  • ". $category->title ."
  • "; echo "\n id\" />"; } echo ""; ?>
    :
    "; foreach ( $contents as $content ) { echo "
  • ". $content->title ."
  • "; echo "\n id\" />"; } echo ""; ?>




    "; } ?>
    authorize( 'com_weblinks', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); $controller = new WeblinksController( ); // Perform the Request task $controller->execute( JRequest::getCmd('task')); $controller->redirect();joomla/joomla/administrator/components/com_weblinks/views/0000777000000000000000000000000011266551120025364 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblink/0000777000000000000000000000000011266551120027017 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblink/tmpl/0000777000000000000000000000000011266551120027773 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblink/tmpl/form.php0000766000000000000000000000754511234314110031452 0ustar adminadministrators [ ' . $text.' ]' ); JToolBarHelper::save(); if (!$edit) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } JToolBarHelper::help( 'screen.weblink.edit' ); ?>
    : lists['published']; ?>
    lists['catid']; ?>
    lists['ordering']; ?>
    params->render();?>
    joomla/joomla/administrator/components/com_weblinks/views/weblink/tmpl/index.html0000766000000000000000000000005411234314110031757 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblink/view.html.php0000766000000000000000000000562711234314110031447 0ustar adminadministratorsgetLayout() == 'form') { $this->_displayForm($tpl); return; } //get the weblink $weblink =& $this->get('data'); if ($weblink->url) { // redirects to url if matching id found $mainframe->redirect($weblink->url); } parent::display($tpl); } function _displayForm($tpl) { global $mainframe, $option; $db =& JFactory::getDBO(); $uri =& JFactory::getURI(); $user =& JFactory::getUser(); $model =& $this->getModel(); $lists = array(); //get the weblink $weblink =& $this->get('data'); $isNew = ($weblink->id < 1); // fail if checked out not by 'me' if ($model->isCheckedOut( $user->get('id') )) { $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The weblink' ), $weblink->title ); $mainframe->redirect( 'index.php?option='. $option, $msg ); } // Edit or Create? if (!$isNew) { $model->checkout( $user->get('id') ); } else { // initialise new record $weblink->published = 1; $weblink->approved = 1; $weblink->order = 0; $weblink->catid = JRequest::getVar( 'catid', 0, 'post', 'int' ); } // build the html select list for ordering $query = 'SELECT ordering AS value, title AS text' . ' FROM #__weblinks' . ' WHERE catid = ' . (int) $weblink->catid . ' ORDER BY ordering'; $lists['ordering'] = JHTML::_('list.specificordering', $weblink, $weblink->id, $query ); // build list of categories $lists['catid'] = JHTML::_('list.category', 'catid', $option, intval( $weblink->catid ) ); // build the html select list $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $weblink->published ); //clean weblink data JFilterOutput::objectHTMLSafe( $weblink, ENT_QUOTES, 'description' ); $file = JPATH_COMPONENT.DS.'models'.DS.'weblink.xml'; $params = new JParameter( $weblink->params, $file ); $this->assignRef('lists', $lists); $this->assignRef('weblink', $weblink); $this->assignRef('params', $params); parent::display($tpl); } } joomla/joomla/administrator/components/com_weblinks/views/weblink/index.html0000766000000000000000000000005411234314110031003 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblinks/0000777000000000000000000000000011266551117027210 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblinks/tmpl/0000777000000000000000000000000011266551120030156 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblinks/tmpl/default.php0000766000000000000000000001201011234314110032275 0ustar adminadministrators lists['order'] == 'a.ordering'); ?>
    : lists['catid']; echo $this->lists['state']; ?>
    items ); $i < $n; $i++) { $row = &$this->items[$i]; $link = JRoute::_( 'index.php?option=com_weblinks&view=weblink&task=edit&cid[]='. $row->id ); $checked = JHTML::_('grid.checkedout', $row, $i ); $published = JHTML::_('grid.published', $row, $i ); $row->cat_link = JRoute::_( 'index.php?option=com_categories§ion=com_weblinks&task=edit&type=other&cid[]='. $row->catid ); ?> ">
    lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?> items ); ?> lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?> lists['order_Dir'], $this->lists['order'] ); ?>
    pagination->getListFooter(); ?>
    pagination->getRowOffset( $i ); ?> user->get ('id'), $row->checked_out ) ) { echo $this->escape($row->title); } else { ?> escape($row->title); ?> pagination->orderUpIcon( $i, ($row->catid == @$this->items[$i-1]->catid),'orderup', 'Move Up', $ordering ); ?> pagination->orderDownIcon( $i, $n, ($row->catid == @$this->items[$i+1]->catid), 'orderdown', 'Move Down', $ordering ); ?> class="text_area" style="text-align: center" /> escape($row->category); ?> hits; ?> id; ?>
    joomla/joomla/administrator/components/com_weblinks/views/weblinks/tmpl/index.html0000766000000000000000000000005411234314110032142 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/weblinks/view.html.php0000766000000000000000000000455411234314110031630 0ustar adminadministratorsgetUserStateFromRequest( $option.'filter_state', 'filter_state', '', 'word' ); $filter_catid = $mainframe->getUserStateFromRequest( $option.'filter_catid', 'filter_catid', 0, 'int' ); $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'a.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $search = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); // Get data from the model $items = & $this->get( 'Data'); $total = & $this->get( 'Total'); $pagination = & $this->get( 'Pagination' ); // build list of categories $javascript = 'onchange="document.adminForm.submit();"'; $lists['catid'] = JHTML::_('list.category', 'filter_catid', $option, intval( $filter_catid ), $javascript ); // state filter $lists['state'] = JHTML::_('grid.state', $filter_state ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); parent::display($tpl); } }joomla/joomla/administrator/components/com_weblinks/views/weblinks/index.html0000766000000000000000000000005411234314110031166 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/views/index.html0000766000000000000000000000005411234314110027350 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/controller.php0000766000000000000000000001206711234314110027121 0ustar adminadministratorsregisterTask( 'add', 'display' ); $this->registerTask( 'edit', 'display' ); } function display( ) { switch($this->getTask()) { case 'add' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view' , 'weblink'); JRequest::setVar( 'edit', false ); // Checkout the weblink $model = $this->getModel('weblink'); $model->checkout(); } break; case 'edit' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view' , 'weblink'); JRequest::setVar( 'edit', true ); // Checkout the weblink $model = $this->getModel('weblink'); $model->checkout(); } break; } parent::display(); } function save() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $post = JRequest::get('post'); $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $post['id'] = (int) $cid[0]; $model = $this->getModel('weblink'); if ($model->store($post)) { $msg = JText::_( 'Weblink Saved' ); } else { $msg = JText::_( 'Error Saving Weblink' ); } // Check the table in so it can be edited.... we are done with it anyway $model->checkin(); $link = 'index.php?option=com_weblinks'; $this->setRedirect($link, $msg); } function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to delete' ) ); } $model = $this->getModel('weblink'); if(!$model->delete($cid)) { echo "\n"; } $this->setRedirect( 'index.php?option=com_weblinks' ); } function publish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to publish' ) ); } $model = $this->getModel('weblink'); if(!$model->publish($cid, 1)) { echo "\n"; } $this->setRedirect( 'index.php?option=com_weblinks' ); } function unpublish() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select an item to unpublish' ) ); } $model = $this->getModel('weblink'); if(!$model->publish($cid, 0)) { echo "\n"; } $this->setRedirect( 'index.php?option=com_weblinks' ); } function cancel() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); // Checkin the weblink $model = $this->getModel('weblink'); $model->checkin(); $this->setRedirect( 'index.php?option=com_weblinks' ); } function orderup() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = $this->getModel('weblink'); $model->move(-1); $this->setRedirect( 'index.php?option=com_weblinks'); } function orderdown() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $model = $this->getModel('weblink'); $model->move(1); $this->setRedirect( 'index.php?option=com_weblinks'); } function saveorder() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); $order = JRequest::getVar( 'order', array(), 'post', 'array' ); JArrayHelper::toInteger($cid); JArrayHelper::toInteger($order); $model = $this->getModel('weblink'); $model->saveorder($cid, $order); $msg = JText::_( 'New ordering saved' ); $this->setRedirect( 'index.php?option=com_weblinks', $msg ); } }joomla/joomla/administrator/components/com_weblinks/tables/0000777000000000000000000000000011266551120025501 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/tables/index.html0000766000000000000000000000005411234314110027465 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/tables/weblink.php0000766000000000000000000000715511234314110027645 0ustar adminadministratorsloadArray($array['params']); $array['params'] = $registry->toString(); } return parent::bind($array, $ignore); } /** * Overloaded check method to ensure data integrity * * @access public * @return boolean True on success * @since 1.0 */ function check() { if (JFilterInput::checkAttribute(array ('href', $this->url))) { $this->setError( JText::_('Please provide a valid URL')); return false; } //Remove all HTML tags from the title and description $filter = new JFilterInput(array(), array(), 0, 0); $this->description = $filter->clean($this->description); $this->title = $filter->clean($this->title); /** check for valid name */ if (trim($this->title) == '') { $this->setError(JText::_('Your Weblink must contain a title.')); return false; } if (!(eregi('http://', $this->url) || (eregi('https://', $this->url)) || (eregi('ftp://', $this->url)))) { $this->url = 'http://'.$this->url; } /** check for existing name */ $query = 'SELECT id FROM #__weblinks WHERE title = '.$this->_db->Quote($this->title).' AND catid = '.(int) $this->catid; $this->_db->setQuery($query); $xid = intval($this->_db->loadResult()); if ($xid && $xid != intval($this->id)) { $this->setError(JText::sprintf('WARNNAMETRYAGAIN', JText::_('Web Link'))); return false; } if(empty($this->alias)) { $this->alias = $this->title; } $this->alias = JFilterOutput::stringURLSafe($this->alias); if(trim(str_replace('-','',$this->alias)) == '') { $datenow =& JFactory::getDate(); $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S"); } return true; } } joomla/joomla/administrator/components/com_weblinks/index.html0000766000000000000000000000005411234314110026213 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/config.xml0000766000000000000000000000343611234314110026214 0ustar adminadministrators joomla/joomla/administrator/components/com_weblinks/models/0000777000000000000000000000000011266551121025513 5ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/models/weblink.xml0000766000000000000000000000067411234314112027670 0ustar adminadministrators joomla/joomla/administrator/components/com_weblinks/models/weblinks.php0000766000000000000000000001165711234314112030045 0ustar adminadministratorsgetUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); // In case limit has been changed, adjust limitstart accordingly $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0); $this->setState('limit', $limit); $this->setState('limitstart', $limitstart); } /** * Method to get weblinks item data * * @access public * @return array */ function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); } return $this->_data; } /** * Method to get the total number of weblink items * * @access public * @return integer */ function getTotal() { // Lets load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } /** * Method to get a pagination object for the weblinks * * @access public * @return integer */ function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { jimport('joomla.html.pagination'); $this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') ); } return $this->_pagination; } function _buildQuery() { // Get the WHERE and ORDER BY clauses for the query $where = $this->_buildContentWhere(); $orderby = $this->_buildContentOrderBy(); $query = ' SELECT a.*, cc.title AS category, u.name AS editor ' . ' FROM #__weblinks AS a ' . ' LEFT JOIN #__categories AS cc ON cc.id = a.catid ' . ' LEFT JOIN #__users AS u ON u.id = a.checked_out ' . $where . $orderby ; return $query; } function _buildContentOrderBy() { global $mainframe, $option; $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'a.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); if ($filter_order == 'a.ordering'){ $orderby = ' ORDER BY category, a.ordering '.$filter_order_Dir; } else { $orderby = ' ORDER BY '.$filter_order.' '.$filter_order_Dir.' , category, a.ordering '; } return $orderby; } function _buildContentWhere() { global $mainframe, $option; $db =& JFactory::getDBO(); $filter_state = $mainframe->getUserStateFromRequest( $option.'filter_state', 'filter_state', '', 'word' ); $filter_catid = $mainframe->getUserStateFromRequest( $option.'filter_catid', 'filter_catid', 0, 'int' ); $filter_order = $mainframe->getUserStateFromRequest( $option.'filter_order', 'filter_order', 'a.ordering', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); $search = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' ); $search = JString::strtolower( $search ); $where = array(); if ($filter_catid > 0) { $where[] = 'a.catid = '.(int) $filter_catid; } if ($search) { $where[] = 'LOWER(a.title) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); } if ( $filter_state ) { if ( $filter_state == 'P' ) { $where[] = 'a.published = 1'; } else if ($filter_state == 'U' ) { $where[] = 'a.published = 0'; } } $where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' ); return $where; } } joomla/joomla/administrator/components/com_weblinks/models/index.html0000766000000000000000000000005411234314112027500 0ustar adminadministratorsjoomla/joomla/administrator/components/com_weblinks/models/weblink.php0000766000000000000000000001765711234314112027670 0ustar adminadministratorssetId((int)$array[0]); } /** * Method to set the weblink identifier * * @access public * @param int Weblink identifier */ function setId($id) { // Set weblink id and wipe data $this->_id = $id; $this->_data = null; } /** * Method to get a weblink * * @since 1.5 */ function &getData() { // Load the weblink data if ($this->_loadData()) { // Initialize some variables $user = &JFactory::getUser(); // Check to see if the category is published if (!$this->_data->cat_pub) { JError::raiseError( 404, JText::_("Resource Not Found") ); return; } // Check whether category access level allows access if ($this->_data->cat_access > $user->get('aid', 0)) { JError::raiseError( 403, JText::_('ALERTNOTAUTH') ); return; } } else $this->_initData(); return $this->_data; } /** * Tests if weblink is checked out * * @access public * @param int A user id * @return boolean True if checked out * @since 1.5 */ function isCheckedOut( $uid=0 ) { if ($this->_loadData()) { if ($uid) { return ($this->_data->checked_out && $this->_data->checked_out != $uid); } else { return $this->_data->checked_out; } } } /** * Method to checkin/unlock the weblink * * @access public * @return boolean True on success * @since 1.5 */ function checkin() { if ($this->_id) { $weblink = & $this->getTable(); if(! $weblink->checkin($this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } } return false; } /** * Method to checkout/lock the weblink * * @access public * @param int $uid User ID of the user checking the article out * @return boolean True on success * @since 1.5 */ function checkout($uid = null) { if ($this->_id) { // Make sure we have a user id to checkout the article with if (is_null($uid)) { $user =& JFactory::getUser(); $uid = $user->get('id'); } // Lets get to it and checkout the thing... $weblink = & $this->getTable(); if(!$weblink->checkout($uid, $this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } return false; } /** * Method to store the weblink * * @access public * @return boolean True on success * @since 1.5 */ function store($data) { $row =& $this->getTable(); // Bind the form fields to the web link table if (!$row->bind($data)) { $this->setError($this->_db->getErrorMsg()); return false; } // Create the timestamp for the date $row->date = gmdate('Y-m-d H:i:s'); // if new item, order last in appropriate group if (!$row->id) { $where = 'catid = ' . (int) $row->catid ; $row->ordering = $row->getNextOrder( $where ); } // Make sure the web link table is valid if (!$row->check()) { $this->setError($this->_db->getErrorMsg()); return false; } // Store the web link table to the database if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } /** * Method to remove a weblink * * @access public * @return boolean True on success * @since 1.5 */ function delete($cid = array()) { $result = false; if (count( $cid )) { JArrayHelper::toInteger($cid); $cids = implode( ',', $cid ); $query = 'DELETE FROM #__weblinks' . ' WHERE id IN ( '.$cids.' )'; $this->_db->setQuery( $query ); if(!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } /** * Method to (un)publish a weblink * * @access public * @return boolean True on success * @since 1.5 */ function publish($cid = array(), $publish = 1) { $user =& JFactory::getUser(); if (count( $cid )) { JArrayHelper::toInteger($cid); $cids = implode( ',', $cid ); $query = 'UPDATE #__weblinks' . ' SET published = '.(int) $publish . ' WHERE id IN ( '.$cids.' )' . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ) )' ; $this->_db->setQuery( $query ); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } } return true; } /** * Method to move a weblink * * @access public * @return boolean True on success * @since 1.5 */ function move($direction) { $row =& $this->getTable(); if (!$row->load($this->_id)) { $this->setError($this->_db->getErrorMsg()); return false; } if (!$row->move( $direction, ' catid = '.(int) $row->catid.' AND published >= 0 ' )) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } /** * Method to move a weblink * * @access public * @return boolean True on success * @since 1.5 */ function saveorder($cid = array(), $order) { $row =& $this->getTable(); $groupings = array(); // update ordering values for( $i=0; $i < count($cid); $i++ ) { $row->load( (int) $cid[$i] ); // track categories $groupings[] = $row->catid; if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } } // execute updateOrder for each parent group $groupings = array_unique( $groupings ); foreach ($groupings as $group){ $row->reorder('catid = '.(int) $group); } return true; } /** * Method to load content weblink data * * @access private * @return boolean True on success * @since 1.5 */ function _loadData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = 'SELECT w.*, cc.title AS category,'. ' cc.published AS cat_pub, cc.access AS cat_access'. ' FROM #__weblinks AS w' . ' LEFT JOIN #__categories AS cc ON cc.id = w.catid' . ' WHERE w.id = '.(int) $this->_id; $this->_db->setQuery($query); $this->_data = $this->_db->loadObject(); return (boolean) $this->_data; } return true; } /** * Method to initialise the weblink data * * @access private * @return boolean True on success * @since 1.5 */ function _initData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $weblink = new stdClass(); $weblink->id = 0; $weblink->catid = 0; $weblink->sid = 0; $weblink->title = null; $weblink->alias = null; $weblink->url = null; $weblink->description = null; $weblink->date = null; $weblink->hits = 0; $weblink->published = 0; $weblink->checked_out = 0; $weblink->checked_out_time = 0; $weblink->ordering = 0; $weblink->archived = 0; $weblink->approved = 0; $weblink->params = null; $weblink->category = null; $this->_data = $weblink; return (boolean) $this->_data; } return true; } }joomla/joomla/administrator/components/com_weblinks/weblinks.xml0000766000000000000000000000102711234314110026557 0ustar adminadministrators Weblinks Joomla! Project April 2006 (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This component shows a listing of Weblinks joomla/joomla/administrator/components/com_checkin/0000777000000000000000000000000011266551205024021 5ustar adminadministratorsjoomla/joomla/administrator/components/com_checkin/toolbar.checkin.php0000766000000000000000000000141511234314100027563 0ustar adminadministratorsjoomla/joomla/administrator/components/com_checkin/admin.checkin.php0000766000000000000000000000644111234314100027215 0ustar adminadministratorsauthorize( 'com_checkin', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } $db =& JFactory::getDBO(); $nullDate = $db->getNullDate(); ?>
    getTableList(); $k = 0; foreach ($tables as $tn) { // make sure we get the right tables based on prefix if (!preg_match( "/^".$mainframe->getCfg('dbprefix')."/i", $tn )) { continue; } $fields = $db->getTableFields( array( $tn ) ); $foundCO = false; $foundCOT = false; $foundE = false; $foundCO = isset( $fields[$tn]['checked_out'] ); $foundCOT = isset( $fields[$tn]['checked_out_time'] ); $foundE = isset( $fields[$tn]['editor'] ); if ($foundCO && $foundCOT) { if ($foundE) { $query = 'SELECT checked_out, editor FROM '.$tn.' WHERE checked_out > 0'; } else { $query = 'SELECT checked_out FROM '.$tn.' WHERE checked_out > 0'; } $db->setQuery( $query ); $res = $db->query(); $num = $db->getNumRows( $res ); if ($foundE) { $query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).', editor = NULL WHERE checked_out > 0'; } else { $query = 'UPDATE '.$tn.' SET checked_out = 0, checked_out_time = '.$db->Quote($nullDate).' WHERE checked_out > 0'; } $db->setQuery( $query ); $res = $db->query(); if ($res == 1) { if ($num > 0) { echo ""; echo "\n "; echo "\n "; echo "\n "; echo "\n "; echo "\n"; } else { echo ""; echo "\n "; echo "\n "; echo "\n "; echo "\n "; echo "\n"; } $k = 1 - $k; } } } ?>
    ". JText::_( 'Checking table' ) ." - ". $tn ."". JText::_( 'Checked-In' ) ." ". $num ." ". JText::_( 'items' ) ."\"". 
    ". JText::_( 'Checking table' ) ." - ". $tn ."". JText::_( 'Checked-In' ) ." ". $num ." ". JText::_( 'items' ) ."  
    joomla/joomla/administrator/components/com_users/0000777000000000000000000000000011266551122023554 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/users.xml0000766000000000000000000000077511234314074025447 0ustar adminadministrators User Manager Joomla! Project April 2006 (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 User Manager joomla/joomla/administrator/components/com_users/views/0000777000000000000000000000000011266551122024711 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/users/0000777000000000000000000000000011266551121026051 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/users/tmpl/0000777000000000000000000000000011266551122027026 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/users/tmpl/default.php0000766000000000000000000001147611234314074031173 0ustar adminadministrators
    : lists['type'];?> lists['logged'];?>
    items ); $i < $n; $i++) { $row =& $this->items[$i]; $img = $row->block ? 'publish_x.png' : 'tick.png'; $task = $row->block ? 'unblock' : 'block'; $alt = $row->block ? JText::_( 'Enabled' ) : JText::_( 'Blocked' ); $link = 'index.php?option=com_users&view=user&task=edit&cid[]='. $row->id. ''; if ($row->lastvisitDate == "0000-00-00 00:00:00") { $lvisit = JText::_( 'Never' ); } else { $lvisit = JHTML::_('date', $row->lastvisitDate, '%Y-%m-%d %H:%M:%S'); } ?> ">
    lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?> lists['order_Dir'], @$this->lists['order'] ); ?>
    pagination->getListFooter(); ?>
    pagination->limitstart;?> id ); ?> name; ?> username; ?> loggedin ? '': ''; ?> <?php echo $alt; ?> groupname ); ?> email; ?> id; ?>
    joomla/joomla/administrator/components/com_users/views/users/tmpl/index.html0000766000000000000000000000005411234314074031021 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/users/view.html.php0000766000000000000000000001312511234314074030501 0ustar adminadministratorsgetUserStateFromRequest( "$option.filter_order", 'filter_order', 'a.name', 'cmd' ); $filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.filter_order_Dir", 'filter_order_Dir', '', 'word' ); $filter_type = $mainframe->getUserStateFromRequest( "$option.filter_type", 'filter_type', 0, 'string' ); $filter_logged = $mainframe->getUserStateFromRequest( "$option.filter_logged", 'filter_logged', 0, 'int' ); $search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' ); $search = JString::strtolower( $search ); $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $where = array(); if (isset( $search ) && $search!= '') { $searchEscaped = $db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); $where[] = 'a.username LIKE '.$searchEscaped.' OR a.email LIKE '.$searchEscaped.' OR a.name LIKE '.$searchEscaped; } if ( $filter_type ) { if ( $filter_type == 'Public Frontend' ) { $where[] = ' a.usertype = \'Registered\' OR a.usertype = \'Author\' OR a.usertype = \'Editor\' OR a.usertype = \'Publisher\' '; } else if ( $filter_type == 'Public Backend' ) { $where[] = 'a.usertype = \'Manager\' OR a.usertype = \'Administrator\' OR a.usertype = \'Super Administrator\' '; } else { $where[] = 'a.usertype = LOWER( '.$db->Quote($filter_type).' ) '; } } if ( $filter_logged == 1 ) { $where[] = 's.userid = a.id'; } else if ($filter_logged == 2) { $where[] = 's.userid IS NULL'; } // exclude any child group id's for this user $pgids = $acl->get_group_children( $currentUser->get('gid'), 'ARO', 'RECURSE' ); if (is_array( $pgids ) && count( $pgids ) > 0) { JArrayHelper::toInteger($pgids); $where[] = 'a.gid NOT IN (' . implode( ',', $pgids ) . ')'; } $filter = ''; if ($filter_logged == 1 || $filter_logged == 2) { $filter = ' INNER JOIN #__session AS s ON s.userid = a.id'; } $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir; $where = ( count( $where ) ? ' WHERE (' . implode( ') AND (', $where ) . ')' : '' ); $query = 'SELECT COUNT(a.id)' . ' FROM #__users AS a' . $filter . $where ; $db->setQuery( $query ); $total = $db->loadResult(); jimport('joomla.html.pagination'); $pagination = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT a.*, g.name AS groupname' . ' FROM #__users AS a' . ' INNER JOIN #__core_acl_aro AS aro ON aro.value = a.id' . ' INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.id' . ' INNER JOIN #__core_acl_aro_groups AS g ON g.id = gm.group_id' . $filter . $where . ' GROUP BY a.id' . $orderby ; $db->setQuery( $query, $pagination->limitstart, $pagination->limit ); $rows = $db->loadObjectList(); $n = count( $rows ); $template = 'SELECT COUNT(s.userid)' . ' FROM #__session AS s' . ' WHERE s.userid = %d' ; for ($i = 0; $i < $n; $i++) { $row = &$rows[$i]; $query = sprintf( $template, intval( $row->id ) ); $db->setQuery( $query ); $row->loggedin = $db->loadResult(); } // get list of Groups for dropdown filter $query = 'SELECT name AS value, name AS text' . ' FROM #__core_acl_aro_groups' . ' WHERE name != "ROOT"' . ' AND name != "USERS"' ; $db->setQuery( $query ); $types[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Group' ) .' -' ); foreach( $db->loadObjectList() as $obj ) { $types[] = JHTML::_('select.option', $obj->value, JText::_( $obj->text ) ); } $lists['type'] = JHTML::_('select.genericlist', $types, 'filter_type', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', "$filter_type" ); // get list of Log Status for dropdown filter $logged[] = JHTML::_('select.option', 0, '- '. JText::_( 'Select Log Status' ) .' -'); $logged[] = JHTML::_('select.option', 1, JText::_( 'Logged In' ) ); $lists['logged'] = JHTML::_('select.genericlist', $logged, 'filter_logged', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', "$filter_logged" ); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search']= $search; $this->assignRef('user', JFactory::getUser()); $this->assignRef('lists', $lists); $this->assignRef('items', $rows); $this->assignRef('pagination', $pagination); parent::display($tpl); } }joomla/joomla/administrator/components/com_users/views/users/index.html0000766000000000000000000000005411234314074030045 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/index.html0000766000000000000000000000005411234314074026704 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/user/0000777000000000000000000000000011266551122025667 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/user/tmpl/0000777000000000000000000000000011266551122026643 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/user/tmpl/form.php0000766000000000000000000002130411234314074030316 0ustar adminadministrators [ '. $text .' ]' , 'user.png' ); JToolBarHelper::save(); JToolBarHelper::apply(); if ( $edit ) { // for existing items the button is renamed `close` JToolBarHelper::cancel( 'cancel', 'Close' ); } else { JToolBarHelper::cancel(); } JToolBarHelper::help( 'screen.users.edit' ); $cparams = JComponentHelper::getParams ('com_media'); ?> user, ENT_QUOTES, '' ); if ($this->user->get('lastvisitDate') == "0000-00-00 00:00:00") { $lvisit = JText::_( 'Never' ); } else { $lvisit = JHTML::_('date', $this->user->get('lastvisitDate'), '%Y-%m-%d %H:%M:%S'); } ?>
    me->authorize( 'com_users', 'block user' )) { ?> me->authorize( 'com_users', 'email_events' )) { ?> user->get('id') ) { ?>
    user->get('password')) : ?>
    user->get('password')) : ?>
    lists['gid']; ?>
    lists['block']; ?>
    lists['sendEmail']; ?>
    user->get('registerDate'), '%Y-%m-%d %H:%M:%S');?>
    user->getParameters(true); echo $params->render( 'params' ); ?>
    contact ) { ?>

    :
    .


    contact[0]->image) { ?>
    contact[0]->name;?>
    contact[0]->con_position;?>
    contact[0]->telephone;?>
    contact[0]->fax;?>
    contact[0]->misc;?>
    <?php echo JText::_( 'Contact' ); ?>
     



    ' Contact -> Manage Contacts' ); ?>'
    me->authorize( 'com_users', 'email_events' )) { ?>
    joomla/joomla/administrator/components/com_users/views/user/tmpl/index.html0000766000000000000000000000005411234314074030636 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/views/user/view.html.php0000766000000000000000000001041611234314074030316 0ustar adminadministratorsbind($post); } if ( $user->get('id')) { $query = 'SELECT *' . ' FROM #__contact_details' . ' WHERE user_id = '.(int) $cid[0] ; $db->setQuery( $query ); $contact = $db->loadObjectList(); } else { $contact = NULL; // Get the default group id for a new user $config = &JComponentHelper::getParams( 'com_users' ); $newGrp = $config->get( 'new_usertype' ); $user->set( 'gid', $acl->get_group_id( $newGrp, null, 'ARO' ) ); } $userObjectID = $acl->get_object_id( 'users', $user->get('id'), 'ARO' ); $userGroups = $acl->get_object_groups( $userObjectID, 'ARO' ); $userGroupName = strtolower( $acl->get_group_name( $userGroups[0], 'ARO' ) ); $myObjectID = $acl->get_object_id( 'users', $myuser->get('id'), 'ARO' ); $myGroups = $acl->get_object_groups( $myObjectID, 'ARO' ); $myGroupName = strtolower( $acl->get_group_name( $myGroups[0], 'ARO' ) );; // ensure user can't add/edit group higher than themselves /* NOTE : This check doesn't work commented out for the time being if ( is_array( $myGroups ) && count( $myGroups ) > 0 ) { $excludeGroups = (array) $acl->get_group_children( $myGroups[0], 'ARO', 'RECURSE' ); } else { $excludeGroups = array(); } if ( in_array( $userGroups[0], $excludeGroups ) ) { echo 'not auth'; $mainframe->redirect( 'index.php?option=com_users', JText::_('NOT_AUTH') ); } */ /* if ( $userGroupName == 'super administrator' ) { // super administrators can't change $lists['gid'] = ''. JText::_( 'Super Administrator' ) .''; } else if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' ) { */ if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' ) { // administrators can't change each other $lists['gid'] = ''. JText::_( 'Administrator' ) .''; } else { $gtree = $acl->get_group_children_tree( null, 'USERS', false ); // remove users 'above' me //$i = 0; //while ($i < count( $gtree )) { // if ( in_array( $gtree[$i]->value, (array)$excludeGroups ) ) { // array_splice( $gtree, $i, 1 ); // } else { // $i++; // } //} $lists['gid'] = JHTML::_('select.genericlist', $gtree, 'gid', 'size="10"', 'value', 'text', $user->get('gid') ); } // build the html select list $lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox" size="1"', $user->get('block') ); // build the html select list $lists['sendEmail'] = JHTML::_('select.booleanlist', 'sendEmail', 'class="inputbox" size="1"', $user->get('sendEmail') ); $this->assignRef('me', $me); $this->assignRef('lists', $lists); $this->assignRef('user', $user); $this->assignRef('contact', $contact); parent::display($tpl); } } joomla/joomla/administrator/components/com_users/views/user/index.html0000766000000000000000000000005411234314074027662 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/controller.php0000766000000000000000000003035111234314074026451 0ustar adminadministratorsregisterTask( 'add' , 'display' ); $this->registerTask( 'edit' , 'display' ); $this->registerTask( 'apply', 'save' ); $this->registerTask( 'flogout', 'logout'); $this->registerTask( 'unblock', 'block' ); } /** * Displays a view */ function display( ) { switch($this->getTask()) { case 'add' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view', 'user' ); JRequest::setVar( 'edit', false ); } break; case 'edit' : { JRequest::setVar( 'hidemainmenu', 1 ); JRequest::setVar( 'layout', 'form' ); JRequest::setVar( 'view', 'user' ); JRequest::setVar( 'edit', true ); } break; } parent::display(); } /** * Saves the record */ function save() { global $mainframe; // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $option = JRequest::getCmd( 'option'); // Initialize some variables $db = & JFactory::getDBO(); $me = & JFactory::getUser(); $acl =& JFactory::getACL(); $MailFrom = $mainframe->getCfg('mailfrom'); $FromName = $mainframe->getCfg('fromname'); $SiteName = $mainframe->getCfg('sitename'); // Create a new JUser object $user = new JUser(JRequest::getVar( 'id', 0, 'post', 'int')); $original_gid = $user->get('gid'); $post = JRequest::get('post'); $post['username'] = JRequest::getVar('username', '', 'post', 'username'); $post['password'] = JRequest::getVar('password', '', 'post', 'string', JREQUEST_ALLOWRAW); $post['password2'] = JRequest::getVar('password2', '', 'post', 'string', JREQUEST_ALLOWRAW); if (!$user->bind($post)) { $mainframe->enqueueMessage(JText::_('CANNOT SAVE THE USER INFORMATION'), 'message'); $mainframe->enqueueMessage($user->getError(), 'error'); //$mainframe->redirect( 'index.php?option=com_users', $user->getError() ); //return false; return $this->execute('edit'); } $objectID = $acl->get_object_id( 'users', $user->get('id'), 'ARO' ); $groups = $acl->get_object_groups( $objectID, 'ARO' ); $this_group = strtolower( $acl->get_group_name( $groups[0], 'ARO' ) ); if ( $user->get('id') == $me->get( 'id' ) && $user->get('block') == 1 ) { $msg = JText::_( 'You cannot block Yourself!' ); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('edit'); } else if ( ( $this_group == 'super administrator' ) && $user->get('block') == 1 ) { $msg = JText::_( 'You cannot block a Super Administrator' ); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('edit'); } else if ( ( $this_group == 'administrator' ) && ( $me->get( 'gid' ) == 24 ) && $user->get('block') == 1 ) { $msg = JText::_( 'WARNBLOCK' ); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('edit'); } else if ( ( $this_group == 'super administrator' ) && ( $me->get( 'gid' ) != 25 ) ) { $msg = JText::_( 'You cannot edit a super administrator account' ); $mainframe->enqueueMessage($msg, 'message'); return $this->execute('edit'); } // Are we dealing with a new user which we need to create? $isNew = ($user->get('id') < 1); if (!$isNew) { // if group has been changed and where original group was a Super Admin if ( $user->get('gid') != $original_gid && $original_gid == 25 ) { // count number of active super admins $query = 'SELECT COUNT( id )' . ' FROM #__users' . ' WHERE gid = 25' . ' AND block = 0' ; $db->setQuery( $query ); $count = $db->loadResult(); if ( $count <= 1 ) { // disallow change if only one Super Admin exists $this->setRedirect( 'index.php?option=com_users', JText::_('WARN_ONLY_SUPER') ); return false; } } } /* * Lets save the JUser object */ if (!$user->save()) { $mainframe->enqueueMessage(JText::_('CANNOT SAVE THE USER INFORMATION'), 'message'); $mainframe->enqueueMessage($user->getError(), 'error'); return $this->execute('edit'); } /* * Time for the email magic so get ready to sprinkle the magic dust... */ if ($isNew) { $adminEmail = $me->get('email'); $adminName = $me->get('name'); $subject = JText::_('NEW_USER_MESSAGE_SUBJECT'); $message = sprintf ( JText::_('NEW_USER_MESSAGE'), $user->get('name'), $SiteName, JURI::root(), $user->get('username'), $user->password_clear ); if ($MailFrom != '' && $FromName != '') { $adminName = $FromName; $adminEmail = $MailFrom; } JUtility::sendMail( $adminEmail, $adminName, $user->get('email'), $subject, $message ); } // If updating self, load the new user object into the session if ($user->get('id') == $me->get('id')) { // Get an ACL object $acl = &JFactory::getACL(); // Get the user group from the ACL $grp = $acl->getAroGroup($user->get('id')); // Mark the user as logged in $user->set('guest', 0); $user->set('aid', 1); // Fudge Authors, Editors, Publishers and Super Administrators into the special access group if ($acl->is_group_child_of($grp->name, 'Registered') || $acl->is_group_child_of($grp->name, 'Public Backend')) { $user->set('aid', 2); } // Set the usertype based on the ACL group name $user->set('usertype', $grp->name); $session = &JFactory::getSession(); $session->set('user', $user); } switch ( $this->getTask() ) { case 'apply': $msg = JText::sprintf( 'Successfully Saved changes to User', $user->get('name') ); $this->setRedirect( 'index.php?option=com_users&view=user&task=edit&cid[]='. $user->get('id'), $msg ); break; case 'save': default: $msg = JText::sprintf( 'Successfully Saved User', $user->get('name') ); $this->setRedirect( 'index.php?option=com_users', $msg ); break; } } /** * Removes the record(s) from the database */ function remove() { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $currentUser =& JFactory::getUser(); $acl =& JFactory::getACL(); $cid = JRequest::getVar( 'cid', array(), '', 'array' ); JArrayHelper::toInteger( $cid ); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select a User to delete', true ) ); } foreach ($cid as $id) { // check for a super admin ... can't delete them $objectID = $acl->get_object_id( 'users', $id, 'ARO' ); $groups = $acl->get_object_groups( $objectID, 'ARO' ); $this_group = strtolower( $acl->get_group_name( $groups[0], 'ARO' ) ); $success = false; if ( $this_group == 'super administrator' ) { $msg = JText::_( 'You cannot delete a Super Administrator' ); } else if ( $id == $currentUser->get( 'id' ) ) { $msg = JText::_( 'You cannot delete Yourself!' ); } else if ( ( $this_group == 'administrator' ) && ( $currentUser->get( 'gid' ) == 24 ) ) { $msg = JText::_( 'WARNDELETE' ); } else { $user =& JUser::getInstance((int)$id); $count = 2; if ( $user->get( 'gid' ) == 25 ) { // count number of active super admins $query = 'SELECT COUNT( id )' . ' FROM #__users' . ' WHERE gid = 25' . ' AND block = 0' ; $db->setQuery( $query ); $count = $db->loadResult(); } if ( $count <= 1 && $user->get( 'gid' ) == 25 ) { // cannot delete Super Admin where it is the only one that exists $msg = "You cannot delete this Super Administrator as it is the only active Super Administrator for your site"; } else { // delete user $user->delete(); $msg = ''; JRequest::setVar( 'task', 'remove' ); JRequest::setVar( 'cid', $id ); // delete user acounts active sessions $this->logout(); } } } $this->setRedirect( 'index.php?option=com_users', $msg); } /** * Cancels an edit operation */ function cancel( ) { $this->setRedirect( 'index.php?option=com_users' ); } /** * Disables the user account */ function block( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); $db =& JFactory::getDBO(); $acl =& JFactory::getACL(); $currentUser =& JFactory::getUser(); $cid = JRequest::getVar( 'cid', array(), '', 'array' ); $block = $this->getTask() == 'block' ? 1 : 0; JArrayHelper::toInteger( $cid ); if (count( $cid ) < 1) { JError::raiseError(500, JText::_( 'Select a User to '.$this->getTask(), true ) ); } foreach ($cid as $id) { // check for a super admin ... can't delete them $objectID = $acl->get_object_id( 'users', $id, 'ARO' ); $groups = $acl->get_object_groups( $objectID, 'ARO' ); $this_group = strtolower( $acl->get_group_name( $groups[0], 'ARO' ) ); $success = false; if ( $this_group == 'super administrator' ) { $msg = JText::_( 'You cannot block a Super Administrator' ); } else if ( $id == $currentUser->get( 'id' ) ) { $msg = JText::_( 'You cannot block Yourself!' ); } else if ( ( $this_group == 'administrator' ) && ( $currentUser->get( 'gid' ) == 24 ) ) { $msg = JText::_( 'WARNBLOCK' ); } else { $user =& JUser::getInstance((int)$id); $count = 2; if ( $user->get( 'gid' ) == 25 ) { // count number of active super admins $query = 'SELECT COUNT( id )' . ' FROM #__users' . ' WHERE gid = 25' . ' AND block = 0' ; $db->setQuery( $query ); $count = $db->loadResult(); } if ( $count <= 1 && $user->get( 'gid' ) == 25 ) { // cannot delete Super Admin where it is the only one that exists $msg = "You cannot block this Super Administrator as it is the only active Super Administrator for your site"; } else { $user =& JUser::getInstance((int)$id); $user->block = $block; $user->save(); if($block) { JRequest::setVar( 'task', 'block' ); JRequest::setVar( 'cid', array($id) ); // delete user acounts active sessions $this->logout(); } } } } $this->setRedirect( 'index.php?option=com_users', $msg); } /** * Force log out a user */ function logout( ) { // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); global $mainframe; $db =& JFactory::getDBO(); $task = $this->getTask(); $cids = JRequest::getVar( 'cid', array(), '', 'array' ); $client = JRequest::getVar( 'client', 0, '', 'int' ); $id = JRequest::getVar( 'id', 0, '', 'int' ); JArrayHelper::toInteger($cids); if ( count( $cids ) < 1 ) { $this->setRedirect( 'index.php?option=com_users', JText::_( 'User Deleted' ) ); return false; } foreach($cids as $cid) { $options = array(); if ($task == 'logout' || $task == 'block') { $options['clientid'][] = 0; //site $options['clientid'][] = 1; //administrator } else if ($task == 'flogout') { $options['clientid'][] = $client; } $mainframe->logout((int)$cid, $options); } $msg = JText::_( 'User Session Ended' ); switch ( $task ) { case 'flogout': $this->setRedirect( 'index.php', $msg ); break; case 'remove': case 'block': return; break; default: $this->setRedirect( 'index.php?option=com_users', $msg ); break; } } function contact() { $contact_id = JRequest::getVar( 'contact_id', '', 'post', 'int' ); $this->setRedirect( 'index.php?option=com_contact&task=edit&cid[]='. $contact_id ); } } joomla/joomla/administrator/components/com_users/index.html0000766000000000000000000000005411234314074025547 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/config.xml0000766000000000000000000000202311234314074025537 0ustar adminadministrators joomla/joomla/administrator/components/com_users/users.php0000766000000000000000000000207511234314074025431 0ustar adminadministratorsauthorize( 'com_users', 'manage' )) { $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); } // Require the base controller require_once (JPATH_COMPONENT.DS.'controller.php'); // Create the controller $controller = new UsersController( ); // Perform the Request task $controller->execute( JRequest::getCmd('task')); $controller->redirect();joomla/joomla/administrator/components/com_users/models/0000777000000000000000000000000011266551123025040 5ustar adminadministratorsjoomla/joomla/administrator/components/com_users/models/user.xml0000766000000000000000000000126511234314074026542 0ustar adminadministrators
    joomla/joomla/administrator/components/com_users/models/registered.xml0000766000000000000000000000054311234314074027717 0ustar adminadministrators
    Registered User Type
    joomla/joomla/administrator/components/com_users/models/author.xml0000766000000000000000000000110411234314074027056 0ustar adminadministrators
    Author User Type
    joomla/joomla/administrator/components/com_users/models/index.html0000766000000000000000000000005411234314074027032 0ustar adminadministratorsjoomla/joomla/administrator/components/com_users/users.class.php0000766000000000000000000000164311234314074026535 0ustar adminadministratorsjoomla/joomla/administrator/modules/0000777000000000000000000000000011266551060021041 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_logged/0000777000000000000000000000000011266551057023147 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_logged/tmpl/0000777000000000000000000000000011266551057024123 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_logged/tmpl/default.php0000766000000000000000000000417311234314114026250 0ustar adminadministrators
    authorize( 'com_users', 'manage' ); if ($auth) : $link = 'index.php?option=com_users&task=edit&cid[]='. $row->userid; $name = ''. $row->username .''; else : $name = $row->username; endif; $clientInfo =& JApplicationHelper::getClientInfo($row->client_id); ?>
    getRowOffset( $i ); ?> usertype;?> name;?> time)/3600.0 );?> get('gid') > 24 && $row->userid != $user->get('id')) : ?>
    joomla/joomla/administrator/modules/mod_logged/tmpl/index.html0000766000000000000000000000005411234314114026102 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_logged/mod_logged.php0000766000000000000000000000342111234314114025743 0ustar adminadministratorsgetUserStateFromRequest('limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest('mod_logged.limitstart', 'limitstart', 0, 'int'); // hides Administrator or Super Administrator from list depending on usertype $and = ''; // administrator check if ( $user->get('gid') == 24 ) { $and = ' AND gid != "25"'; } // manager check if ( $user->get('gid') == 23 ) { $and = ' AND gid != "25"'; $and .= ' AND gid != "24"'; } // get the total number of records $query = 'SELECT COUNT(*)' . ' FROM #__session' . ' WHERE userid != 0' . $and . ' ORDER BY usertype, username' ; $db->setQuery( $query ); $total = $db->loadResult(); // page navigation $pageNav = new JPagination( $total, $limitstart, $limit ); $query = 'SELECT username, time, userid, usertype, client_id' . ' FROM #__session' . ' WHERE userid != 0' . $and . ' ORDER BY usertype, username' ; $db->setQuery( $query ); $rows = $db->loadObjectList(); require( dirname( __FILE__ ).DS.'tmpl'.DS.'default.php' ); joomla/joomla/administrator/modules/mod_logged/index.html0000766000000000000000000000005411234314114025126 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_logged/mod_logged.xml0000766000000000000000000000150311234314114025753 0ustar adminadministrators Logged in Users Joomla! Project January 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows a list of the currently logged in users mod_logged.php joomla/joomla/administrator/modules/mod_stats/0000777000000000000000000000000011266551055023042 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_stats/mod_stats.php0000766000000000000000000000245311234314114025541 0ustar adminadministratorssetQuery( $query ); $rows = $db->loadObjectList(); ?> menutype; ?>
    menutype;?> numitems;?>
    joomla/joomla/administrator/modules/mod_stats/index.html0000766000000000000000000000005411234314114025023 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_stats/mod_stats.xml0000766000000000000000000000147211234314114025552 0ustar adminadministrators Items Stats Joomla! Project July 2004 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 DESCITEMSSTATS mod_stats.php joomla/joomla/administrator/modules/mod_popular/0000777000000000000000000000000011266551056023367 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_popular/mod_popular.php0000766000000000000000000000307511234314114026412 0ustar adminadministrators -2' . ' ORDER BY hits DESC' ; $db->setQuery( $query, 0, 10 ); $rows = $db->loadObjectList(); ?> id; ?>
    title, ENT_QUOTES, 'UTF-8');?> created, '%Y-%m-%d %H:%M:%S'); ?> hits;?>
    joomla/joomla/administrator/modules/mod_popular/index.html0000766000000000000000000000005411234314114025347 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_popular/mod_popular.xml0000766000000000000000000000142511234314114026420 0ustar adminadministrators Popular Items Joomla! Project July 2004 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 DESCPOPULARITEMS mod_popular.php joomla/joomla/administrator/modules/mod_quickicon/0000777000000000000000000000000011266551055023671 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_quickicon/mod_quickicon.php0000766000000000000000000000541711234314114027222 0ustar adminadministratorsgetTemplate(); ?>
    get('gid') > 23 ) { $link = 'index.php?option=com_menus'; quickiconButton( $link, 'icon-48-menumgr.png', JText::_( 'Menu Manager' ) ); } if ( $user->get('gid') > 24 ) { $link = 'index.php?option=com_languages&client=0'; quickiconButton( $link, 'icon-48-language.png', JText::_( 'Language Manager' ) ); } if ( $user->get('gid') > 23 ) { $link = 'index.php?option=com_users'; quickiconButton( $link, 'icon-48-user.png', JText::_( 'User Manager' ) ); } if ( $user->get('gid') > 24 ) { $link = 'index.php?option=com_config'; quickiconButton( $link, 'icon-48-config.png', JText::_( 'Global Configuration' ) ); } ?>
    Quick Icons Joomla! Project Nov 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows Quick Icons that are visible on the Admin area Home Page mod_quickicon.php joomla/joomla/administrator/modules/mod_quickicon/index.html0000766000000000000000000000005411234314114025652 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_latest/0000777000000000000000000000000011266551057023202 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_latest/mod_latest.php0000766000000000000000000000577611234314114026050 0ustar adminadministratorsget('id'); $where = 'WHERE a.state <> -2'; // User Filter switch ($params->get( 'user_id' )) { case 'by_me': $where .= ' AND (created_by = ' . (int) $userId . ' OR modified_by = ' . (int) $userId . ')'; break; case 'not_me': $where .= ' AND (created_by <> ' . (int) $userId . ' AND modified_by <> ' . (int) $userId . ')'; break; } // Ordering switch ($params->get( 'ordering' )) { case 'm_dsc': $ordering = 'modified DESC, created DESC'; $dateProperty = 'modified'; break; case 'c_dsc': default: $ordering = 'created DESC'; $dateProperty = 'created'; break; } $query = 'SELECT a.id, a.sectionid, a.title, a.created, a.modified, u.name, a.created_by_alias, a.created_by' . ' FROM #__content AS a' . ' LEFT JOIN #__users AS u ON u.id = a.created_by' . ' '. $where . ' ORDER BY '. $ordering ; $db->setQuery( $query, 0, 10 ); $rows = $db->loadObjectList(); ?> id; if ( $user->authorize( 'administration', 'manage', 'components', 'com_users' ) ) { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $linkA = 'index.php?option=com_users&task=edit&cid[]='. $row->created_by; $author = ''. htmlspecialchars( $row->name, ENT_QUOTES, 'UTF-8' ) .''; } } else { if ( $row->created_by_alias ) { $author = $row->created_by_alias; } else { $author = htmlspecialchars( $row->name, ENT_QUOTES, 'UTF-8' ); } } ?>
    title, ENT_QUOTES, 'UTF-8');?> $dateProperty, '%Y-%m-%d %H:%M:%S'); ?>
    joomla/joomla/administrator/modules/mod_latest/mod_latest.xml0000766000000000000000000000242411234314114026044 0ustar adminadministrators Latest News Joomla! Project July 2004 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 DESCLATESTNEWS mod_latest.php joomla/joomla/administrator/modules/mod_latest/index.html0000766000000000000000000000005411234314114025161 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_toolbar/0000777000000000000000000000000011266551054023345 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_toolbar/mod_toolbar.php0000766000000000000000000000145611234314114026353 0ustar adminadministratorsrender('toolbar');joomla/joomla/administrator/modules/mod_toolbar/index.html0000766000000000000000000000005411234314114025327 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_toolbar/mod_toolbar.xml0000766000000000000000000000155111234314114026360 0ustar adminadministrators Toolbar Joomla! Project Nov 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows the toolbar icons used to control actions throughout the administrator area mod_toolbar.php joomla/joomla/administrator/modules/mod_online/0000777000000000000000000000000011266551056023171 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_online/mod_online.xml0000766000000000000000000000150611234314114026024 0ustar adminadministrators Online Users Joomla! Project Jan 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows a list of the Backend Users logged in mod_online.php joomla/joomla/administrator/modules/mod_online/index.html0000766000000000000000000000005411234314114025151 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_online/mod_online.php0000766000000000000000000000203711234314114026013 0ustar adminadministratorsgetId(); // Get no. of users online not including current session $query = 'SELECT COUNT( session_id )' . ' FROM #__session' . ' WHERE session_id <> '.$db->Quote($session_id) ; $db->setQuery($query); $online_num = intval( $db->loadResult() ); echo $online_num . ' '. JText::_( 'Users Online' ) .'';joomla/joomla/administrator/modules/mod_custom/0000777000000000000000000000000011266551061023213 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_custom/index.html0000766000000000000000000000005411234314114025177 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_custom/mod_custom.xml0000766000000000000000000000121411234314114026074 0ustar adminadministrators Custom HTML Joomla! Project July 2004 (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 DESCMODCUSTOM joomla/joomla/administrator/modules/mod_unread/0000777000000000000000000000000011266551054023161 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_unread/mod_unread.php0000766000000000000000000000242111234314114025774 0ustar adminadministratorsget('id') ; $db->setQuery( $query ); $unread = $db->loadResult(); if ($unread) { echo "$unread \""."; } else { echo "$unread \""."; }joomla/joomla/administrator/modules/mod_unread/mod_unread.xml0000766000000000000000000000146711234314114026016 0ustar adminadministrators Unread Items Joomla! Project Nov 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows a list of unread items mod_unread.php joomla/joomla/administrator/modules/mod_unread/index.html0000766000000000000000000000005411234314114025143 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_footer/0000777000000000000000000000000011266551060023176 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_footer/index.html0000766000000000000000000000005411234314114025163 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_footer/mod_footer.php0000766000000000000000000000161511234314114026040 0ustar adminadministrators
    URL; ?>
    getLongVersion(); ?>
    joomla/joomla/administrator/modules/mod_footer/mod_footer.xml0000766000000000000000000000155111234314114026050 0ustar adminadministrators Footer Joomla! Project Nov 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows the Joomla! Copyright information mod_footer.php joomla/joomla/administrator/modules/mod_status/0000777000000000000000000000000011266551055023227 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_status/mod_status.php0000766000000000000000000000474511234314114026121 0ustar adminadministratorsgetId(); $output = array(); // Legacy Mode if (defined('_JLEGACY')) { $output[] = ''.JText::_('Legacy').': '._JLEGACY.''; } // Print the preview button $output[] = "".JText::_('Preview').""; // Get the number of unread messages in your inbox $query = 'SELECT COUNT(*)' . ' FROM #__messages' . ' WHERE state = 0' . ' AND user_id_to = '.(int) $user->get('id'); $db->setQuery( $query ); $unread = $db->loadResult(); if (JRequest::getInt('hidemainmenu')) { $inboxLink = ''; } else { $inboxLink = ''; } // Print the inbox message if ($unread) { $output[] = $inboxLink.''.$unread.''; } else { $output[] = $inboxLink.''.$unread.''; } // Get the number of logged in users $query = 'SELECT COUNT( session_id )' . ' FROM #__session' . ' WHERE guest <> 1' ; $db->setQuery($query); $online_num = intval( $db->loadResult() ); //Print the logged in users message $output[] = "".$online_num.""; if ($task == 'edit' || $task == 'editA' || JRequest::getInt('hidemainmenu') ) { // Print the logout message $output[] = "".JText::_('Logout').""; } else { // Print the logout message $output[] = "".JText::_('Logout').""; } // reverse rendering order for rtl display if ( $lang->isRTL() ) { $output = array_reverse( $output ); } // output the module foreach ($output as $item){ echo $item; }joomla/joomla/administrator/modules/mod_status/mod_status.xml0000766000000000000000000000146711234314114026130 0ustar adminadministrators User Status Joomla! Project Feb 2006 (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This module shows the status of the logged in user. mod_status.php joomla/joomla/administrator/modules/mod_status/index.html0000766000000000000000000000005411234314114025210 0ustar adminadministratorsjoomla/joomla/administrator/modules/index.html0000766000000000000000000000005411234314114023026 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_title/0000777000000000000000000000000011266551055023025 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_title/mod_title.xml0000766000000000000000000000146711234314114025524 0ustar adminadministrators Title Joomla! Project Nov 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows the toolbar component title mod_toolbar.php joomla/joomla/administrator/modules/mod_title/mod_title.php0000766000000000000000000000136011234314114025503 0ustar adminadministratorsget('JComponentTitle'); // Echo title if it exists if (!empty($title)) { echo $title; }joomla/joomla/administrator/modules/mod_title/index.html0000766000000000000000000000005411234314114025006 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_submenu/0000777000000000000000000000000011266551055023362 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_submenu/mod_submenu.xml0000766000000000000000000000153011234314114026405 0ustar adminadministrators Admin Submenu Joomla! Project Feb 2006 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 This module shows the submenu navigation module mod_submenu.php joomla/joomla/administrator/modules/mod_submenu/index.html0000766000000000000000000000005411234314114025343 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_submenu/mod_submenu.php0000766000000000000000000000666311234314114026410 0ustar adminadministrators_bar; if(!is_array($list) || !count($list)) { $option = JRequest::getCmd('option'); if($option == 'com_categories') { $section = JRequest::getCmd('section'); if ($section) { if ($section != 'content') { // special handling for specific core components $map['com_contact_details'] = 'com_contact'; $map['com_banner'] = 'com_banners'; $option = isset( $map[$section] ) ? $map[$section] : $section; } } } $list = JAdminSubMenu::_loadDBList($option); } if (!is_array($list) || !count($list)) { return null; } $hide = JRequest::getInt('hidemainmenu'); $txt = "
      \n"; /* * Iterate through the link items for building the menu items */ foreach ($list as $item) { $txt .= "
    • \n"; if ($hide) { if (isset ($item[2]) && $item[2] == 1) { $txt .= "".$item[0]."\n"; } else { $txt .= "".$item[0]."\n"; } } else { if (isset ($item[2]) && $item[2] == 1) { $txt .= "".$item[0]."\n"; } else { $txt .= "".$item[0]."\n"; } } $txt .= "
    • \n"; } $txt .= "
    \n"; return $txt; } function _loadDBList( $componentOption ) { $db =& JFactory::getDBO(); $lang =& JFactory::getLanguage(); $lang->load($componentOption.'.menu'); $query = 'SELECT a.name, a.admin_menu_link, a.admin_menu_img' . ' FROM #__components AS a' . ' INNER JOIN #__components AS b ON b.id = a.parent' . ' WHERE b.option = ' . $db->Quote( $componentOption ) . ' AND b.parent = 0'. ' ORDER BY a.ordering ASC'; $db->setQuery($query); $items = $db->loadObjectList(); // Process the items $subMenuList = array(); foreach ($items as $item) { if (trim($item->admin_menu_link)) { // handling for active sub menu item $active = 0; if (strpos( @$_SERVER['QUERY_STRING'], $item->admin_menu_link ) !== false ) { $active = 1; } $key = $componentOption.'.'.$item->name; $subMenuItem[0] = $lang->hasKey($key) ? JText::_($key) : $item->name; $subMenuItem[1] = 'index.php?'. $item->admin_menu_link; $subMenuItem[2] = $active; $subMenuList[] = $subMenuItem; } } return $subMenuList; } }joomla/joomla/administrator/modules/mod_login/0000777000000000000000000000000011266551057023016 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_login/mod_login.xml0000766000000000000000000000176611234314114025504 0ustar adminadministrators Login Form Joomla! Project March 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.0.0 DESCLOGINFORM mod_login.php joomla/joomla/administrator/modules/mod_login/index.html0000766000000000000000000000005411234314114024775 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_login/mod_login.php0000766000000000000000000000560311234314114025465 0ustar adminadministrators load( 'plg_authentication_openid', JPATH_ADMINISTRATOR ); $langScript = 'var JLanguage = {};'. ' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'. ' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'. ' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'. ' var modlogin = 1;'; $document = &JFactory::getDocument(); $document->addScriptDeclaration( $langScript ); JHTML::_('script', 'openid.js'); endif; ?>

    '; echo $error->get('message'); echo '

    '; } ?>

    joomla/joomla/administrator/modules/mod_feed/0000777000000000000000000000000011266551060022603 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_feed/mod_feed.xml0000766000000000000000000000504111234314114025060 0ustar adminadministrators Feed Display Joomla! Project July 2005 Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL admin@joomla.org www.joomla.org 1.5.0 This module allows the displaying of a syndicated feed mod_feed.php joomla/joomla/administrator/modules/mod_feed/tmpl/0000777000000000000000000000000011266551060023557 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_feed/tmpl/default.php0000766000000000000000000000036611234314114025712 0ustar adminadministrators
    joomla/joomla/administrator/modules/mod_feed/tmpl/index.html0000766000000000000000000000005411234314114025544 0ustar adminadministratorsjoomla/joomla/administrator/modules/mod_feed/helper.php0000766000000000000000000001004311234314114024562 0ustar adminadministratorsget('rssurl', ''); $rssitems = $params->get('rssitems', 5); $rssdesc = $params->get('rssdesc', 1); $rssimage = $params->get('rssimage', 1); $rssitemdesc = $params->get('rssitemdesc', 1); $words = $params->def('word_count', 0); $rsstitle = $params->get('rsstitle', 1); $rssrtl = $params->get('rssrtl', 0); $moduleclass_sfx = $params->get('moduleclass_sfx', ''); // get RSS parsed object $options = array(); $options['rssUrl'] = $rssurl; if ($params->get('cache')) { $options['cache_time'] = $params->get('cache_time', 15) ; $options['cache_time'] *= 60; } else { $options['cache_time'] = null; } $rssDoc =& JFactory::getXMLparser('RSS', $options); if ($rssDoc != false) { // channel header and link $channel['title'] = $rssDoc->get_title(); $channel['link'] = $rssDoc->get_link(); $channel['description'] = $rssDoc->get_description(); // channel image if exists $image['url'] = $rssDoc->get_image_url(); $image['title'] = $rssDoc->get_image_title(); //image handling $iUrl = isset($image['url']) ? $image['url'] : null; $iTitle = isset($image['title']) ? $image['title'] : null; // items $items = $rssDoc->get_items(); // feed elements $items = array_slice($items, 0, $rssitems); ?> $actualItems) { $totalItems = $actualItems; } else { $totalItems = $setItems; } ?>
    <?php echo @$iTitle; ?>
    • get_link() ) ) { ?> get_title(); ?> get_description()); $text = str_replace(''', "'", $text); // word limit check if ($words) { $texts = explode(' ', $text); $count = count($texts); if ($count > $words) { $text = ''; for ($i = 0; $i < $words; $i ++) { $text .= ' '.$texts[$i]; } $text .= '...'; } } ?>
    joomla/joomla/administrator/modules/mod_feed/mod_feed.php0000766000000000000000000000235311234314114025052 0ustar adminadministratorsget('rssurl', ''); $rssrtl = $params->get('rssrtl', 0); //check if cache diretory is writable as cache files will be created for the feed $cacheDir = JPATH_BASE.DS.'cache'; if (!is_writable($cacheDir)) { echo '
    '; echo JText::_('Please make cache directory writable.'); echo '
    '; return; } //check if feed URL has been set if (empty ($rssurl)) { echo '
    '; echo JText::_('No feed URL specified.'); echo '
    '; return; } require(JModuleHelper::getLayoutPath('mod_feed')); joomla/joomla/administrator/modules/mod_menu/0000777000000000000000000000000011266551056022651 5ustar adminadministratorsjoomla/joomla/administrator/modules/mod_menu/helper.php0000766000000000000000000002454411234314114024636 0ustar adminadministratorsget('usertype'); // cache some acl checks $canCheckin = $user->authorize('com_checkin', 'manage'); $canConfig = $user->authorize('com_config', 'manage'); $manageTemplates = $user->authorize('com_templates', 'manage'); $manageTrash = $user->authorize('com_trash', 'manage'); $manageMenuMan = $user->authorize('com_menus', 'manage'); $manageLanguages = $user->authorize('com_languages', 'manage'); $installModules = $user->authorize('com_installer', 'module'); $editAllModules = $user->authorize('com_modules', 'manage'); $installPlugins = $user->authorize('com_installer', 'plugin'); $editAllPlugins = $user->authorize('com_plugins', 'manage'); $installComponents = $user->authorize('com_installer', 'component'); $editAllComponents = $user->authorize('com_components', 'manage'); $canMassMail = $user->authorize('com_massmail', 'manage'); $canManageUsers = $user->authorize('com_users', 'manage'); // Menu Types require_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_menus'.DS.'helpers'.DS.'helper.php' ); $menuTypes = MenusHelper::getMenuTypelist(); /* * Get the menu object */ $menu = new JAdminCSSMenu(); /* * Site SubMenu */ $menu->addChild(new JMenuNode(JText::_('Site')), true); $menu->addChild(new JMenuNode(JText::_('Control Panel'), 'index.php', 'class:cpanel')); $menu->addSeparator(); if ($canManageUsers) { $menu->addChild(new JMenuNode(JText::_('User Manager'), 'index.php?option=com_users&task=view', 'class:user')); } $menu->addChild(new JMenuNode(JText::_('Media Manager'), 'index.php?option=com_media', 'class:media')); $menu->addSeparator(); if ($canConfig) { $menu->addChild(new JMenuNode(JText::_('Configuration'), 'index.php?option=com_config', 'class:config')); $menu->addSeparator(); } $menu->addChild(new JMenuNode(JText::_('Logout'), 'index.php?option=com_login&task=logout', 'class:logout')); $menu->getParent(); /* * Menus SubMenu */ $menu->addChild(new JMenuNode(JText::_('Menus')), true); if ($manageMenuMan) { $menu->addChild(new JMenuNode(JText::_('Menu Manager'), 'index.php?option=com_menus', 'class:menu')); } if ($manageTrash) { $menu->addChild(new JMenuNode(JText::_('Menu Trash'), 'index.php?option=com_trash&task=viewMenu', 'class:trash')); } if($manageTrash || $manageMenuMan) { $menu->addSeparator(); } /* * SPLIT HR */ if (count($menuTypes)) { foreach ($menuTypes as $menuType) { $menu->addChild(new JMenuNode($menuType->title.($menuType->home ? ' *' : ''), 'index.php?option=com_menus&task=view&menutype='.$menuType->menutype, 'class:menu')); } } $menu->getParent(); /* * Content SubMenu */ $menu->addChild(new JMenuNode(JText::_('Content')), true); $menu->addChild(new JMenuNode(JText::_('Article Manager'), 'index.php?option=com_content', 'class:article')); if ($manageTrash) { $menu->addChild(new JMenuNode(JText::_('Article Trash'), 'index.php?option=com_trash&task=viewContent', 'class:trash')); } $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('Section Manager'), 'index.php?option=com_sections&scope=content', 'class:section')); $menu->addChild(new JMenuNode(JText::_('Category Manager'), 'index.php?option=com_categories§ion=com_content', 'class:category')); $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('Frontpage Manager'), 'index.php?option=com_frontpage', 'class:frontpage')); $menu->getParent(); /* * Components SubMenu */ if ($editAllComponents) { $menu->addChild(new JMenuNode(JText::_('Components')), true); $query = 'SELECT *' . ' FROM #__components' . ' WHERE '.$db->NameQuote( 'option' ).' <> "com_frontpage"' . ' AND '.$db->NameQuote( 'option' ).' <> "com_media"' . ' AND enabled = 1' . ' ORDER BY ordering, name'; $db->setQuery($query); $comps = $db->loadObjectList(); // component list $subs = array(); // sub menus $langs = array(); // additional language files to load // first pass to collect sub-menu items foreach ($comps as $row) { if ($row->parent) { if (!array_key_exists($row->parent, $subs)) { $subs[$row->parent] = array (); } $subs[$row->parent][] = $row; $langs[$row->option.'.menu'] = true; } elseif (trim($row->admin_menu_link)) { $langs[$row->option.'.menu'] = true; } } // Load additional language files if (array_key_exists('.menu', $langs)) { unset($langs['.menu']); } foreach ($langs as $lang_name => $nothing) { $lang->load($lang_name); } foreach ($comps as $row) { if ($editAllComponents | $user->authorize('administration', 'edit', 'components', $row->option)) { if ($row->parent == 0 && (trim($row->admin_menu_link) || array_key_exists($row->id, $subs))) { $text = $lang->hasKey($row->option) ? JText::_($row->option) : $row->name; $link = $row->admin_menu_link ? "index.php?$row->admin_menu_link" : "index.php?option=$row->option"; if (array_key_exists($row->id, $subs)) { $menu->addChild(new JMenuNode($text, $link, $row->admin_menu_img), true); foreach ($subs[$row->id] as $sub) { $key = $row->option.'.'.$sub->name; $text = $lang->hasKey($key) ? JText::_($key) : $sub->name; $link = $sub->admin_menu_link ? "index.php?$sub->admin_menu_link" : null; $menu->addChild(new JMenuNode($text, $link, $sub->admin_menu_img)); } $menu->getParent(); } else { $menu->addChild(new JMenuNode($text, $link, $row->admin_menu_img)); } } } } $menu->getParent(); } /* * Extensions SubMenu */ if ($installModules) { $menu->addChild(new JMenuNode(JText::_('Extensions')), true); $menu->addChild(new JMenuNode(JText::_('Install/Uninstall'), 'index.php?option=com_installer', 'class:install')); $menu->addSeparator(); if ($editAllModules) { $menu->addChild(new JMenuNode(JText::_('Module Manager'), 'index.php?option=com_modules', 'class:module')); } if ($editAllPlugins) { $menu->addChild(new JMenuNode(JText::_('Plugin Manager'), 'index.php?option=com_plugins', 'class:plugin')); } if ($manageTemplates) { $menu->addChild(new JMenuNode(JText::_('Template Manager'), 'index.php?option=com_templates', 'class:themes')); } if ($manageLanguages) { $menu->addChild(new JMenuNode(JText::_('Language Manager'), 'index.php?option=com_languages', 'class:language')); } $menu->getParent(); } /* * System SubMenu */ if ($canConfig || $canCheckin) { $menu->addChild(new JMenuNode(JText::_('Tools')), true); if ($canConfig) { $menu->addChild(new JMenuNode(JText::_('Read Messages'), 'index.php?option=com_messages', 'class:messages')); $menu->addChild(new JMenuNode(JText::_('Write Message'), 'index.php?option=com_messages&task=add', 'class:messages')); $menu->addSeparator(); } if ($canMassMail) { $menu->addChild(new JMenuNode(JText::_('Mass Mail'), 'index.php?option=com_massmail', 'class:massmail')); $menu->addSeparator(); } if ($canCheckin) { $menu->addChild(new JMenuNode(JText::_('Global Checkin'), 'index.php?option=com_checkin', 'class:checkin')); $menu->addSeparator(); } $menu->addChild(new JMenuNode(JText::_('Clean Cache'), 'index.php?option=com_cache', 'class:config')); $menu->addChild(new JMenuNode(JText::_('Purge Expired Cache'), 'index.php?option=com_cache&task=purgeadmin', 'class:config')); $menu->getParent(); } /* * Help SubMenu */ $menu->addChild(new JMenuNode(JText::_('Help')), true); $menu->addChild(new JMenuNode(JText::_('Joomla! Help'), 'index.php?option=com_admin&task=help', 'class:help')); $menu->addChild(new JMenuNode(JText::_('System Info'), 'index.php?option=com_admin&task=sysinfo', 'class:info')); $menu->getParent(); $menu->renderMenu('menu', ''); } /** * Show an disbaled version of the menu, used in edit pages * * @param string The current user type */ function buildDisabledMenu() { $lang =& JFactory::getLanguage(); $user =& JFactory::getUser(); $usertype = $user->get('usertype'); $canConfig = $user->authorize('com_config', 'manage'); $installModules = $user->authorize('com_installer', 'module'); $editAllModules = $user->authorize('com_modules', 'manage'); $installPlugins = $user->authorize('com_installer', 'plugin'); $editAllPlugins = $user->authorize('com_plugins', 'manage'); $installComponents = $user->authorize('com_installer', 'component'); $editAllComponents = $user->authorize('com_components', 'manage'); $canMassMail = $user->authorize('com_massmail', 'manage'); $canManageUsers = $user->authorize('com_users', 'manage'); $text = JText::_('Menu inactive for this Page', true); // Get the menu object $menu = new JAdminCSSMenu(); // Site SubMenu $menu->addChild(new JMenuNode(JText::_('Site'), null, 'disabled')); // Menus SubMenu $menu->addChild(new JMenuNode(JText::_('Menus'), null, 'disabled')); // Content SubMenu $menu->addChild(new JMenuNode(JText::_('Content'), null, 'disabled')); // Components SubMenu if ($installComponents) { $menu->addChild(new JMenuNode(JText::_('Components'), null, 'disabled')); } // Extensions SubMenu if ($installModules) { $menu->addChild(new JMenuNode(JText::_('Extensions'), null, 'disabled')); } // System SubMenu if ($canConfig) { $menu->addChild(new JMenuNode(JText::_('Tools'), null, 'disabled')); } // Help SubMenu $menu->addChild(new JMenuNode(JText::_('Help'), null, 'disabled')); $menu->renderMenu('menu', 'disabled'); } } ?> joomla/joomla/administrator/modules/mod_menu/menu.php0000766000000000000000000001151611234314114024316 0ustar adminadministrators_root = new JMenuNode('ROOT'); $this->_current = & $this->_root; } function addSeparator() { $this->addChild(new JMenuNode(null, null, 'separator', false)); } function renderMenu($id = 'menu', $class = '') { global $mainframe; $depth = 1; if(!empty($id)) { $id='id="'.$id.'"'; } if(!empty($class)) { $class='class="'.$class.'"'; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { echo "
      \n"; foreach ($this->_current->getChildren() as $child) { $this->_current = & $child; $this->renderLevel($depth++); } echo "
    \n"; } if ($this->_css) { // Add style to document head $doc = & JFactory::getDocument(); $doc->addStyleDeclaration($this->_css); } } function renderLevel($depth) { /* * Build the CSS class suffix */ $class = ''; if ($this->_current->hasChildren()) { $class = ' class="node"'; } if($this->_current->class == 'separator') { $class = ' class="separator"'; } if($this->_current->class == 'disabled') { $class = ' class="disabled"'; } /* * Print the item */ echo ""; /* * Print a link if it exists */ if ($this->_current->link != null) { echo "getIconClass($this->_current->class)."\" href=\"".$this->_current->link."\">".$this->_current->title.""; } elseif ($this->_current->title != null) { echo "".$this->_current->title."\n"; } else { echo ""; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { if ($this->_current->class) { echo '