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
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 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.7 API documentation generated by ApiGen