Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cUriBuilderMR
  • ModRewrite
  • ModRewrite_ContentController
  • ModRewrite_ContentExpertController
  • ModRewrite_ContentTestController
  • ModRewrite_ControllerAbstract
  • ModRewriteBase
  • ModRewriteController
  • ModRewriteDebugger
  • ModRewriteTest
  • ModRewriteUrlStack
  • ModRewriteUrlUtil

Functions

  • mr_arrayValue
  • mr_buildGeneratedCode
  • mr_buildNewUrl
  • mr_conCopyArtLang
  • mr_conMoveArticles
  • mr_conSaveArticle
  • mr_conSyncArticle
  • mr_debugOutput
  • mr_getConfiguration
  • mr_getConfigurationFilePath
  • mr_getRequest
  • mr_header
  • mr_i18n
  • mr_loadConfiguration
  • mr_queryAndNextRecord
  • mr_removeMultipleChars
  • mr_requestCleanup
  • mr_runFrontendController
  • mr_setClientLanguageId
  • mr_setConfiguration
  • mr_strCopyCategory
  • mr_strMovedownCategory
  • mr_strMoveSubtree
  • mr_strMoveUpCategory
  • mr_strNewCategory
  • mr_strNewTree
  • mr_strRenameCategory
  • mr_strSyncCategory
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * AMR Content expert controller class
  4:  *
  5:  * @package     Plugin
  6:  * @subpackage  ModRewrite
  7:  * @id          $Id$:
  8:  * @author      Murat Purc <murat@purc.de>
  9:  * @copyright   four for business AG <www.4fb.de>
 10:  * @license     http://www.contenido.org/license/LIZENZ.txt
 11:  * @link        http://www.4fb.de
 12:  * @link        http://www.contenido.org
 13:  */
 14: 
 15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: 
 18: /**
 19:  * Content expert controller for expert settings/actions.
 20:  *
 21:  * @author      Murat Purc <murat@purc.de>
 22:  * @package     Plugin
 23:  * @subpackage  ModRewrite
 24:  */
 25: class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract {
 26: 
 27:     /**
 28:      * Path to restrictive htaccess file
 29:      * @var string
 30:      */
 31:     protected $_htaccessRestrictive = '';
 32: 
 33:     /**
 34:      * Path to simple htaccess file
 35:      * @var string
 36:      */
 37:     protected $_htaccessSimple = '';
 38: 
 39:     /**
 40:      * Initializer method, sets the paths to htaccess files
 41:      */
 42:     public function init() {
 43:         $this->_oView->content_before = '';
 44: 
 45:         $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/';
 46:         $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt';
 47:         $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt';
 48:     }
 49: 
 50:     /**
 51:      * Index action
 52:      */
 53:     public function indexAction() {
 54: 
 55:     }
 56: 
 57:     /**
 58:      * Copy htaccess action
 59:      */
 60:     public function copyHtaccessAction() {
 61:         $type = $this->_getParam('htaccesstype');
 62:         $copy = $this->_getParam('copy');
 63: 
 64:         if ($type != 'restrictive' && $type != 'simple') {
 65:             return;
 66:         } elseif ($copy != 'contenido' && $copy != 'cms') {
 67:             return;
 68:         }
 69: 
 70:         $aInfo = $this->getProperty('htaccessInfo');
 71: 
 72:         if ($aInfo['has_htaccess']) {
 73:             $this->_oView->content_before = $this->_notifyBox('warning', i18n('.htaccess already exists at CONTENIDO-/or client directory, so it is not copied.', 'mod_rewrite'));
 74:             return;
 75:         }
 76: 
 77:         if ($type == 'restrictive') {
 78:             $source = $this->_htaccessRestrictive;
 79:         } else {
 80:             $source = $this->_htaccessSimple;
 81:         }
 82: 
 83:         if ($copy == 'contenido') {
 84:             $dest = $aInfo['contenido_full_path'] . '.htaccess';
 85:         } else {
 86:             $dest = $aInfo['client_full_path'] . '.htaccess';
 87:         }
 88: 
 89:         if (!$result = @copy($source, $dest)) {
 90:             $this->_oView->content_before = $this->_notifyBox('warning', sprintf(i18n('.htaccess could not copy from <strong>%s</strong> to <strong>%s</strong>! Perhaps the target directory has not the required rights to write files at your webserver.', 'mod_rewrite'), $source, $dest));
 91:             return;
 92:         }
 93: 
 94:         $msg = sprintf(i18n('.htaccess are successfully copied to %s', 'mod_rewrite'), str_replace('.htaccess', '', $dest));
 95:         $this->_oView->content_before = $this->_notifyBox('info', $msg);
 96:     }
 97: 
 98:     /**
 99:      * Download htaccess action
100:      */
101:     public function downloadHtaccessAction() {
102:         $type = $this->_getParam('htaccesstype');
103: 
104:         if ($type != 'restrictive' && $type != 'simple') {
105:             return;
106:         }
107: 
108:         if ($type == 'restrictive') {
109:             $source = $this->_htaccessRestrictive;
110:         } else {
111:             $source = $this->_htaccessSimple;
112:         }
113: 
114:         $this->_oView->content = cFileHandler::read($source);
115: 
116:         header('Content-Type: text/plain');
117:         header('Etag: ' . md5(mt_rand()));
118:         header('Content-Disposition: attachment; filename="' . $type . '.htaccess"');
119:         $this->render('{CONTENT}');
120:     }
121: 
122:     /**
123:      * Reset aliases action
124:      */
125:     public function resetAction() {
126:         // recreate all aliases
127:         ModRewrite::recreateAliases(false);
128:         $this->_oView->content_before = $this->_notifyBox('info', i18n('All aliases have been reset.', 'mod_rewrite'));
129:     }
130: 
131:     /**
132:      * Reset only empty aliases action
133:      */
134:     public function resetEmptyAction() {
135:         // recreate only empty aliases
136:         ModRewrite::recreateAliases(true);
137:         $this->_oView->content_before = $this->_notifyBox('info', i18n('Only empty aliases have been reset.', 'mod_rewrite'));
138:     }
139: 
140: }
141: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0