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

  • 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
  • cUpgradeJob_0017
  • cUpgradeJob_0018
  • 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:  * @author frederic.schneider
 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: // assert CONTENIDO framework
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * Upgrade job 12.
20:  *
21:  * Generates plugin relations for plugin specific action entries
22:  *
23:  * @package Setup
24:  * @subpackage UpgradeJob
25:  */
26: class cUpgradeJob_0012 extends cUpgradeJobAbstract {
27: 
28:     public $maxVersion = "4.9.3";
29: 
30:     public function _execute() {
31:         global $cfg;
32: 
33:         if ($_SESSION['setuptype'] == 'upgrade') {
34: 
35:             // Initializing cApiActionCollection
36:             $actionColl = new cApiActionCollection();
37: 
38:             // Include PIM collections
39:             plugin_include('pim', 'classes/class.pim.plugin.collection.php');
40:             plugin_include('pim', 'classes/class.pim.plugin.relations.collection.php');
41: 
42:             // Initializing PimPluginRelationsCollection
43:             $pluginRelColl = new PimPluginRelationsCollection();
44: 
45:             // Initializing PimPluginCollection
46:             $pluginColl = new PimPluginCollection();
47: 
48:             // Get all installed plugins
49:             $pluginColl->select();
50:             while ($plugin = $pluginColl->next()) {
51: 
52:                 // Get path to plugin.xml
53:                 $pluginXmlPath = $cfg['path']['contenido'] . $cfg['path']['plugins'] . cSecurity::escapeString($plugin->get('folder')) . DIRECTORY_SEPARATOR . "plugin.xml";
54: 
55:                 // Load plugin.xml and get xml strings
56:                 $xml = simplexml_load_string(file_get_contents($pluginXmlPath));
57: 
58:                 // Count all actions at plugin.xml for this plugin
59:                 $actionCount = count($xml->contenido->actions->action);
60: 
61:                 for ($i = 0; $i < $actionCount; $i++) {
62: 
63:                     // Build and execute sql query for selected action
64:                     $actionColl->setWhere('name', cSecurity::escapeString($xml->contenido->actions->action[$i]));
65:                     $actionColl->query();
66: 
67:                     // Get id of selected action
68:                     $actionId = $actionColl->next();
69: 
70:                     // Set a relation
71:                     if ($actionId !== false) {
72:                         $pluginRelColl->create($actionId->get("idaction"), $plugin->get('idplugin'), 'action');
73:                     }
74:                 }
75:             }
76:         }
77:     }
78: 
79: }
80: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0