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

  • cUpgradeJob_0001
  • cUpgradeJob_0002
  • cUpgradeJob_0003
  • cUpgradeJob_0004
  • cUpgradeJob_0005
  • cUpgradeJob_0006
  • cUpgradeJob_0007
  • cUpgradeJob_0008
  • cUpgradeJob_0009
  • cUpgradeJob_0010
  • cUpgradeJob_0011
  • cUpgradeJob_0012
  • cUpgradeJob_0013
  • cUpgradeJob_0014
  • cUpgradeJob_0015
  • cUpgradeJob_0016
  • cUpgradeJobAbstract
  • cUpgradeJobMain
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: /**
 4:  * This file contains the upgrade job 12.
 5:  *
 6:  * @package Setup
 7:  * @subpackage UpgradeJob
 8:  * @version SVN Revision $Rev:$
 9:  *
10:  * @author frederic.schneider
11:  * @copyright four for business AG <www.4fb.de>
12:  * @license http://www.contenido.org/license/LIZENZ.txt
13:  * @link http://www.4fb.de
14:  * @link http://www.contenido.org
15:  */
16: 
17: // assert CONTENIDO framework
18: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
19: 
20: /**
21:  * Upgrade job 12.
22:  *
23:  * Generates plugin relations for plugin specific action entries
24:  *
25:  * @package Setup
26:  * @subpackage UpgradeJob
27:  */
28: class cUpgradeJob_0012 extends cUpgradeJobAbstract {
29: 
30:     public $maxVersion = "4.9.3";
31: 
32:     public function _execute() {
33:         global $cfg;
34: 
35:         if ($_SESSION['setuptype'] == 'upgrade') {
36: 
37:             // Initializing cApiActionCollection
38:             $actionColl = new cApiActionCollection();
39: 
40:             // Include PIM collections
41:             plugin_include('pim', 'classes/class.pim.plugin.collection.php');
42:             plugin_include('pim', 'classes/class.pim.plugin.relations.collection.php');
43: 
44:             // Initializing PimPluginRelationsCollection
45:             $pluginRelColl = new PimPluginRelationsCollection();
46: 
47:             // Initializing PimPluginCollection
48:             $pluginColl = new PimPluginCollection();
49: 
50:             // Get all installed plugins
51:             $pluginColl->select();
52:             while ($plugin = $pluginColl->next()) {
53: 
54:                 // Get path to plugin.xml
55:                 $pluginXmlPath = $cfg['path']['contenido'] . $cfg['path']['plugins'] . cSecurity::escapeString($plugin->get('folder')) . DIRECTORY_SEPARATOR . "plugin.xml";
56: 
57:                 // Load plugin.xml and get xml strings
58:                 $xml = simplexml_load_string(file_get_contents($pluginXmlPath));
59: 
60:                 // Count all actions at plugin.xml for this plugin
61:                 $actionCount = count($xml->contenido->actions->action);
62: 
63:                 for ($i = 0; $i < $actionCount; $i++) {
64: 
65:                     // Build and execute sql query for selected action
66:                     $actionColl->setWhere('name', cSecurity::escapeString($xml->contenido->actions->action[$i]));
67:                     $actionColl->query();
68: 
69:                     // Get id of selected action
70:                     $actionId = $actionColl->next();
71: 
72:                     // Set a relation
73:                     if ($actionId !== false) {
74:                         $pluginRelColl->create($actionId->get("idaction"), $plugin->get('idplugin'), 'action');
75:                     }
76:                 }
77:             }
78:         }
79:     }
80: 
81: }
82: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0