Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • 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_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:  * @version     SVN Revision $Rev:$
  8:  * @id          $Id: class.modrewrite_contentexpert_controller.php 4548 2013-04-14 17:15:42Z dominik.ziegler $:
  9:  * @author      Murat Purc <murat@purc.de>
 10:  * @copyright   four for business AG <www.4fb.de>
 11:  * @license     http://www.contenido.org/license/LIZENZ.txt
 12:  * @link        http://www.4fb.de
 13:  * @link        http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: 
 19: /**
 20:  * Content expert controller for expert settings/actions.
 21:  *
 22:  * @author      Murat Purc <murat@purc.de>
 23:  * @package     Plugin
 24:  * @subpackage  ModRewrite
 25:  */
 26: class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract {
 27: 
 28:     /**
 29:      * Path to restrictive htaccess file
 30:      * @var string
 31:      */
 32:     protected $_htaccessRestrictive = '';
 33: 
 34:     /**
 35:      * Path to simple htaccess file
 36:      * @var string
 37:      */
 38:     protected $_htaccessSimple = '';
 39: 
 40:     /**
 41:      * Initializer method, sets the paths to htaccess files
 42:      */
 43:     public function init() {
 44:         $this->_oView->content_before = '';
 45: 
 46:         $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/';
 47:         $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt';
 48:         $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt';
 49:     }
 50: 
 51:     /**
 52:      * Index action
 53:      */
 54:     public function indexAction() {
 55: 
 56:     }
 57: 
 58:     /**
 59:      * Copy htaccess action
 60:      */
 61:     public function copyHtaccessAction() {
 62:         $type = $this->_getParam('htaccesstype');
 63:         $copy = $this->_getParam('copy');
 64: 
 65:         if ($type != 'restrictive' && $type != 'simple') {
 66:             return;
 67:         } elseif ($copy != 'contenido' && $copy != 'cms') {
 68:             return;
 69:         }
 70: 
 71:         $aInfo = $this->getProperty('htaccessInfo');
 72: 
 73:         if ($aInfo['has_htaccess']) {
 74:             $this->_oView->content_before = $this->_notifyBox('info', 'Die .htaccess existiert bereits im Contenido-/ oder Mandantenverzeichnis, daher wird es nicht kopiert');
 75:             return;
 76:         }
 77: 
 78:         if ($type == 'restrictive') {
 79:             $source = $this->_htaccessRestrictive;
 80:         } else {
 81:             $source = $this->_htaccessSimple;
 82:         }
 83: 
 84:         if ($copy == 'contenido') {
 85:             $dest = $aInfo['contenido_full_path'] . '.htaccess';
 86:         } else {
 87:             $dest = $aInfo['client_full_path'] . '.htaccess';
 88:         }
 89: 
 90:         if (!$result = @copy($source, $dest)) {
 91:             $this->_oView->content_before = $this->_notifyBox('info', 'Die .htaccess konnte nicht von ' . $source . ' nach ' . $dest . ' kopiert werden!');
 92:             return;
 93:         }
 94: 
 95:         $msg = 'Die .htaccess wurde erfolgreich nach ' . str_replace('.htaccess', '', $dest) . ' kopiert';
 96:         $this->_oView->content_before = $this->_notifyBox('info', $msg);
 97:     }
 98: 
 99:     /**
100:      * Download htaccess action
101:      */
102:     public function downloadHtaccessAction() {
103:         $type = $this->_getParam('htaccesstype');
104: 
105:         if ($type != 'restrictive' && $type != 'simple') {
106:             return;
107:         }
108: 
109:         if ($type == 'restrictive') {
110:             $source = $this->_htaccessRestrictive;
111:         } else {
112:             $source = $this->_htaccessSimple;
113:         }
114: 
115:         $this->_oView->content = cFileHandler::read($source);
116: 
117:         header('Content-Type: text/plain');
118:         header('Etag: ' . md5(mt_rand()));
119:         header('Content-Disposition: attachment; filename="' . $type . '.htaccess"');
120:         $this->render('{CONTENT}');
121:     }
122: 
123:     /**
124:      * Reset aliases action
125:      */
126:     public function resetAction() {
127:         // recreate all aliases
128:         ModRewrite::recreateAliases(false);
129:         $this->_oView->content_before = $this->_notifyBox('info', 'Alle Aliase wurden zur&uuml;ckgesetzt');
130:     }
131: 
132:     /**
133:      * Reset only empty aliases action
134:      */
135:     public function resetEmptyAction() {
136:         // recreate only empty aliases
137:         ModRewrite::recreateAliases(true);
138:         $this->_oView->content_before = $this->_notifyBox('info', 'Nur leere Aliase wurden zur&uuml;ckgesetzt');
139:     }
140: 
141: }
142: 
CMS CONTENIDO 4.9.3 API documentation generated by ApiGen 2.8.0