PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom2
/
administrator
/
components
/
com_falang
/
controllers
<?php /** * Joom!Fish - Multi Lingual extention and translation manager for Joomla! * Copyright (C) 2003 - 2011, Think Network GmbH, Munich * * All rights reserved. The Joom!Fish project is a set of extentions for * the content management system Joomla!. It enables Joomla! * to manage multi lingual sites especially in all dynamic information * which are stored in the database. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. * * The "GNU General Public License" (GPL) is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * ----------------------------------------------------------------------------- * $Id: elements.php 1551 2011-03-24 13:03:07Z akede $ * @package joomfish * @subpackage elements * */ defined( '_JEXEC' ) or die( 'Restricted access' ); require_once JPATH_ROOT.'/administrator/components/com_falang/legacy/controller.php'; JLoader::import( 'helpers.controllerHelper',FALANG_ADMINPATH); /** * The JoomFish Tasker manages the general tasks within the Joom!Fish admin interface * */ class ElementsController extends LegacyController { /** @var string current used task */ var $task=null; /** @var string action within the task */ var $act=null; /** @var array int or array with the choosen list id */ var $cid=null; /** @var string file code */ var $fileCode = null; /** * @var object reference to the Joom!Fish manager * @access private */ var $_falangManager=null; /** * PHP 4 constructor for the tasker * * @return joomfishTasker */ function __construct( ){ parent::__construct(); $this->registerDefaultTask( 'show' ); $this->act = JRequest::getVar( 'act', '' ); $this->task = JRequest::getVar( 'task', '' ); $this->cid = JRequest::getVar( 'cid', array(0) ); if (!is_array( $this->cid )) { $this->cid = array(0); } $this->fileCode = JRequest::getVar( 'fileCode', '' ); $this->_falangManager = FalangManager::getInstance(); $this->registerTask( 'show', 'showCElementConfig' ); $this->registerTask( 'detail', 'showElementConfiguration' ); $this->registerTask( 'remove', 'removeContentElement' ); $this->registerTask( 'remove_install', 'removeContentElement' ); $this->registerTask( 'installer', 'showContentElementsInstaller' ); $this->registerTask( 'uploadfile', 'installContentElement' ); // Populate data used by controller $app = JFactory::getApplication(); $this->_catid = $app->getUserStateFromRequest('selected_catid', 'catid', ''); $this->_select_language_id = $app->getUserStateFromRequest('selected_lang','select_language_id', '-1'); $this->_language_id = JRequest::getVar( 'language_id', $this->_select_language_id ); $this->_select_language_id = ($this->_select_language_id == -1 && $this->_language_id != -1) ? $this->_language_id : $this->_select_language_id; // Populate common data used by view // get the view $this->view = $this->getView("elements"); // Assign data for view $this->view->assignRef('catid' , $this->_catid); $this->view->assignRef('select_language_id', $this->_select_language_id); $this->view->assignRef('task', $this->task); $this->view->assignRef('act', $this->act); } // DONE function showCElementConfig() { $db = JFactory::getDBO(); FalangControllerHelper::_setupContentElementCache(); $this->showElementOverview(); } /** * Installs the uploaded file * */ function installContentElement() { if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) { JLoader::import( 'helpers.jfinstaller',FALANG_ADMINPATH); $installer = new jfInstaller(); if ( $installer->install( $_FILES["userfile"] )){ $msg = JText::_('Fileupload successful'); } else { JError::raiseError(417, JText::_('Fileupload not successful')); } } else { JError::raiseError(418, JText::_('Fileupload not successful')); } $this->setRedirect('index.php?option=com_falang&task=elements.installer', $msg);; } /** * method to remove all selected content element files */ function removeContentElement() { // Check for request forgeries //JRequest::checkToken() or die( 'Invalid Token' ); if( $this->_deleteContentElement($this->cid[0]) ) { $msg = JText::sprintf('COM_FALANG_CONTENT_ELEMENT_FILE_DELETED', $this->cid[0]); } if($this->_task == 'remove_install') { $this->setRedirect('index.php?option=com_falang&task=elements.installer', $msg);; } else { $this->setRedirect('index.php?option=com_falang&task=elements.show', $msg);; } } /** * Method deletes one content element file * @param filename */ // DONE function _deleteContentElement( $filename = null ) { $elementfolder = FALANG_ADMINPATH .DS. 'contentelements/'; $filename .= '.xml'; jimport('joomla.filesystem.file'); return JFile::delete($elementfolder . $filename); } /** Presentation of the content element list */ //DONE function showElementOverview() { $db = JFactory::getDBO(); $app = JFactory::getApplication(); $limit = $app->getUserStateFromRequest( "viewlistlimit", 'limit', 10 ); $limitstart = $app->getUserStateFromRequest( "view{com_falang}limitstart", 'limitstart', 0 ); $total=count($this->_falangManager->getContentElements()); jimport('joomla.html.pagination'); $pageNav = new JPagination( $total, $limitstart, $limit ); // get the view $view = $this->getView("elements"); // Set the layout $view->setLayout('default'); // Assign data for view - should really do this as I go along $view->assignRef('pageNav' , $pageNav); $view->assignRef('falangManager' , $this->_falangManager); $view->display(); //HTML_joomfish::showElementOverview( $this->_falangManager, $pageNav ); } /** Detailinformation about one specific content element */ // DONE - should move more from the view to here or the model! function showElementConfiguration( ) { $cid = JRequest::getVar( 'cid', array(0) ); if (count($cid)>0){ $id = $cid[0]; } // get the view $view = $this->getView("elements"); // Set the layout $view->setLayout('edit'); // Assign data for view - should really do this as I go along $view->assignRef('id' , $id); $view->assignRef('falangManager' , $this->_falangManager); $view->display(); //HTML_joomfish::showElementConfiguration( $this->_falangManager, $id ); } /** * Method to install content element files * */ //DONE function showContentElementsInstaller() { $cElements = $this->_falangManager->getContentElements(true); // get the view $view = $this->getView("elements"); // Set the layout $view->setLayout('installer'); // Assign data for view - should really do this as I go along $view->assignRef('cElements' , $cElements); $view->display(); //HTML_joomfish::showContentElementInstaller( $cElements, $this->view->message ); } }
[+]
..
[-] cpanel.php
[edit]
[-] elements.php
[edit]
[-] export.php
[edit]
[-] help.php
[edit]
[-] import.php
[edit]
[-] index.html
[edit]
[-] languages.php
[edit]
[-] manage.php
[edit]
[-] plugin.php
[edit]
[-] statistics.php
[edit]
[-] translate.php
[edit]
[-] .htaccess.disabled
[edit]