Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1330740
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
Sat, Jan 10, 12:01 AM
Size
32 KB
Mime Type
text/x-diff
Expires
Mon, Jan 12, 12:01 AM (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
860927
Attached To
rMCUS Modules.Custom
custom
View Options
Index: branches/1.3.x/units/widgets/widgets_config.php
===================================================================
--- branches/1.3.x/units/widgets/widgets_config.php (revision 16395)
+++ branches/1.3.x/units/widgets/widgets_config.php (revision 16396)
@@ -1,213 +1,237 @@
<?php
/**
* Sample config file for widgets
*
* @author dmitrya
* @package Development Kit
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'widget',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'WidgetEventHandler', 'file' => 'widget_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'WidgetTagProcessor', 'file' => 'widget_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'PerPage',
4 => 'event',
5 => 'mode',
),
+ 'Hooks' => array(
+ array(
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'priority',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => array('OnAfterConfigRead'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnModifyPrioritiesConfig',
+ ),
+ ),
+
'IDField' => 'WidgetId',
'StatusField' => Array ('Status'),
'TableName' => TABLE_PREFIX.'Widgets',
/*
'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
'ParentPrefix' => 'parent',
'AutoDelete' => true, // delete these items when parent is being deleted
'AutoClone' => true, // clone these items when parent is being cloned
*/
// used to build editing links in admin grids
'AdminTemplatePath' => 'widgets',
'AdminTemplatePrefix' => 'widget_',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('widget' => '!la_title_AddingWidget!'),
'edit_status_labels' => Array ('widget' => '!la_title_EditingWidget!'),
'new_titlefield' => Array ('widget' => '!la_title_NewWidget!'),
),
'widget_list' => Array (
'prefixes' => Array ('widget_List'), 'format' => '#section_label#',
- 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'approve', 'decline', 'export', 'import', 'view', 'dbl-click',),
+ 'toolbar_buttons' => array('new_item', 'edit', 'delete', 'approve', 'decline', 'move_up', 'move_down', 'refresh', 'export', 'import', 'view', 'dbl-click'),
),
'widget_edit' => Array (
'prefixes' => Array ('widget'), 'format' => '#widget_status# - #widget_titlefield#',
'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
),
),
'PermSection' => Array ('main' => 'custom:widgets'),
'Sections' => Array (
'custom:widgets' => Array (
'parent' => 'custom',
'icon' => 'custom',
'label' => 'la_tab_Widgets',
'url' => Array ('t' => 'custom/widgets/widget_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 1,
'type' => stTREE,
),
),
'TitleField' => 'Title', // field, used in bluebar when editing existing item
// Use %1$s for local table name with prefix, %2$s for calculated fields
'ListSQLs' => Array ( // key - special, value - list select sql
'' => ' SELECT %1$s.* %2$s
FROM %1$s',
),
'ListSortings' => Array (
'' => Array (
-// 'ForcedSorting' => Array ('Priority' => 'desc'),
- 'Sorting' => Array ('Title' => 'asc'),
+ 'Sorting' => array('Priority' => 'desc'),
)
),
'CalculatedFields' => array(
'' => array(
'VirtualActionField' => '%1$s.WidgetId',
)
),
'VirtualFields' => Array (
'VirtualActionField' => Array ('type' => 'string', 'default' => ''),
),
'Fields' => Array (
'WidgetId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Title' => Array (
'type' => 'string', 'max_len' => 255,
'required' => 1, 'default' => '', 'not_null' => 1,
),
'Description' => Array (
'type' => 'string',
'formatter' => 'kFormatter', 'using_fck' => 1,
'default' => null,
),
'Email' => Array (
'type' => 'string', 'formatter' => 'kFormatter',
'regexp' => '/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i',
'sample_value' => 'email@domain.com',
'not_null' => 1, 'default' => '',
'error_msgs' => Array ('invalid_format' => '!la_invalid_email!'),
),
'Type' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
'options' => Array (
1 => 'la_opt_Default',
2 => 'la_opt_Custom',
),
'not_null' => 1,
'default' => 1,
'required' => 1,
),
'Phone' => Array (
'type' => 'string',
'formatter' => 'kFormatter',
'default' => '', 'using_fck' => 1, 'not_null' => 1),
'Qty' => Array (
'type' => 'double',
'required' => 0, 'not_null' => 1, 'default' => 0
),
'Status' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
'use_phrases' => 1, 'not_null' => 1, 'default' => 2,
),
'CreatedOn' => Array (
'type' => 'int',
'formatter' => 'kDateFormatter',
'time_format' => '', 'input_time_format' => '',
'default' => '#NOW#',
),
'Good' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Yes', 0 => 'la_No'),
'use_phrases' => 1, 'not_null' => 1, 'default' => 0
),
'BirthTime' => Array (
'type' => 'int', 'formatter' => 'kDateFormatter',
'date_format' => '', 'input_date_format' => '',
'default' => null
),
'Image' => Array (
'type' => 'string', 'formatter' => 'kUploadFormatter',
'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
'file_types' => '*.jpg;*.jpeg;*.gif;*.png;*.bmp', 'files_description' => '!la_hint_ImageFiles!',
'upload_dir' => '/system/user_files/', // relative to project's home
'as_image' => true, 'thumb_format' => 'resize:100x100',
'multiple' => false, // false or max number of files - will be stored as serialized array of paths
'direct_links' => false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
'filename_prefix' => '',
'filename_suffix' => '',
'storage_engine' => StorageEngine::HASH,
'required' => 1, 'default' => null
),
'DataFile' => Array (
'type' => 'string', 'formatter' => 'kUploadFormatter',
'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
'file_types' => '*.*',
'files_description' => '!la_hint_AllFiles!',
'upload_dir' => '/system/user_files/', // relative to project's home
'as_image' => false,
'multiple' => 5, // false or max number of files - will be stored as serialized array of paths
'direct_links' => true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
'default' => null
),
+ 'Priority' => array(
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => array(),
+ 'not_null' => 1, 'default' => 0,
+ ),
),
'Grids' => Array (
'Default' => Array (
-// 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Icons' => array(
+ 'default' => 'icon16_item.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 0 => 'icon16_disabled.png',
+ 'module' => 'core',
+ ),
'Fields' => Array (
'WidgetId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
'Title' => Array ('title' => 'column:la_fld_Name', 'data_block' => 'grid_custom_td'),
'Image' => Array ('data_block' => 'grid_image_td', 'filter_block' => 'grid_empty_filter', 'width' => 120),
'Type' => Array ('filter_block' => 'grid_options_filter'),
'Status' => Array ('filter_block' => 'grid_options_filter'),
'Good' => Array ('filter_block' => 'grid_like_filter'),
'Qty' => Array ('header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_range_filter'),
'Email' => Array ('filter_block' => 'grid_like_filter'),
'Phone' => Array ('filter_block' => 'grid_like_filter'),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter'),
'Description' => Array ('filter_block' => 'grid_like_filter'),
'VirtualActionField' => Array ('title' => 'column:la_fld_Action', 'data_block' => 'grid_delete_td'),
+ 'Priority' => array('filter_block' => 'grid_options_filter'),
),
),
),
/*'ConfigMapping' => Array (
'PerPage' => 'Perpage_Widgets',
'ShortListPerPage' => 'Perpage_Widgets_Short',
),*/
);
Index: branches/1.3.x/units/widgets/widget_eh.php
===================================================================
--- branches/1.3.x/units/widgets/widget_eh.php (revision 16395)
+++ branches/1.3.x/units/widgets/widget_eh.php (revision 16396)
@@ -1,196 +1,256 @@
<?php
defined('FULL_PATH') or die('restricted access!');
/**
* Widgets Event Handler (sample)
*
*/
class WidgetEventHandler extends kDBEventHandler {
/**
* Allows to override standard permission mapping
*
* @return void
* @access protected
* @see kEventHandler::$permMapping
*/
protected function mapPermissions()
{
parent::mapPermissions();
- $permissions = Array (
- 'OnItemBuild' => Array ('self' => true),
- 'OnCustomEvent' => Array ('self' => true),
+ $permissions = array(
+ 'OnItemBuild' => array('self' => true),
+ 'OnRecalculatePriorities' => array('self' => 'add|edit'),
+ 'OnCustomEvent' => array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks user permission to execute given $event
*
* @param kEvent $event
* @return bool
* @access public
*/
public function CheckPermission(kEvent $event)
{
$skip_permissions_check_events = Array (
'OnAnotherCustomEvent',
);
if ( in_array($event->Name, $skip_permissions_check_events) ) {
return true;
}
return parent::CheckPermission($event);
}
/**
+ * Define alternative event processing method names
+ *
+ * @return void
+ */
+ protected function mapEvents()
+ {
+ parent::mapEvents();
+
+ $events_map = array(
+ 'OnMassMoveUp' => 'OnChangePriority',
+ 'OnMassMoveDown' => 'OnChangePriority',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $events_map);
+ }
+
+ /**
+ * Processes OnMassMoveUp, OnMassMoveDown events
+ *
+ * @param kEvent $event Event.
+ *
+ * @return void
+ */
+ protected function OnChangePriority(kEvent $event)
+ {
+ $this->Application->SetVar('priority_prefix', $event->getPrefixSpecial());
+ $event->CallSubEvent('priority:' . $event->Name);
+ }
+
+ /**
+ * Completely recalculates priorities in current category
+ *
+ * @param kEvent $event Event.
+ *
+ * @return void
+ */
+ protected function OnRecalculatePriorities(kEvent $event)
+ {
+ $this->Application->SetVar('priority_prefix', $event->getPrefixSpecial());
+ $event->CallSubEvent('priority:' . $event->Name);
+ }
+
+ /**
+ * [HOOK] Connects to priority unit.
+ *
+ * @param kEvent $event Event.
+ *
+ * @return void
+ */
+ protected function OnModifyPrioritiesConfig(kEvent $event)
+ {
+ $config = $event->MasterEvent->getUnitConfig();
+
+ $prefixes = $config->getProcessPrefixes();
+ $prefixes[] = $event->Prefix;
+ $config->setProcessPrefixes($prefixes);
+ }
+
+ /**
* Set custom query for the list
*
* @param kEvent $event
*/
function OnCustomEvent($event)
{
$object = $event->getObject();
/* @var $object kDBList */
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @return void
* @access protected
* @see kDBEventHandler::OnListBuild()
*/
protected function SetCustomQuery(kEvent $event)
{
parent::SetCustomQuery($event);
$object = $event->getObject();
/* @var $object kDBList */
# identifying event based on special and setting filter
if ( $event->Special == 'custom-special' ) {
// $object->addFilter('primary_filter', '%1$s.Status = ' . STATUS_DISABLED);
}
}
/**
* Occurs before creating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemCreate(kEvent $event)
{
parent::OnBeforeItemCreate($event);
}
/**
* Occurs before updating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemUpdate(kEvent $event)
{
parent::OnBeforeItemUpdate($event);
}
/**
* Occurs before deleting item, id of item being
* deleted is stored as 'id' event param
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemDelete(kEvent $event)
{
parent::OnBeforeItemDelete($event);
}
/**
* Occurs before loading item, 'id' parameter
* allows to get id of item being loaded
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemLoad(kEvent $event)
{
parent::OnBeforeItemLoad($event);
}
/**
* Occurs after creating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterItemCreate(kEvent $event)
{
parent::OnAfterItemCreate($event);
}
/**
* Occurs after updating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterItemUpdate(kEvent $event)
{
parent::OnAfterItemUpdate($event);
}
/**
* Occurs after deleting item, id of deleted item
* is stored as 'id' param of event
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterItemDelete(kEvent $event)
{
parent::OnAfterItemDelete($event);
}
/**
* Loads user images
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterItemLoad(kEvent $event)
{
parent::OnAfterItemLoad($event);
}
}
Index: branches/1.3.x/units/sections/sections_config.php
===================================================================
--- branches/1.3.x/units/sections/sections_config.php (revision 16395)
+++ branches/1.3.x/units/sections/sections_config.php (revision 16396)
@@ -1,126 +1,126 @@
<?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' => 'users/e_user_tp.php'),
// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUserEventHandler', 'file' => 'users/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' => 'products/e_product_tp.php'),
// Array ('pseudo' => 'p_EventHandler', 'class' => 'EProductEventHandler', 'file' => 'products/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' => 'links/e_link_tp.php'),
// Array ('pseudo' => 'l_EventHandler', 'class' => 'ELinkEventHandler', 'file' => 'links/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' => 'categories/e_category_tp.php'),
// Array ('pseudo' => 'c_EventHandler', 'class' => 'ECategoryEventHandler', 'file' => 'categories/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' => 'articles/e_article_tp.php'),
// Array ('pseudo' => 'n_EventHandler', 'class' => 'EArticleEventHandler', 'file' => 'articles/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' => hBEFORE,
'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 (
'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,
),
'custom:setting_folder' => Array (
'parent' => 'in-portal:system',
'icon' => 'conf_custom',
'label' => 'la_title_Custom',
'use_parent_header' => 1,
'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 3.6,
'container' => true,
'show_mode' => smDEBUG,
'type' => stTREE,
),
- 'custom:configuration_custom' => Array (
+ 'custom:configuration_custom' => array(
'parent' => 'custom:setting_folder',
- 'icon' => 'custom',
+ 'icon' => 'conf_output',
'label' => 'la_tab_ConfigOutput',
- 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
- 'permissions' => Array('view', 'edit'),
+ 'url' => array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => array('view', 'edit'),
'priority' => 50,
'type' => stTREE,
),
),
);
Index: branches/1.3.x/admin_templates/widgets/widget_edit.tpl
===================================================================
--- branches/1.3.x/admin_templates/widgets/widget_edit.tpl (revision 16395)
+++ branches/1.3.x/admin_templates/widgets/widget_edit.tpl (revision 16396)
@@ -1,91 +1,92 @@
<inp2:adm_SetPopupSize width="750" height="570"/>
<inp2:m_DefaultParam prefix="widget" grid="Default" title_preset="widget_edit" section="custom:widgets" id_field="WidgetId"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="$section" prefix="$prefix" title_preset="$title_preset"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('<inp2:m_Param name="prefix"/>','<inp2:{$prefix}_SaveEvent/>');
}
));
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
cancel_edit('<inp2:m_Param name="prefix"/>','OnCancelEdit','<inp2:{$prefix}_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
}
));
a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
reset_form('<inp2:m_Param name="prefix"/>', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
}
));
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('<inp2:m_Param name="prefix"/>', '<inp2:{$prefix}_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('<inp2:m_Param name="prefix"/>', '<inp2:{$prefix}_NextId/>');
}
));
a_toolbar.Render();
<inp2:m_if check="{$prefix}_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="{$prefix}_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="{$prefix}_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="<inp2:m_Compress files='js/uploader/upload_manager.js|js/uploader/uploader.js'/>"></script>
</td>
</tr>
</tbody>
</table>
<inp2:{$prefix}_SaveWarning name="grid_save_warning"/>
<inp2:{$prefix}_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="la_section_Page"/>
<inp2:m_RenderElement name="inp_id_label" prefix="$prefix" field="$id_field" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="$prefix" field="Title" style="width: 100px"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="$prefix" field="Good"/>
<inp2:m_RenderElement name="inp_edit_fck" prefix="$prefix" field="Description"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="$prefix" field="Status"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="$prefix" field="Type" has_empty="1"/>
<!--##
<inp2:m_RenderElement name="inp_edit_date" prefix="$prefix" field="CreatedOn"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="$prefix" field="IsSystem" title="la_fld_IsSystemTemplate" onchange="OnSystemClick()"/>
##-->
<inp2:m_RenderElement name="inp_edit_box" prefix="$prefix" field="Qty" style="width: 50px"/>
<inp2:m_RenderElement name="inp_edit_codemirror" prefix="$prefix" field="Phone" language="text/html"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="$prefix" field="Email" style="width: 200px"/>
<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="$prefix" field="Image"/>
<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="$prefix" field="DataFile"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="$prefix" field="Priority" title="la_fld_Order"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
+<inp2:m_include t="incs/footer"/>
Index: branches/1.3.x/admin_templates/widgets/widget_list.tpl
===================================================================
--- branches/1.3.x/admin_templates/widgets/widget_list.tpl (revision 16395)
+++ branches/1.3.x/admin_templates/widgets/widget_list.tpl (revision 16396)
@@ -1,140 +1,157 @@
<inp2:m_DefaultParam prefix="widget" grid="Default" title_preset="widget_list" section="custom:widgets" edit_template="custom/widgets/widget_edit" id_field="WidgetId"/>
<inp2:m_include t="incs/header" />
<inp2:m_RenderElement name="combined_header" prefix="$prefix" section="$section" title_preset="$title_preset" pagination="1"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton(
new ToolBarButton(
'new_item',
'<inp2:m_phrase label="la_ToolTip_NewWidget" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="edit_template"/>')
}
)
);
function edit() {
std_edit_item('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="edit_template"/>');
}
a_toolbar.AddButton(
new ToolBarButton(
'edit',
'<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>',
edit
)
);
a_toolbar.AddButton(
new ToolBarButton(
'delete',
'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('<inp2:m_Param name="prefix"/>');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton(
new ToolBarButton(
'approve',
'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
function() {
submit_event('<inp2:m_Param name="prefix"/>', 'OnMassApprove');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'decline',
'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
function() {
submit_event('<inp2:m_Param name="prefix"/>', 'OnMassDecline');
}
)
);
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+ a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
+ submit_event('<inp2:m_Param name="prefix"/>', 'OnMassMoveUp');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
+ submit_event('<inp2:m_Param name="prefix"/>', 'OnMassMoveDown');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('refresh', '<inp2:m_phrase label="la_ToolTip_RecalculatePriorities" escape="1"/>', function() {
+ submit_event('<inp2:m_Param name="prefix"/>', 'OnRecalculatePriorities');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
a_toolbar.AddButton(
new ToolBarButton(
'export',
'<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>',
function() {
std_csv_export('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="grid"/>', 'export/export_progress');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'import',
'<inp2:m_phrase label="la_ToolTip_Import" escape="1"/>',
function() {
std_csv_import('<inp2:m_Param name="prefix"/>', '<inp2:m_Param name="grid"/>', 'import/import_start');
}
)
);
- a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton(
new ToolBarButton(
'view',
'<inp2:m_phrase label="la_ToolTip_View" escape="1"/>',
function(id) {
show_viewmenu(a_toolbar,'view');
}
)
);
a_toolbar.Render();
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="$prefix" grid="$grid"/>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<style type="text/css">
.red-row td.Status {
background-color: red;
}
</style>
<inp2:m_DefineElement name="grid_image_td">
<img src="<inp2:Field name='$field' format='resize:120x120'/>" <inp2:Field name='$field' format='resize:120x120;img_size' no_special='1'/> alt=""/><br />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_delete_td">
<a href="<inp2:m_Link {$PrefixSpecial}_event='OnDelete' pass='m,$PrefixSpecial'/>" onclick="return confirm('Delete Record?')">Delete</a>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="grid_custom_td">
<a href="<inp2:ItemEditLink/>" title="<inp2:m_Phrase name='la_Text_Edit' no_editing='1'/>" onclick="return direct_edit('<inp2:m_param name="PrefixSpecial"/>', this.href);"><inp2:Field field="$field" grid="$grid" format="$format"/></a>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="$prefix" IdField="$id_field" grid="$grid" max_row_height="100"/>
<script type="text/javascript">
- Grids['<inp2:m_Param name="prefix"/>'].SetDependantToolbarButtons( new Array('edit', 'delete', 'approve', 'decline') );
+ Grids['<inp2:m_Param name="prefix"/>'].SetDependantToolbarButtons( new Array('edit', 'delete', 'approve', 'decline', 'move_up', 'move_down') );
</script>
-<inp2:m_include t="incs/footer"/>
\ No newline at end of file
+<inp2:m_include t="incs/footer"/>
Index: branches/1.3.x/admin_templates/img/icons/icon24_conf_output.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/1.3.x/admin_templates/img/icons/icon24_conf_output.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/1.3.x/install/install_schema.sql
===================================================================
--- branches/1.3.x/install/install_schema.sql (revision 16395)
+++ branches/1.3.x/install/install_schema.sql (revision 16396)
@@ -1,17 +1,18 @@
CREATE TABLE Widgets (
WidgetId int(11) NOT NULL AUTO_INCREMENT,
Title varchar(255) NOT NULL DEFAULT '',
Description text,
Email varchar(255) NOT NULL DEFAULT '',
`Type` tinyint(4) NOT NULL DEFAULT '1',
Phone varchar(50) NOT NULL DEFAULT '',
Qty double NOT NULL DEFAULT '0',
`Status` tinyint(4) NOT NULL DEFAULT '2',
CreatedOn int(10) unsigned DEFAULT NULL,
Good tinyint(4) NOT NULL DEFAULT '0',
BirthTime int(10) unsigned DEFAULT NULL,
Image text,
DataFile text,
+ Priority int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (WidgetId)
);
Index: branches/1.3.x/install/upgrades.sql
===================================================================
--- branches/1.3.x/install/upgrades.sql (revision 16395)
+++ branches/1.3.x/install/upgrades.sql (revision 16396)
@@ -1,77 +1,80 @@
# ===== v 1.0.0 =====
# ===== v 1.0.1 =====
UPDATE Modules SET LoadOrder = 10 WHERE `Name` = 'Custom';
# ===== v 1.0.2-B1 =====
ALTER TABLE Widgets CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
UPDATE Modules SET TemplatePath = 'custom/' WHERE Name = 'Custom';
# ===== v 1.0.2-B2 =====
# ===== v 1.0.2-RC1 =====
# ===== v 1.0.2 =====
# ===== v 1.0.3-B1 =====
# ===== v 1.0.3-RC1 =====
# ===== v 1.0.3 =====
# ===== v 1.0.4-B1 =====
# ===== v 1.0.4 =====
# ===== v 1.1.0-B1 =====
UPDATE Modules SET Path = 'modules/custom/' WHERE `Name` = 'Custom';
# ===== v 1.1.0-B2 =====
# ===== v 1.1.0-RC1 =====
# ===== v 1.1.0 =====
# ===== v 1.1.1-B1 =====
# ===== v 1.1.1-RC1 =====
# ===== v 1.1.1 =====
# ===== v 1.1.2-B1 =====
# ===== v 1.1.2-RC1 =====
# ===== v 1.1.2 =====
# ===== v 1.1.3-B1 =====
# ===== v 1.1.3-B2 =====
# ===== v 1.1.3 =====
# ===== v 1.2.0-B1 =====
# ===== v 1.2.0-B2 =====
# ===== v 1.2.0-B3 =====
# ===== v 1.2.0-RC1 =====
# ===== v 1.2.0 =====
# ===== v 1.2.1-B1 =====
# ===== v 1.2.1-B2 =====
UPDATE Modules
SET ClassNamespace = 'Intechnic\\InPortal\\Modules\\Custom'
WHERE `Name` = 'Custom';
# ===== v 1.2.1-RC1 =====
# ===== v 1.2.1 =====
+# ===== v 1.2.2-B1 =====
+ALTER TABLE Widgets ADD `Priority` INT NOT NULL DEFAULT '0';
+
# ===== v 1.3.0-B1 =====
UPDATE Modules
SET ClassNamespace = 'InPortal\\Modules\\Custom'
WHERE `Name` = 'Custom';
Index: branches/1.3.x
===================================================================
--- branches/1.3.x (revision 16395)
+++ branches/1.3.x (revision 16396)
Property changes on: branches/1.3.x
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /modules/custom/branches/1.2.x:r16258,16265,16383
Event Timeline
Log In to Comment