Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Sep 23, 4:39 AM

in-portal

Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/relationship/relationship_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/relationship/relationship_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/relationship/relationship_config.php (revision 5560)
@@ -0,0 +1,107 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'rel',
+
+ 'Clones' => Array(
+ 'c-rel' => Array('ParentPrefix' => 'c'),
+ 'l-rel' => Array('ParentPrefix' => 'l'),
+ 'n-rel' => Array('ParentPrefix' => 'n'),
+ 'bb-rel'=> Array('ParentPrefix' => 'bb'),
+ /*'p-rel' => Array('ParentPrefix' => 'p'),*/
+ 'cms-rel'=> Array('ParentPrefix' => 'cms'),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'RelationshipEventHandler','file'=>'relationship_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnDeleteForeignRelations',
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'RelationshipId',
+ 'StatusField' => Array('Enabled','Type'),
+ 'TableName' => TABLE_PREFIX.'Relationship',
+ 'ParentTableKey'=> 'ResourceId',
+ 'ForeignKey' => 'SourceId',
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ 's1' => Array(),
+ 'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
+ 'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
+ 'ItemType' => '#ITEM_TYPES#',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=> 'SELECT %1$s.RelationshipId, %1$s.Priority, %1$s.Type, %1$s.Enabled %2$s
+ FROM %1$s #ITEM_JOIN#',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('ItemName' => 'asc', 'ItemType' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s #ITEM_JOIN#',),
+
+ 'Fields' => Array(
+ 'RelationshipId' => Array(),
+ 'SourceId' => Array('type'=>'int'),
+ 'TargetId' => Array('type'=>'int'),
+ 'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Type' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(1=>'la_Reciprocal',0=>'la_OneWay'),'not_null'=>1,'default'=>0,'use_phrases'=>1),
+ 'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ ),
+ 'VirtualFields' => Array( 'ItemName' => Array(),
+ 'ItemType' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ 'ItemName' => Array( 'title'=>'la_col_TargetId', 'data_block' => 'grid_checkbox_td'),
+ 'ItemType' => Array( 'title'=>'la_col_TargetType' ),
+ 'Type' => Array( 'title'=>'la_col_RelationshipType' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/relationship/relationship_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_config.php (revision 5560)
@@ -0,0 +1,136 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'rev',
+
+ 'Clones' => Array(
+ 'l-rev' => Array(
+ 'ParentPrefix' => 'l',
+ ),
+ 'n-rev' => Array(
+ 'ParentPrefix' => 'n',
+ ),
+ 'bb-rev'=> Array(
+ 'ParentPrefix' => 'bb',
+ ),
+ /*'p-rev' => Array('ParentPrefix' => 'p'),*/
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+
+
+ 'ParentPrefix' => 'p', // replace all usage of rev to "p-rev" and then remove this param from here and Prefix too
+
+ 'IDField' => 'ReviewId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+ 'TableName' => TABLE_PREFIX.'ItemReview',
+ 'ParentTableKey' => 'ResourceId', // linked field in master table
+ 'ForeignKey' => 'ItemId', // linked field in subtable
+
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'TitlePresets' => Array(
+ 'reviews_edit' => Array('format' => "!la_title_Editing_Review!"),
+ ),
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ ),
+ 'products' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ItemName' => 'pr.l1_Name',
+ 'ProductId' => 'pr.ProductId',
+ ),
+ 'product' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ItemName' => 'pr.l1_Name',
+ 'ProductId' => 'pr.ProductId',
+ ),
+
+ ),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+
+ 'products' => ' SELECT %1$s.* %2$s
+ FROM %1$s, '.TABLE_PREFIX.'Products pr
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+
+ 'product' => ' SELECT %1$s.* %2$s
+ FROM %1$s, '.TABLE_PREFIX.'Products pr
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+ ),
+
+ 'ItemSQLs' => Array( ''=> 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('CreatedOn' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array(
+ 'ReviewId' => Array('type'=>'int'),
+ 'CreatedOn' => Array('formatter'=>'kDateFormatter','not_null'=>1,'default'=>'#NOW#'),
+ 'ReviewText' => Array('type'=>'string','required'=>1,'not_null'=>1,'default'=>''),
+ 'IPAddress' => Array('type'=>'string','max_value_inc'=>15,'not_null'=>1,'default'=>''),
+ 'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'CreatedById' => Array('formatter'=>'kLEFTFormatter','options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>1,'not_null'=>1,'default'=>-1),
+ 'ItemType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Status' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active',2=>'la_Pending',0=>'la_Disabled'),'not_null'=>1,'default'=>2 ),
+ 'TextFormat' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Module' => Array('type'=>'string','not_null'=>1,'default'=>''),
+ ),
+ 'VirtualFields' => Array(
+ 'ReviewedBy' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
+ 'Fields' => Array(
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'reviewtext_checkbox_td'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
+ 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
+ 'Status' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+
+ 'ReviewsSection' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
+ 'Fields' => Array(
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_checkbox_namelink_td'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
+ 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
+ 'Status' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_tag_processor.php (revision 5560)
@@ -0,0 +1,95 @@
+<?php
+
+class ReviewsTagProcessor extends kDBTagProcessor
+{
+ /**
+ * Returns a link for editing product
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ItemEditLink($params)
+ {
+ $item_prefix = $params['item_prefix'];
+ $id_field = $this->Application->getUnitOption($item_prefix,'IDField');
+
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $item_id = $object->GetDBField($id_field);
+
+ return $this->Application->HREF($params['edit_template'],'', Array(
+ 'm_opener' => 'd',
+ $item_prefix.'_mode' => 't',
+ $item_prefix.'_event' => 'OnEdit',
+ $item_prefix.'_id' => $item_id,
+ 'pass' => 'all,'.$item_prefix
+ ), 'index4.php');
+ }
+
+ /**
+ * Get's reuested field value
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function Field($params)
+ {
+ $field = $this->SelectParam($params, 'name,field');
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+
+ if ($field == 'ReviewText') {
+ if ($object->GetDBField('TextFormat') == 1) {
+ $params['no_special'] = 'no_special';
+ }
+ else {
+ unset($params['no_special']);
+ }
+ }
+
+ return parent::Field($params);
+
+ }
+
+ function AlreadyReviewed($params)
+ {
+ $user_id = ($this->Application->GetVar('u_id') == 0) ? -2 : $this->Application->GetVar('u_id');
+ $object =& $this->getObject( Array('skip_autoload' => true) );
+ $product_info = $object->getLinkedInfo();
+
+ $sql = ' SELECT * FROM '.TABLE_PREFIX.'SpamControl
+ WHERE ItemResourceId='.$product_info['ParentId'].'
+ AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
+ AND PortalUserId='.$user_id.'
+ AND DataType="Review"';
+ $res = $this->Conn->GetRow($sql);
+ if($res['Expire'] > adodb_mktime())
+ {
+ $ret = 1;
+ }
+ else
+ {
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'SpamControl
+ WHERE ItemResourceId='.$product_info['ParentId'].'
+ AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
+ AND PortalUserId='.$user_id.'
+ AND DataType="Review"';
+ $this->Conn->Query($sql);
+ $ret = 0;
+ }
+ return $ret;
+ }
+
+ function HasError($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ if (method_exists($object, 'GetErrorMsg')) {
+ return parent::HasError($params);
+ }
+ else {
+ return 0;
+ }
+ }
+}
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/reviews/reviews_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/images/images_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/images/images_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/images/images_config.php (revision 5560)
@@ -0,0 +1,140 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'img',
+ 'Clones' => Array(
+ 'l-img' => Array('ParentPrefix' => 'l'),
+ 'n-img' => Array('ParentPrefix' => 'n'),
+ 'bb-img'=> Array('ParentPrefix' => 'bb'),
+ /*'p-img' => Array('ParentPrefix' => 'p'),*/
+ 'c-img' => Array('ParentPrefix' => 'c'),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ImageEventHandler','file'=>'image_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ImageTagProcessor','file'=>'image_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'AggregateTags' => Array(
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'Image',
+ 'LocalTagName' => 'ItemImage',
+ ),
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'ListImages',
+ 'LocalTagName' => 'PrintList2',
+ 'LocalSpecial' => 'list',
+ ),
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'LargeImageExists',
+ 'LocalTagName' => 'LargeImageExists',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'ImageId',
+ 'StatusField' => Array('Enabled', 'DefaultImg'), // field, that is affected by Approve/Decline events
+ 'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'TableName' => TABLE_PREFIX.'Images',
+ 'ParentTableKey'=> 'ResourceId', // linked field in master table
+ 'ForeignKey' => 'ResourceId', // linked field in subtable
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'Preview' => '0',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'ImageId' => Array('type'=>'int'),
+ 'ResourceId' => Array('type'=>'int', 'not_null'=>1, 'default' => 0),
+ 'Url' => Array('max_len'=>255, 'default' => '', 'not_null'=>1),
+ 'Name' => Array('max_len'=>255, 'required'=>1, 'not_null'=>1, 'default' => ''),
+ 'AltName' => Array('max_len'=>255, 'required'=>1, 'not_null'=>1),
+ 'ImageIndex' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'LocalImage' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ 'LocalPath' => Array('formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len'=>240, 'default' => '', 'not_null' => 1, 'include_path' => 1,
+ 'allowed_types' => Array(
+ 0 => 'image/jpeg',
+ 1 => 'image/pjpeg',
+ 2 => 'image/png',
+ 3 => 'image/gif',
+ 4 => 'image/bmp'
+ ),
+ 'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
+ 'bad_file_size' => '!la_error_FileTooLarge!',
+ 'cant_save_file' => '!la_error_cant_save_file!'
+ )
+ ),
+ 'Enabled' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Enabled', 0 => 'la_Disabled' ), 'default' => 0, 'not_null'=>1),
+ 'DefaultImg' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'ThumbUrl' => Array('max_len' => 255),
+ 'Priority' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'ThumbPath' => Array( 'formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len' => 255,
+ 'allowed_types' => Array(
+ 0 => 'image/jpeg',
+ 1 => 'image/pjpeg',
+ 2 => 'image/png',
+ 3 => 'image/gif',
+ 4 => 'image/bmp'
+ ),
+ 'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
+ 'bad_file_size' => '!la_error_FileTooLarge!',
+ 'cant_save_file' => '!la_error_cant_save_file!'
+ )
+ ),
+ 'LocalThumb' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ 'SameImages' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ ),
+ 'VirtualFields' => Array(
+ 'Preview' => Array(),
+ 'ImageUrl' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon17_custom.gif','1_0'=>'icon16_image.gif','0_0'=>'icon16_image_disabled.gif','1_1'=>'icon16_image_primary.gif'),
+ 'Fields' => Array(
+ 'Name' => Array( 'title'=>'la_col_ImageName' , 'data_block' => 'image_caption_td'),
+ 'AltName' => Array( 'title'=>'la_col_AltName' ),
+ 'Url' => Array( 'title'=>'la_col_ImageUrl', 'data_block' => 'image_url_td' ),
+ 'Enabled' => Array( 'title'=>'la_col_ImageEnabled' ),
+ 'Preview' => Array( 'title'=>'la_col_Preview', 'data_block' => 'image_preview_td' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/images/images_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/stylesheets/stylesheets_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/stylesheets/stylesheets_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/stylesheets/stylesheets_event_handler.php (revision 5560)
@@ -0,0 +1,27 @@
+<?php
+
+ class StylesheetsEventHandler extends InpDBEventHandler
+ {
+
+ /**
+ * Compile stylesheet file based on theme definitions
+ *
+ * @param kEvent $event
+ */
+ function OnCompileStylesheet(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $object->SwitchToLive();
+
+ $ids = explode(',', $event->MasterEvent->getEventParam('ids') );
+
+ if(!$ids) return false;
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+ $object->Compile();
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/stylesheets/stylesheets_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/units/general/helpers/mod_rewrite_helper.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/units/general/helpers/mod_rewrite_helper.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/units/general/helpers/mod_rewrite_helper.php (revision 5560)
@@ -0,0 +1,338 @@
+<?php
+
+ class kModRewriteHelper extends kHelper {
+
+ function kModRewriteHelper()
+ {
+ parent::kHelper();
+ $this->HTTPQuery =& $this->Application->recallObject('HTTPQuery');
+ }
+
+ function SetDefaultValues()
+ {
+ $defaults = Array('m_cat_id' => 0, 'm_cat_page' => 1, 'm_opener' => 's');
+ foreach ($defaults as $default_key => $default_value)
+ {
+ if ($this->HTTPQuery->Get($default_key) == null) {
+ $this->HTTPQuery->Set($default_key, $default_value);
+ }
+ }
+ }
+
+ function ProcessLanguage(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $sql = 'SELECT LanguageId FROM '.TABLE_PREFIX.'Language WHERE LOWER(PackName) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
+ $language_id = $this->Conn->GetOne($sql);
+ $this->Application->Phrases = new PhrasesCache();
+ if($language_id)
+ {
+ $this->HTTPQuery->Set('m_lang', $language_id);
+ $res = true;
+ }
+
+ $this->Application->VerifyLanguageId();
+ if (!$res) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessTheme(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $sql = 'SELECT ThemeId FROM '.TABLE_PREFIX.'Theme WHERE LOWER(Name) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
+ $theme_id = $this->Conn->GetOne($sql);
+ if($theme_id)
+ {
+ $this->HTTPQuery->Set('m_theme', $theme_id);
+ $res = true;
+ }
+ $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
+ if (!$res) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessCategory(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $category_id = 0;
+ $last_category_id = 0;
+ $category_path = '';
+ do
+ {
+ $category_path = trim($category_path.'/'.$url_part, '/');
+
+ if( preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
+ {
+ $category_path = $rets[1];
+ $this->HTTPQuery->Set('m_cat_page', $rets[2]);
+ }
+
+ $category_id = $this->Conn->GetOne(
+ 'SELECT CategoryId
+ FROM '.TABLE_PREFIX.'Category
+ WHERE NamedParentPath = '.$this->Conn->qstr($category_path));
+ if ($category_id !== false) {
+ $last_category_id = $category_id;
+ $url_part = array_shift($url_parts);
+ $res = true;
+ }
+ } while ($category_id !== false && $url_part);
+ $this->HTTPQuery->Set('m_cat_id', $last_category_id);
+
+ if ($url_part) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessModuleIndex(&$url_parts)
+ {
+ if ( count($url_parts) != 0 ) return false;
+
+ $sql = 'SELECT CachedCategoryTemplate
+ FROM '.TABLE_PREFIX.'Category
+ WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
+ $this->HTTPQuery->Set('t', $this->HTTPQuery->getDefaultTemplate( $this->Conn->GetOne($sql) ) );
+ return true;
+ }
+
+ function ProcessModuleItem(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ if ( count($url_parts) != 1 ) return false;
+ $url_part = array_shift($url_parts);
+
+ // match module reviews page
+ $page = 1;
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $page = $rets[2];
+ }
+
+ $cat_item = $this->Conn->GetRow('
+ SELECT ci.ItemPrefix, c.ParentPath, ci.CategoryId FORM '.TABLE_PREFIX.'CategoryItems AS ci
+ LEFT JOIN '.TABLE_PREFIX.'Category AS c
+ ON c.CategoryId = ci.CategoryId
+ WHERE
+ CategoryId = '.$this->Application->GetVar('m_cat_id').'
+ AND
+ Filename = '.$this->Conn->qstr($url_part));
+ if ($cat_item !== false) {
+ $module_prefix = $cat_item['ItemPrefix'];
+ $item_template = $category_data['CachedItemTemplate'];
+ if ($item_template) {
+ $url_parts = explode('/', $item_template);
+ array_push($url_parts, $url_part); // save item's filename as not processed
+ $url_part = array_shift($url_parts);
+ }
+ $this->Application->SetVar($cat_item['ItemPrefix'].'_id', $item_id);
+ }
+
+
+
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Reviews_Page', $page);
+
+ // only filename left, no other parts
+ $process_module = false;
+ $sql = 'SELECT ParentPath, CachedItemTemplate, CachedCategoryTemplate
+ FROM '.TABLE_PREFIX.'Category
+ WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
+ $category_data = $this->Conn->GetRow($sql);
+
+
+
+ $root_category_id = array_shift( explode('|', substr($category_data['ParentPath'], 1, -1)) );
+ $module_info = $this->Application->findModule('RootCat', $root_category_id);
+ if ($module_info) {
+ $module_prefix = $module_info['Var'];
+ $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => array_merge(Array($url_part), $url_parts)) );
+ $this->Application->HandleEvent($module_event);
+
+ if ($module_event->status == erSUCCESS && $this->HTTPQuery->Get($module_prefix.'_id')) {
+ $item_template = $category_data['CachedItemTemplate'];
+ if ($item_template) {
+ $this->HTTPQuery->Set('t', $item_template );
+ return true;
+ }
+ }
+ }
+ array_unshift($url_parts, $url_part);
+ return false;
+ }
+
+ function ProcessPhisycalTemplate(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+
+ $remaining = array();
+ do
+ {
+ $template_path = implode('/', $url_parts);
+
+ $t_parts['path'] = dirname($template_path) == '.' ? '' : '/'.dirname($template_path);
+ $t_parts['file'] = basename($template_path);
+
+ $sql = 'SELECT FileId
+ FROM '.TABLE_PREFIX.'ThemeFiles
+ WHERE (FilePath = '.$this->Conn->qstr($t_parts['path']).') AND (FileName = '.$this->Conn->qstr($t_parts['file'].'.tpl').')';
+
+// $sql = 'SELECT FileId FROM '.TABLE_PREFIX.'ThemeFiles WHERE CONCAT(FilePath, "/", FileName) = '.$this->Conn->qstr('/'.$template_path.'.tpl');
+ $template_found = $this->Conn->GetOne($sql);
+ if(!$template_found)
+ {
+ array_unshift($remaining, array_pop($url_parts));
+ }
+ } while (!$template_found && $url_parts);
+
+ $url_parts = $remaining;
+
+ if ($template_found) {
+ $this->HTTPQuery->Set('t', $template_path );
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if whole url_parts matches a whole In-CMS page
+ *
+ * @param array $url_parts
+ * @return boolean
+ */
+ function ProcessVirtualTemplate(&$url_parts)
+ {
+ if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-CMS')) return false;
+
+ $template_path = implode('/', $url_parts);
+ $sql = 'SELECT p.PageId, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
+ ON ci.ItemResourceId = p.ResourceId
+ WHERE
+ Path = '.$this->Conn->qstr($template_path).'
+ AND
+ ci.PrimaryCat = 1';
+ $template_found = $this->Conn->GetRow($sql);
+
+ if ($template_found) {
+ $this->Application->SetVar('m_cat_id', $template_found['CategoryId']);
+ $this->HTTPQuery->Set('t', $template_path );
+ return true;
+ }
+
+ return false;
+ }
+
+ function processRewriteURL()
+ {
+ $url = $this->HTTPQuery->Get('_mod_rw_url_');
+ if( substr($url, -5) == '.html' ) $url = substr($url, 0, strlen($url) - 5 );
+ $url_parts = $url ? explode('/', $url) : Array();
+
+ $process_module = true;
+ if($this->HTTPQuery->Get('rewrite') == 'on' || !$url_parts)
+ {
+ $this->SetDefaultValues();
+ }
+
+ if(!$url_parts)
+ {
+ $this->Application->Phrases = new PhrasesCache();
+ $this->Application->VerifyLanguageId();
+ $this->Application->Phrases->Init('phrases');
+ $this->Application->VerifyThemeId();
+
+ $this->HTTPQuery->Set('t', $this->HTTPQuery->getDefaultTemplate('') );
+ $this->HTTPQuery->finalizeParsing(Array('m'));
+ return false;
+ }
+ else
+ {
+ $this->HTTPQuery->Set('t', '');
+ }
+
+ $this->ProcessLanguage($url_parts);
+ $this->ProcessTheme($url_parts);
+
+ if ( $this->ProcessVirtualTemplate($url_parts) ) {
+ return true;
+ }
+
+ $this->ProcessCategory($url_parts);
+ if ( $this->ProcessModuleIndex($url_parts) ) {
+ return ;
+ }
+ if ( $this->ProcessModuleItem($url_parts) ) {
+ return ;
+ }
+
+ /*// match module
+ $next_template = $this->HTTPQuery->Get('next_template');
+ if($url_part || $next_template)
+ {
+ if($next_template)
+ {
+ $next_template_parts = explode('/', $next_template);
+ $module_folder = array_shift($next_template_parts);
+ }
+ else
+ {
+ $module_folder = $url_part;
+ }
+
+ foreach ($this->Application->ModuleInfo as $module_name => $module_data)
+ {
+ if( trim($module_data['TemplatePath'], '/') == $module_folder )
+ {
+ $module_prefix = $module_data['Var'];
+ break;
+ }
+ }
+ }*/
+
+ if ( $this->ProcessPhisycalTemplate($url_parts) ) {
+ if (!$url_parts) {
+ return true;
+ }
+ }
+
+ // pass params left to module
+
+ $this->Application->Phrases->Init('phrases');
+ $passed = Array('m');
+ $module_params = Array();
+ if ( isset($module_prefix) ) {
+ $passed[] = $module_prefix;
+ $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) );
+ if ($process_module) {
+ $this->Application->HandleEvent($module_event);
+ }
+ $item_id = $this->HTTPQuery->Get($module_prefix.'_id');
+ $module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' );
+
+ if ($module_event->status == erFAIL) {
+ $not_found = $this->Application->ConfigValue('ErrorTemplate');
+ $this->HTTPQuery->Set('t', $not_found ? $not_found : 'error_notfound' );
+ }
+ }
+
+ $this->HTTPQuery->finalizeParsing($passed, $module_params);
+ }
+
+
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/units/general/helpers/mod_rewrite_helper.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl (revision 5560)
@@ -0,0 +1,126 @@
+<inp2:m_RequireLogin perm_event="conf:OnLoad" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="section_header" prefix="conf" icon="icon46_settings_general" title="!la_tab_ConfigGeneral!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="conf" title_preset="config_list_general" icon="icon46_settings_general"/>
+
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+
+ function ValidatePassFld(fieldId){
+ var passFld=document.getElementById(fieldId);
+ var passVerifyFld=document.getElementById('verify_'+fieldId);
+ if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
+ return true;
+ }
+ else {
+ var passErrorCell=document.getElementById('error_'+fieldId);
+ if (passErrorCell){
+ passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
+ }
+ return false;
+ }
+ }
+
+ function ValidatePassFields(){
+ var el=false;
+ var validated=true;
+ for (var i=0; i<document.forms.kernel_form.elements.length; i++){
+ el=document.forms.kernel_form.elements[i];
+ if (el.getAttribute('primarytype')=='password'){
+ if (!ValidatePassFld(el.id)){
+ validated=false;
+ }
+ }
+ }
+ return validated;
+ }
+
+ function toggle_section($label) {
+ var $table = document.getElementById('config_table');
+ var $row = null;
+ var $is_visible = false;
+
+ for (var $i = 0; $i < $table.rows.length; $i++) {
+ $row = $table.rows[$i];
+ if ($row.getAttribute('header_label') != $label) {
+ continue;
+ }
+
+ if (!$row.style.display) {
+ $row.style.display = document.all ? 'block' : 'table-row';
+ }
+
+ $is_visible = !($row.style.display == 'none');
+ $row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
+
+ document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
+ }
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ if (ValidatePassFields()){
+ submit_event('conf','<inp2:conf_SaveEvent/>');
+ }
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('conf','OnCancel');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_include t="incs/config_blocks"/>
+
+<inp2:conf_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" id="config_table">
+ <!-- module root category selector: begin -->
+ <tr class="subsectiontitle">
+ <td colspan="2">
+ <inp2:m_phrase name="la_Text_RootCategory" />
+ </td>
+ <td align="right">
+ <a class="config-header" href="javascript:toggle_section('la_Text_RootCategory');" id="toggle_mark[la_Text_RootCategory]" title="Collapse/Expand Section">[-]</a>
+ </td>
+ </tr>
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" header_label="la_Text_RootCategory">
+ <td>
+ <span class="text"><inp2:m_phrase name="la_prompt_RootCategory" /></span>
+ </td>
+ <td>
+ <inp2:m_DefineElement name="category_caption">
+ <inp2:m_param name="separator"/><inp2:m_param name="cat_name"/>
+ </inp2:m_DefineElement>
+
+ <inp2:m_DefineElement name="root_cat_caption" />
+ <inp2:m_param name="cat_name"/>
+ </inp2:m_DefineElement>
+
+ <b><inp2:c_RootCategoryName/><inp2:conf_CategoryPath separator=" &gt; " rootcatblock="root_cat_caption" block="category_caption" /></b>
+ <input type="hidden" name="conf[ModuleRootCategory][VariableValue]" value="<inp2:conf_ModuleRootCategory/>"/>
+ <a href="javascript:openSelector('conf', '<inp2:m_t t="category_selector" pass="all,conf"/>', 'ModuleRootCategory');"><img src="img/icons/icon24_cat.gif" border="0" align="absmiddle" /></a>
+ </td>
+ <td class="error">&nbsp;</td>
+ </tr>
+ <!-- module root category selector: end -->
+
+ <inp2:conf_PrintList block="config_block" per_page="-1" full_block="config_block" half_block1="config_block1" half_block2="config_block2"/>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/config/config_general.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/incs/config_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/incs/config_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/incs/config_blocks.tpl (revision 5560)
@@ -0,0 +1,95 @@
+<inp2:m_DefineElement name="config_edit_text">
+ <input type="text" tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" />" />
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_password">
+ <input type="password" tabindex="<inp2:m_get param="tab_index"/>" primarytype="password" name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>" value="" />
+ <input type="password" name="verify_<inp2:InputName field="$field"/>" id="verify_<inp2:InputName field="$field"/>" value="" />
+ &nbsp;<span class="error" id="error_<inp2:InputName field="$field"/>"></span>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_option">
+ <option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_select">
+ <select name="<inp2:InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>">
+ <inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
+ </select>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_checkbox" field_class="">
+ <input type="hidden" id="<inp2:InputName field="$field"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" db="db"/>">
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:InputName field="$field"/>" <inp2:Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:InputName field="$field"/>'))">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_textarea">
+ <textarea tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" <inp2:m_param name="field_params" />><inp2:Field field="$field" /></textarea>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_radio_item">
+ <input type="radio" <inp2:m_param name="checked"/> name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_radio">
+ <inp2:PredefinedOptions field="$field" tabindex="$pass_tabindex" block="config_radio_item" selected="checked"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="2">
+ <inp2:Field name="heading" as_label="1"/>
+ </td>
+ <td align="right">
+ <a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
+ </td>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
+ <td>
+ <inp2:Field field="prompt" as_label="1" />
+ <inp2:m_if check="m_IsDebugMode">
+ <br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
+ </inp2:m_if>
+ </td>
+
+ <td>
+ <inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>
+ </td>
+
+ <td class="error"><inp2:Error id_field="VariableName"/>&nbsp;</td>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block1">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="2">
+ <inp2:Field name="heading" as_label="1"/>
+ </td>
+ <td align="right">
+ <a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
+ </td>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
+ <td>
+ <inp2:Field field="prompt" as_label="1" />
+ <inp2:m_if check="m_IsDebugMode">
+ <br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
+ </inp2:m_if>
+ </td>
+
+ <td>
+ <nobr><inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>&nbsp;&nbsp;
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block2">
+ <inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/></nobr>
+ </td>
+ <td class="error"><inp2:Error id_field="VariableName"/>&nbsp;</td>
+ </tr>
+</inp2:m_DefineElement>
Property changes on: branches/unlabeled/unlabeled-1.4.2/kernel/admin_templates/incs/config_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/admin/install/upgrades/inportal_upgrade_v1.2.1.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/admin/install/upgrades/inportal_upgrade_v1.2.1.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/admin/install/upgrades/inportal_upgrade_v1.2.1.php (revision 5560)
@@ -0,0 +1,11 @@
+<?php
+ $application =& kApplication::Instance();
+
+ // set Categories Name & Description to their multilingual equialents
+ $ml_formatter =& $application->recallObject('kMultiLanguage');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+
+ $sql = 'UPDATE '.$table_name.'
+ SET '.$ml_formatter->LangFieldName('Name').' = Name, '.$ml_formatter->LangFieldName('Description').' = Description';
+ $application->Conn->Query($sql);
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/admin/install/upgrades/inportal_upgrade_v1.2.1.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/relationship/relationship_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/relationship/relationship_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/relationship/relationship_config.php (revision 5560)
@@ -0,0 +1,107 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'rel',
+
+ 'Clones' => Array(
+ 'c-rel' => Array('ParentPrefix' => 'c'),
+ 'l-rel' => Array('ParentPrefix' => 'l'),
+ 'n-rel' => Array('ParentPrefix' => 'n'),
+ 'bb-rel'=> Array('ParentPrefix' => 'bb'),
+ /*'p-rel' => Array('ParentPrefix' => 'p'),*/
+ 'cms-rel'=> Array('ParentPrefix' => 'cms'),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'RelationshipEventHandler','file'=>'relationship_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnDeleteForeignRelations',
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'RelationshipId',
+ 'StatusField' => Array('Enabled','Type'),
+ 'TableName' => TABLE_PREFIX.'Relationship',
+ 'ParentTableKey'=> 'ResourceId',
+ 'ForeignKey' => 'SourceId',
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ 's1' => Array(),
+ 'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
+ 'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
+ 'ItemType' => '#ITEM_TYPES#',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=> 'SELECT %1$s.RelationshipId, %1$s.Priority, %1$s.Type, %1$s.Enabled %2$s
+ FROM %1$s #ITEM_JOIN#',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('ItemName' => 'asc', 'ItemType' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s #ITEM_JOIN#',),
+
+ 'Fields' => Array(
+ 'RelationshipId' => Array(),
+ 'SourceId' => Array('type'=>'int'),
+ 'TargetId' => Array('type'=>'int'),
+ 'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Type' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(1=>'la_Reciprocal',0=>'la_OneWay'),'not_null'=>1,'default'=>0,'use_phrases'=>1),
+ 'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ ),
+ 'VirtualFields' => Array( 'ItemName' => Array(),
+ 'ItemType' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ 'ItemName' => Array( 'title'=>'la_col_TargetId', 'data_block' => 'grid_checkbox_td'),
+ 'ItemType' => Array( 'title'=>'la_col_TargetType' ),
+ 'Type' => Array( 'title'=>'la_col_RelationshipType' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/relationship/relationship_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_config.php (revision 5560)
@@ -0,0 +1,136 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'rev',
+
+ 'Clones' => Array(
+ 'l-rev' => Array(
+ 'ParentPrefix' => 'l',
+ ),
+ 'n-rev' => Array(
+ 'ParentPrefix' => 'n',
+ ),
+ 'bb-rev'=> Array(
+ 'ParentPrefix' => 'bb',
+ ),
+ /*'p-rev' => Array('ParentPrefix' => 'p'),*/
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ReviewsEventHandler','file'=>'reviews_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ReviewsTagProcessor','file'=>'reviews_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+
+
+ 'ParentPrefix' => 'p', // replace all usage of rev to "p-rev" and then remove this param from here and Prefix too
+
+ 'IDField' => 'ReviewId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+ 'TableName' => TABLE_PREFIX.'ItemReview',
+ 'ParentTableKey' => 'ResourceId', // linked field in master table
+ 'ForeignKey' => 'ItemId', // linked field in subtable
+
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'TitlePresets' => Array(
+ 'reviews_edit' => Array('format' => "!la_title_Editing_Review!"),
+ ),
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ ),
+ 'products' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ItemName' => 'pr.l1_Name',
+ 'ProductId' => 'pr.ProductId',
+ ),
+ 'product' => Array(
+ 'ReviewedBy' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ 'ItemName' => 'pr.l1_Name',
+ 'ProductId' => 'pr.ProductId',
+ ),
+
+ ),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+
+ 'products' => ' SELECT %1$s.* %2$s
+ FROM %1$s, '.TABLE_PREFIX.'Products pr
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+
+ 'product' => ' SELECT %1$s.* %2$s
+ FROM %1$s, '.TABLE_PREFIX.'Products pr
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+ ),
+
+ 'ItemSQLs' => Array( ''=> 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('CreatedOn' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array(
+ 'ReviewId' => Array('type'=>'int'),
+ 'CreatedOn' => Array('formatter'=>'kDateFormatter','not_null'=>1,'default'=>'#NOW#'),
+ 'ReviewText' => Array('type'=>'string','required'=>1,'not_null'=>1,'default'=>''),
+ 'IPAddress' => Array('type'=>'string','max_value_inc'=>15,'not_null'=>1,'default'=>''),
+ 'ItemId' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'CreatedById' => Array('formatter'=>'kLEFTFormatter','options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>1,'not_null'=>1,'default'=>-1),
+ 'ItemType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Status' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array(1=>'la_Active',2=>'la_Pending',0=>'la_Disabled'),'not_null'=>1,'default'=>2 ),
+ 'TextFormat' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'Module' => Array('type'=>'string','not_null'=>1,'default'=>''),
+ ),
+ 'VirtualFields' => Array(
+ 'ReviewedBy' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
+ 'Fields' => Array(
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'reviewtext_checkbox_td'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
+ 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
+ 'Status' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+
+ 'ReviewsSection' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'),
+ 'Fields' => Array(
+ 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_checkbox_namelink_td'),
+ 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy' ),
+ 'CreatedOn_formatted' => Array( 'title'=>'la_col_CreatedOn', 'sort_field' => 'CreatedOn' ),
+ 'Status' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_tag_processor.php (revision 5560)
@@ -0,0 +1,95 @@
+<?php
+
+class ReviewsTagProcessor extends kDBTagProcessor
+{
+ /**
+ * Returns a link for editing product
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ItemEditLink($params)
+ {
+ $item_prefix = $params['item_prefix'];
+ $id_field = $this->Application->getUnitOption($item_prefix,'IDField');
+
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+ $item_id = $object->GetDBField($id_field);
+
+ return $this->Application->HREF($params['edit_template'],'', Array(
+ 'm_opener' => 'd',
+ $item_prefix.'_mode' => 't',
+ $item_prefix.'_event' => 'OnEdit',
+ $item_prefix.'_id' => $item_id,
+ 'pass' => 'all,'.$item_prefix
+ ), 'index4.php');
+ }
+
+ /**
+ * Get's reuested field value
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function Field($params)
+ {
+ $field = $this->SelectParam($params, 'name,field');
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+
+ if ($field == 'ReviewText') {
+ if ($object->GetDBField('TextFormat') == 1) {
+ $params['no_special'] = 'no_special';
+ }
+ else {
+ unset($params['no_special']);
+ }
+ }
+
+ return parent::Field($params);
+
+ }
+
+ function AlreadyReviewed($params)
+ {
+ $user_id = ($this->Application->GetVar('u_id') == 0) ? -2 : $this->Application->GetVar('u_id');
+ $object =& $this->getObject( Array('skip_autoload' => true) );
+ $product_info = $object->getLinkedInfo();
+
+ $sql = ' SELECT * FROM '.TABLE_PREFIX.'SpamControl
+ WHERE ItemResourceId='.$product_info['ParentId'].'
+ AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
+ AND PortalUserId='.$user_id.'
+ AND DataType="Review"';
+ $res = $this->Conn->GetRow($sql);
+ if($res['Expire'] > adodb_mktime())
+ {
+ $ret = 1;
+ }
+ else
+ {
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'SpamControl
+ WHERE ItemResourceId='.$product_info['ParentId'].'
+ AND IPaddress="'.$_SERVER['REMOTE_ADDR'].'"
+ AND PortalUserId='.$user_id.'
+ AND DataType="Review"';
+ $this->Conn->Query($sql);
+ $ret = 0;
+ }
+ return $ret;
+ }
+
+ function HasError($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ if (method_exists($object, 'GetErrorMsg')) {
+ return parent::HasError($params);
+ }
+ else {
+ return 0;
+ }
+ }
+}
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/reviews/reviews_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/images/images_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/images/images_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/images/images_config.php (revision 5560)
@@ -0,0 +1,140 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'img',
+ 'Clones' => Array(
+ 'l-img' => Array('ParentPrefix' => 'l'),
+ 'n-img' => Array('ParentPrefix' => 'n'),
+ 'bb-img'=> Array('ParentPrefix' => 'bb'),
+ /*'p-img' => Array('ParentPrefix' => 'p'),*/
+ 'c-img' => Array('ParentPrefix' => 'c'),
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ImageEventHandler','file'=>'image_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ImageTagProcessor','file'=>'image_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'AggregateTags' => Array(
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'Image',
+ 'LocalTagName' => 'ItemImage',
+ ),
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'ListImages',
+ 'LocalTagName' => 'PrintList2',
+ 'LocalSpecial' => 'list',
+ ),
+ Array(
+ 'AggregateTo' => '#PARENT#',
+ 'AggregatedTagName' => 'LargeImageExists',
+ 'LocalTagName' => 'LargeImageExists',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'ImageId',
+ 'StatusField' => Array('Enabled', 'DefaultImg'), // field, that is affected by Approve/Decline events
+ 'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'TableName' => TABLE_PREFIX.'Images',
+ 'ParentTableKey'=> 'ResourceId', // linked field in master table
+ 'ForeignKey' => 'ResourceId', // linked field in subtable
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ 'Preview' => '0',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'ImageId' => Array('type'=>'int'),
+ 'ResourceId' => Array('type'=>'int', 'not_null'=>1, 'default' => 0),
+ 'Url' => Array('max_len'=>255, 'default' => '', 'not_null'=>1),
+ 'Name' => Array('max_len'=>255, 'required'=>1, 'not_null'=>1, 'default' => ''),
+ 'AltName' => Array('max_len'=>255, 'required'=>1, 'not_null'=>1),
+ 'ImageIndex' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'LocalImage' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ 'LocalPath' => Array('formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len'=>240, 'default' => '', 'not_null' => 1, 'include_path' => 1,
+ 'allowed_types' => Array(
+ 0 => 'image/jpeg',
+ 1 => 'image/pjpeg',
+ 2 => 'image/png',
+ 3 => 'image/gif',
+ 4 => 'image/bmp'
+ ),
+ 'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
+ 'bad_file_size' => '!la_error_FileTooLarge!',
+ 'cant_save_file' => '!la_error_cant_save_file!'
+ )
+ ),
+ 'Enabled' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Enabled', 0 => 'la_Disabled' ), 'default' => 0, 'not_null'=>1),
+ 'DefaultImg' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'ThumbUrl' => Array('max_len' => 255),
+ 'Priority' => Array('type'=>'int', 'default' => 0, 'not_null'=>1),
+ 'ThumbPath' => Array( 'formatter'=>'kPictureFormatter', 'skip_empty'=>1, 'max_len' => 255,
+ 'allowed_types' => Array(
+ 0 => 'image/jpeg',
+ 1 => 'image/pjpeg',
+ 2 => 'image/png',
+ 3 => 'image/gif',
+ 4 => 'image/bmp'
+ ),
+ 'error_msgs' => Array( 'bad_file_format' => '!la_error_InvalidFileFormat!',
+ 'bad_file_size' => '!la_error_FileTooLarge!',
+ 'cant_save_file' => '!la_error_cant_save_file!'
+ )
+ ),
+ 'LocalThumb' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ 'SameImages' => Array('type'=>'int', 'default' => 1, 'not_null'=>1),
+ ),
+ 'VirtualFields' => Array(
+ 'Preview' => Array(),
+ 'ImageUrl' => Array(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon17_custom.gif','1_0'=>'icon16_image.gif','0_0'=>'icon16_image_disabled.gif','1_1'=>'icon16_image_primary.gif'),
+ 'Fields' => Array(
+ 'Name' => Array( 'title'=>'la_col_ImageName' , 'data_block' => 'image_caption_td'),
+ 'AltName' => Array( 'title'=>'la_col_AltName' ),
+ 'Url' => Array( 'title'=>'la_col_ImageUrl', 'data_block' => 'image_url_td' ),
+ 'Enabled' => Array( 'title'=>'la_col_ImageEnabled' ),
+ 'Preview' => Array( 'title'=>'la_col_Preview', 'data_block' => 'image_preview_td' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/images/images_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/stylesheets/stylesheets_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/stylesheets/stylesheets_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/stylesheets/stylesheets_event_handler.php (revision 5560)
@@ -0,0 +1,27 @@
+<?php
+
+ class StylesheetsEventHandler extends InpDBEventHandler
+ {
+
+ /**
+ * Compile stylesheet file based on theme definitions
+ *
+ * @param kEvent $event
+ */
+ function OnCompileStylesheet(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $object->SwitchToLive();
+
+ $ids = explode(',', $event->MasterEvent->getEventParam('ids') );
+
+ if(!$ids) return false;
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+ $object->Compile();
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/stylesheets/stylesheets_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/mod_rewrite_helper.php
===================================================================
--- branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/mod_rewrite_helper.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/mod_rewrite_helper.php (revision 5560)
@@ -0,0 +1,338 @@
+<?php
+
+ class kModRewriteHelper extends kHelper {
+
+ function kModRewriteHelper()
+ {
+ parent::kHelper();
+ $this->HTTPQuery =& $this->Application->recallObject('HTTPQuery');
+ }
+
+ function SetDefaultValues()
+ {
+ $defaults = Array('m_cat_id' => 0, 'm_cat_page' => 1, 'm_opener' => 's');
+ foreach ($defaults as $default_key => $default_value)
+ {
+ if ($this->HTTPQuery->Get($default_key) == null) {
+ $this->HTTPQuery->Set($default_key, $default_value);
+ }
+ }
+ }
+
+ function ProcessLanguage(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $sql = 'SELECT LanguageId FROM '.TABLE_PREFIX.'Language WHERE LOWER(PackName) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
+ $language_id = $this->Conn->GetOne($sql);
+ $this->Application->Phrases = new PhrasesCache();
+ if($language_id)
+ {
+ $this->HTTPQuery->Set('m_lang', $language_id);
+ $res = true;
+ }
+
+ $this->Application->VerifyLanguageId();
+ if (!$res) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessTheme(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $sql = 'SELECT ThemeId FROM '.TABLE_PREFIX.'Theme WHERE LOWER(Name) = '.$this->Conn->qstr($url_part).' AND Enabled = 1';
+ $theme_id = $this->Conn->GetOne($sql);
+ if($theme_id)
+ {
+ $this->HTTPQuery->Set('m_theme', $theme_id);
+ $res = true;
+ }
+ $this->Application->VerifyThemeId(); // verify anyway - will set default if not found!!!
+ if (!$res) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessCategory(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ $res = false;
+ $url_part = array_shift($url_parts);
+
+ $category_id = 0;
+ $last_category_id = 0;
+ $category_path = '';
+ do
+ {
+ $category_path = trim($category_path.'/'.$url_part, '/');
+
+ if( preg_match('/(.*)_([\d]+)$/', $category_path, $rets) )
+ {
+ $category_path = $rets[1];
+ $this->HTTPQuery->Set('m_cat_page', $rets[2]);
+ }
+
+ $category_id = $this->Conn->GetOne(
+ 'SELECT CategoryId
+ FROM '.TABLE_PREFIX.'Category
+ WHERE NamedParentPath = '.$this->Conn->qstr($category_path));
+ if ($category_id !== false) {
+ $last_category_id = $category_id;
+ $url_part = array_shift($url_parts);
+ $res = true;
+ }
+ } while ($category_id !== false && $url_part);
+ $this->HTTPQuery->Set('m_cat_id', $last_category_id);
+
+ if ($url_part) {
+ array_unshift($url_parts, $url_part);
+ }
+ return $res;
+ }
+
+ function ProcessModuleIndex(&$url_parts)
+ {
+ if ( count($url_parts) != 0 ) return false;
+
+ $sql = 'SELECT CachedCategoryTemplate
+ FROM '.TABLE_PREFIX.'Category
+ WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
+ $this->HTTPQuery->Set('t', $this->HTTPQuery->getDefaultTemplate( $this->Conn->GetOne($sql) ) );
+ return true;
+ }
+
+ function ProcessModuleItem(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+ if ( count($url_parts) != 1 ) return false;
+ $url_part = array_shift($url_parts);
+
+ // match module reviews page
+ $page = 1;
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $page = $rets[2];
+ }
+
+ $cat_item = $this->Conn->GetRow('
+ SELECT ci.ItemPrefix, c.ParentPath, ci.CategoryId FORM '.TABLE_PREFIX.'CategoryItems AS ci
+ LEFT JOIN '.TABLE_PREFIX.'Category AS c
+ ON c.CategoryId = ci.CategoryId
+ WHERE
+ CategoryId = '.$this->Application->GetVar('m_cat_id').'
+ AND
+ Filename = '.$this->Conn->qstr($url_part));
+ if ($cat_item !== false) {
+ $module_prefix = $cat_item['ItemPrefix'];
+ $item_template = $category_data['CachedItemTemplate'];
+ if ($item_template) {
+ $url_parts = explode('/', $item_template);
+ array_push($url_parts, $url_part); // save item's filename as not processed
+ $url_part = array_shift($url_parts);
+ }
+ $this->Application->SetVar($cat_item['ItemPrefix'].'_id', $item_id);
+ }
+
+
+
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Reviews_Page', $page);
+
+ // only filename left, no other parts
+ $process_module = false;
+ $sql = 'SELECT ParentPath, CachedItemTemplate, CachedCategoryTemplate
+ FROM '.TABLE_PREFIX.'Category
+ WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
+ $category_data = $this->Conn->GetRow($sql);
+
+
+
+ $root_category_id = array_shift( explode('|', substr($category_data['ParentPath'], 1, -1)) );
+ $module_info = $this->Application->findModule('RootCat', $root_category_id);
+ if ($module_info) {
+ $module_prefix = $module_info['Var'];
+ $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => array_merge(Array($url_part), $url_parts)) );
+ $this->Application->HandleEvent($module_event);
+
+ if ($module_event->status == erSUCCESS && $this->HTTPQuery->Get($module_prefix.'_id')) {
+ $item_template = $category_data['CachedItemTemplate'];
+ if ($item_template) {
+ $this->HTTPQuery->Set('t', $item_template );
+ return true;
+ }
+ }
+ }
+ array_unshift($url_parts, $url_part);
+ return false;
+ }
+
+ function ProcessPhisycalTemplate(&$url_parts)
+ {
+ if (!isset($url_parts[0])) return false;
+
+ $remaining = array();
+ do
+ {
+ $template_path = implode('/', $url_parts);
+
+ $t_parts['path'] = dirname($template_path) == '.' ? '' : '/'.dirname($template_path);
+ $t_parts['file'] = basename($template_path);
+
+ $sql = 'SELECT FileId
+ FROM '.TABLE_PREFIX.'ThemeFiles
+ WHERE (FilePath = '.$this->Conn->qstr($t_parts['path']).') AND (FileName = '.$this->Conn->qstr($t_parts['file'].'.tpl').')';
+
+// $sql = 'SELECT FileId FROM '.TABLE_PREFIX.'ThemeFiles WHERE CONCAT(FilePath, "/", FileName) = '.$this->Conn->qstr('/'.$template_path.'.tpl');
+ $template_found = $this->Conn->GetOne($sql);
+ if(!$template_found)
+ {
+ array_unshift($remaining, array_pop($url_parts));
+ }
+ } while (!$template_found && $url_parts);
+
+ $url_parts = $remaining;
+
+ if ($template_found) {
+ $this->HTTPQuery->Set('t', $template_path );
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if whole url_parts matches a whole In-CMS page
+ *
+ * @param array $url_parts
+ * @return boolean
+ */
+ function ProcessVirtualTemplate(&$url_parts)
+ {
+ if (!isset($url_parts[0]) || !$this->Application->isModuleEnabled('In-CMS')) return false;
+
+ $template_path = implode('/', $url_parts);
+ $sql = 'SELECT p.PageId, ci.CategoryId FROM '.TABLE_PREFIX.'Pages AS p
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
+ ON ci.ItemResourceId = p.ResourceId
+ WHERE
+ Path = '.$this->Conn->qstr($template_path).'
+ AND
+ ci.PrimaryCat = 1';
+ $template_found = $this->Conn->GetRow($sql);
+
+ if ($template_found) {
+ $this->Application->SetVar('m_cat_id', $template_found['CategoryId']);
+ $this->HTTPQuery->Set('t', $template_path );
+ return true;
+ }
+
+ return false;
+ }
+
+ function processRewriteURL()
+ {
+ $url = $this->HTTPQuery->Get('_mod_rw_url_');
+ if( substr($url, -5) == '.html' ) $url = substr($url, 0, strlen($url) - 5 );
+ $url_parts = $url ? explode('/', $url) : Array();
+
+ $process_module = true;
+ if($this->HTTPQuery->Get('rewrite') == 'on' || !$url_parts)
+ {
+ $this->SetDefaultValues();
+ }
+
+ if(!$url_parts)
+ {
+ $this->Application->Phrases = new PhrasesCache();
+ $this->Application->VerifyLanguageId();
+ $this->Application->Phrases->Init('phrases');
+ $this->Application->VerifyThemeId();
+
+ $this->HTTPQuery->Set('t', $this->HTTPQuery->getDefaultTemplate('') );
+ $this->HTTPQuery->finalizeParsing(Array('m'));
+ return false;
+ }
+ else
+ {
+ $this->HTTPQuery->Set('t', '');
+ }
+
+ $this->ProcessLanguage($url_parts);
+ $this->ProcessTheme($url_parts);
+
+ if ( $this->ProcessVirtualTemplate($url_parts) ) {
+ return true;
+ }
+
+ $this->ProcessCategory($url_parts);
+ if ( $this->ProcessModuleIndex($url_parts) ) {
+ return ;
+ }
+ if ( $this->ProcessModuleItem($url_parts) ) {
+ return ;
+ }
+
+ /*// match module
+ $next_template = $this->HTTPQuery->Get('next_template');
+ if($url_part || $next_template)
+ {
+ if($next_template)
+ {
+ $next_template_parts = explode('/', $next_template);
+ $module_folder = array_shift($next_template_parts);
+ }
+ else
+ {
+ $module_folder = $url_part;
+ }
+
+ foreach ($this->Application->ModuleInfo as $module_name => $module_data)
+ {
+ if( trim($module_data['TemplatePath'], '/') == $module_folder )
+ {
+ $module_prefix = $module_data['Var'];
+ break;
+ }
+ }
+ }*/
+
+ if ( $this->ProcessPhisycalTemplate($url_parts) ) {
+ if (!$url_parts) {
+ return true;
+ }
+ }
+
+ // pass params left to module
+
+ $this->Application->Phrases->Init('phrases');
+ $passed = Array('m');
+ $module_params = Array();
+ if ( isset($module_prefix) ) {
+ $passed[] = $module_prefix;
+ $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) );
+ if ($process_module) {
+ $this->Application->HandleEvent($module_event);
+ }
+ $item_id = $this->HTTPQuery->Get($module_prefix.'_id');
+ $module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' );
+
+ if ($module_event->status == erFAIL) {
+ $not_found = $this->Application->ConfigValue('ErrorTemplate');
+ $this->HTTPQuery->Set('t', $not_found ? $not_found : 'error_notfound' );
+ }
+ }
+
+ $this->HTTPQuery->finalizeParsing($passed, $module_params);
+ }
+
+
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/mod_rewrite_helper.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.4
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline