Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F805075
custom
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 10:36 PM
Size
8 KB
Mime Type
text/x-diff
Expires
Fri, Feb 28, 10:36 PM (6 h, 48 m)
Engine
blob
Format
Raw Data
Handle
577341
Attached To
rMCUS Modules.Custom
custom
View Options
Index: branches/1.2.x/units/sections/sections_config.php
===================================================================
--- branches/1.2.x/units/sections/sections_config.php (revision 14095)
+++ branches/1.2.x/units/sections/sections_config.php (revision 14096)
@@ -1,107 +1,108 @@
<?php
/**
* Custom-sections prefix
*
* @author dmitrya
* @package Custom (Development Kit)
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'custom-sections',
'ConfigPriority' => 2,
# Event handler class used for HOOKing to existing events (ie. )
'EventHandlerClass' => Array ('class' => 'CustomEventHandler', 'file' => 'custom_eh.php', 'build_event' => 'OnBuild'),
# Defined to draw new sections (if any) in left nav. tree, normally each unit has it's own Tag Processor
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
# Extend/override already existing classes (ie. Event Handlers, Tag Processors, Helpers)
'RegisterClasses' => Array (
# extend default User core/units/users/users_tag_processor.php / users_event_handler.php
// Array ('pseudo' => 'u_TagProcessor', 'class' => 'EUserTagProcessor', 'file' => 'e_user_tp.php'),
// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUserEventHandler', 'file' => 'e_user_eh.php'),
# extend default Product classes /in-commerce/units/products/products_tag_processor.php / products_event_handler.php
// Array ('pseudo' => 'p_TagProcessor', 'class' => 'EProductTagProcessor', 'file' => 'e_product_tp.php'),
// Array ('pseudo' => 'p_EventHandler', 'class' => 'EProductEventHandler', 'file' => 'e_product_eh.php'),
# extend default Link /in-link/units/links/link_tag_processor.php / links_event_handler.php
// Array ('pseudo' => 'l_TagProcessor', 'class' => 'ELinkTagProcessor', 'file' => 'e_link_tp.php'),
// Array ('pseudo' => 'l_EventHandler', 'class' => 'ELinkEventHandler', 'file' => 'e_link_eh.php'),
# extend default Category /core/units/categories/categories_tag_processor.php / categories_event_handler.php
// Array ('pseudo' => 'c_TagProcessor', 'class' => 'ECategoryTagProcessor', 'file' => 'e_category_tp.php'),
// Array ('pseudo' => 'c_EventHandler', 'class' => 'ECategoryEventHandler', 'file' => 'e_category_eh.php'),
# extend default Article /in-news/units/articles/article_tag_processor.php / articles_event_handler.php
// Array ('pseudo' => 'n_TagProcessor', 'class' => 'EArticleTagProcessor', 'file' => 'e_article_tp.php'),
// Array ('pseudo' => 'n_EventHandler', 'class' => 'EArticleEventHandler', 'file' => 'e_article_eh.php'),
),
# Replace/substiture any admin default templates with custom ones
'ReplacementTemplates' => Array (
# replace default image block with custom template
// 'incs/image_blocks' => 'custom/incs/image_blocks',
# replace default edit link template
// 'in-links/links/links_edit' => 'custom/links/links_edit',
# replace default edit category template
// 'categories/categories_edit' => 'custom/categories/categories_edit',
),
# Hooks to events that may call any other events
'Hooks' => Array (
# hook to OnAfterCacheRebuild event of "adm" prefix (tiggered when unit cache is rebuild and stored) called
# to override cloned sub-items (ie. register extended classes for cloned unit configs such as n-img, n-rev)
/*Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'adm',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterCacheRebuild'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnOverrideClonedSubItems',
),*/
# hook to category OnAfterConfigRead event called to customize category configuration settings
/*Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'c',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnModifyCategoriesConfig',
),*/
),
'PermSection' => Array ('main' => 'custom', 'email' => 'custom:configuration_email'),
# New sections in left navigation
- /*'Sections' => Array (
+ 'Sections' => Array (
'custom' => Array (
'parent' => 'in-portal:root',
'icon' => 'conf_custom',
'label' => 'la_title_Custom',
'url' => Array ('t' => 'index', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2.4,
'container' => true,
+ 'show_mode' => smDEBUG,
'type' => stTREE,
),
- ),*/
+ ),
);
\ No newline at end of file
Index: branches/1.2.x/units/sections/custom_eh.php
===================================================================
--- branches/1.2.x/units/sections/custom_eh.php (revision 14095)
+++ branches/1.2.x/units/sections/custom_eh.php (revision 14096)
@@ -1,50 +1,36 @@
<?php
defined('FULL_PATH') or die('restricted access!');
/**
* Custom event handler class
*
*/
class CustomEventHandler extends kEventHandler {
/**
- * Connection to database
- *
- * @var kDBConnection
- * @access public
- */
- var $Conn;
-
- function CustomEventHandler()
- {
- parent::kBase();
- $this->Conn =& $this->Application->GetADODBConnection();
- }
-
- /**
* [HOOK] Override cloned sub-items (ie. register extended classes for clones from Reviews, Images)
*
* @param kEvent $event
*/
function OnOverrideClonedSubItems(&$event)
{
# register EReviewEventHandler class as extented from cloned ReviewEventHandler for article reviews ("n" prefix)
// $this->Application->registerClass('EReviewEventHandler', dirname(__FILE__) . '/e_review_eh.php', 'n-rev_EventHandler');
}
/**
* [HOOK] Modify config stored in "categories_config.php" without extending CategoriesEventHandler class
*
* @param kEvent $event
*/
function OnModifyCategoriesConfig(&$event)
{
# get Fields configuration from /core/units/categories/categories_config.php
$fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Fields');
# set configuration fields
$this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', $fields);
}
}
\ No newline at end of file
Index: branches/1.2.x/install/upgrades.php
===================================================================
--- branches/1.2.x/install/upgrades.php (revision 14095)
+++ branches/1.2.x/install/upgrades.php (revision 14096)
@@ -1,50 +1,50 @@
<?php
/**
* @version $Id$
* @package Custom
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$upgrade_class = 'CustomUpgrades';
/**
* Class, that holds all upgrade scripts for "Custom" module
*
*/
class CustomUpgrades extends kUpgradeHelper {
- function CustomUpgrades()
+ public function __construct()
{
- parent::kHelper();
+ parent::__construct();
$this->dependencies = Array (
'1.0.0' => Array ('Core' => '5.0.0'),
'1.0.1' => Array ('Core' => '5.0.1'),
'1.0.2-B1' => Array ('Core' => '5.0.2-B1'),
'1.0.2-B2' => Array ('Core' => '5.0.2-B2'),
'1.0.2-RC1' => Array ('Core' => '5.0.2-RC1'),
'1.0.2' => Array ('Core' => '5.0.2'),
'1.0.3-B1' => Array ('Core' => '5.0.3-B1'),
'1.0.3-RC1' => Array ('Core' => '5.0.3-RC1'),
'1.0.3' => Array ('Core' => '5.0.3'),
'1.0.4-B1' => Array ('Core' => '5.0.4-B1'),
'1.0.4' => Array ('Core' => '5.0.4'),
'1.1.0-B1' => Array ('Core' => '5.1.0-B1'),
'1.1.0-B2' => Array ('Core' => '5.1.0-B2'),
'1.1.0-RC1' => Array ('Core' => '5.1.0-RC1'),
'1.1.0' => Array ('Core' => '5.1.0'),
'1.1.1-B1' => Array ('Core' => '5.1.1-B1'),
'1.1.1-RC1' => Array ('Core' => '5.1.1-RC1'),
'1.1.1' => Array ('Core' => '5.1.1'),
);
}
}
Event Timeline
Log In to Comment