Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Jun 20, 1:51 PM

in-portal

Index: branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_data/custom_data_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_data/custom_data_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_data/custom_data_event_handler.php (revision 6786)
@@ -0,0 +1,7 @@
+<?php
+
+ class CustomDataEventHandler extends kDBEventHandler {
+
+
+ }
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_data/custom_data_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/kernel/units/images/image_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/kernel/units/images/image_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/kernel/units/images/image_event_handler.php (revision 6786)
@@ -0,0 +1,336 @@
+<?php
+class ImageEventHandler extends kDBEventHandler {
+
+ function mapEvents()
+ {
+ parent::mapEvents(); // ensure auto-adding of approve/decine and so on events
+ $image_events = Array(
+ 'OnAfterCopyToTemp'=>'ImageAction',
+ 'OnBeforeDeleteFromLive'=>'ImageAction',
+ 'OnBeforeCopyToLive'=>'ImageAction',
+ 'OnBeforeItemDelete'=>'ImageAction',
+ 'OnAfterClone'=>'ImageAction',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $image_events);
+ }
+
+ function customProcessing(&$event, $type)
+ {
+ $object =& $event->GetObject();
+ switch ($type)
+ {
+ case 'before' :
+ if ($object->GetDBField('LocalImage'))
+ {
+ $object->SetDBField('Url', '');
+ }
+ else
+ {
+ $object->SetDBField('LocalPath', '');
+ }
+
+ if ($object->GetDBField('LocalThumb'))
+ {
+ $object->SetDBField('ThumbUrl', '');
+ }
+ else
+ {
+ $object->SetDBField('ThumbPath', '');
+ }
+
+ if ($object->GetDBField('SameImages'))
+ {
+ $object->SetDBField('LocalImage', 1);
+ $object->SetDBField('LocalPath', '');
+ $object->SetDBField('Url', '');
+ }
+ break;
+ case 'after' :
+ if ($object->GetDBField('DefaultImg') )
+ {
+ $sql = 'UPDATE '.$object->TableName.' SET DefaultImg=0 WHERE ResourceId='.
+ $object->GetDBField('ResourceId').' AND ImageId<>'.
+ $object->GetId();
+ $res = $this->Conn->Query($sql);
+ }
+ break;
+ default:
+ }
+ }
+
+ function ImageAction(&$event)
+ {
+ $id = $event->getEventParam('id');
+ $object =& $this->Application->recallObject($event->Prefix.'.-item', $event->Prefix);
+ if (in_array($event->Name, Array('OnBeforeDeleteFromLive','OnAfterClone')) ) {
+ $object->SwitchToLive();
+ }
+ elseif ($event->Name == 'OnBeforeItemDelete') {
+ // keep current table
+ }
+ else {
+ $object->SwitchToTemp();
+ }
+
+ $object->Load($id);
+
+ $fields = Array('LocalPath' => 'LocalImage', 'ThumbPath' => 'LocalThumb');
+ foreach ($fields as $a_field => $mode_field) {
+ $file = $object->GetField($a_field);
+ if (!$file) continue;
+ $source_file = FULL_PATH.$file;
+
+ switch ($event->Name) {
+ // Copy image files to pending dir and update corresponding fields in temp record
+ // Checking for existing files and renaming if nessessary - two users may upload same pending files at the same time!
+ case 'OnAfterCopyToTemp':
+ $new_file = IMAGES_PENDING_PATH . $this->ValidateFileName(FULL_PATH.IMAGES_PENDING_PATH, basename($file));
+ $dest_file = FULL_PATH.$new_file;
+ copy($source_file, $dest_file);
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+
+ // Copy image files to live dir (checking if fileexists and renameing if nessessary)
+ // and update corresponding fields in temp record (which gets copied to live automatically)
+ case 'OnBeforeCopyToLive':
+ if ( $object->GetDBField($mode_field) ) { // if image is local
+ // rename file if it exists in live folder
+ $new_file = IMAGES_PATH . $this->ValidateFileName(FULL_PATH.IMAGES_PATH, basename($file));
+ $dest_file = FULL_PATH.$new_file;
+ rename($source_file, $dest_file);
+ }
+ else { // if image is remote url - remove local file (if any), update local file field with empty value
+ if (file_exists($source_file)) @unlink($source_file);
+ $new_file = '';
+ }
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+
+ case 'OnBeforeDeleteFromLive': // Delete image files from live folder before copying over from temp
+ case 'OnBeforeItemDelete': // Delete image files when deleteing Image object
+ @unlink(FULL_PATH.$file);
+ break;
+
+ case 'OnAfterClone': // Copy files when cloning objects, renaming it on the fly
+ $path_info = pathinfo($file);
+ $new_file = $path_info['dirname'].'/'.$this->ValidateFileName(FULL_PATH.$path_info['dirname'], $path_info['basename']);
+ $dest_file = FULL_PATH . $new_file;
+ copy($source_file, $dest_file);
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+ }
+ }
+ if ( in_array($event->Name, Array('OnAfterClone', 'OnBeforeCopyToLive', 'OnAfterCopyToTemp')) ) {
+ $object->Update(null, true);
+ }
+ }
+
+ function ValidateFileName($path, $name)
+ {
+ $parts = pathinfo($name);
+ $ext = '.'.$parts['extension'];
+ $filename = substr($parts['basename'], 0, -strlen($ext));
+ $new_name = $filename.$ext;
+ while ( file_exists($path.'/'.$new_name) )
+ {
+ if ( preg_match("/({$filename}_)([0-9]*)($ext)/", $new_name, $regs) ) {
+ $new_name = $regs[1].($regs[2]+1).$regs[3];
+ }
+ else {
+ $new_name = $filename.'_1'.$ext;
+ }
+ }
+ return $new_name;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnSetPrimary(&$event)
+ {
+ $object =& $event->getObject();
+ $object->SetDBField('DefaultImg', 1);
+ $object->Update();
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+// $parent_info = $object->getLinkedInfo();
+ $id = $object->GetDBField('ResourceId');
+// $id = $parent_info['ParentId'] ? $parent_info['ParentId'] : $this->Application->GetVar('p_id');
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE ResourceId='.$id.' AND DefaultImg=1';
+ if(!$this->Conn->GetOne($sql))
+ {
+ $object->SetDBField('DefaultImg', 1);
+ }
+ if($object->GetDBField('DefaultImg') && $object->Validate())
+ {
+
+ $sql = 'UPDATE '.$object->TableName.'
+ SET DefaultImg = 0
+ WHERE ResourceId = '.$id.' AND ImageId <> '.$object->GetDBField('ImageId');
+ $this->Conn->Query($sql);
+ $object->SetDBField('Enabled', 1);
+ }
+ }
+
+ function OnAfterItemCreate(&$event)
+ {
+ $event->CallSubEvent('OnBeforeItemUpdate');
+ $object =& $event->getObject();
+ $object->Update();
+ }
+
+ /**
+ * Deletes all selected items.
+ * Automatically recurse into sub-items using temp handler, and deletes sub-items
+ * by calling its Delete method if sub-item has AutoDelete set to true in its config file
+ *
+ * @param kEvent $event
+ */
+ function OnMassDelete(&$event)
+ {
+ $event->status=erSUCCESS;
+
+ $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
+
+ $this->StoreSelectedIDs($event);
+
+ $event->setEventParam('ids', $this->getSelectedIDs($event) );
+ $this->customProcessing($event, 'before');
+ $ids = $event->getEventParam('ids');
+
+ $object =& $event->getObject();
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE DefaultImg=1';
+ $primary = $this->Conn->GetOne($sql);
+ if( $primary && ($key = array_search($primary, $ids)) )
+ {
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE DefaultImg=0';
+ $res = $this->Conn->Query($sql);
+ if($res)
+ {
+ unset($ids[$key]);
+ }
+ }
+
+ if($ids)
+ {
+ $temp->DeleteItems($event->Prefix, $event->Special, $ids);
+ }
+ $this->clearSelectedIDs($event);
+ }
+
+ /*function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+
+ if ( $object->GetDBField('ThumbPath') || $object->GetDBField('SameImages') )
+ {
+ // return local image or url
+ $path = $object->GetDBField('LocalThumb') ? PROTOCOL.SERVER_NAME.BASE_PATH.$object->GetDBField('ThumbPath') : $object->GetDBField('ThumbUrl');
+ if ( $object->GetDBField('LocalThumb') && !file_exists(FULL_PATH.$object->GetDBField('ThumbPath')) ) $path = '';
+ }
+ else { // if we need full which is not the same as thumb
+ $path = $object->GetDBField('LocalImage') ? PROTOCOL.SERVER_NAME.BASE_PATH.$object->GetDBField('LocalPath') : $object->GetDBField('Url');
+ if ( $object->GetDBField('LocalImage') && !file_exists(FULL_PATH.$object->GetDBField('LocalPath')) ) $path = '';
+ }
+
+ $object->SetDBField('ImageUrl', $path);
+ }*/
+
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $types=$event->getEventParam('types');
+ $except_types=$event->getEventParam('except');
+ $object =& $event->getObject();
+ $type_clauses = Array();
+
+ if( !$this->Application->IsAdmin() )
+ {
+ $object->addFilter('active', '%1$s.Enabled = 1');
+ }
+
+ if($product_id = $event->getEventParam('product_id'))
+ {
+ $object->removeFilter('parent_filter');
+ $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
+ WHERE ProductId = '.$product_id;
+ $resource_id = (int) $this->Conn->GetOne($sql);
+ $object->addFilter('product_images', '%1$s.ResourceId = '.$resource_id);
+ }
+
+ $type_clauses['additional']['include'] = '%1$s.DefaultImg != 1';
+ $type_clauses['additional']['except'] = '%1$s.DefaultImg = 1';
+ $type_clauses['additional']['having_filter'] = false;
+
+ /********************************************/
+
+ $includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter->setType(FLT_TYPE_AND);
+
+ $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter_h->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter_h->setType(FLT_TYPE_AND);
+
+ $except_types_array=explode(',', $types);
+
+ if ($types){
+ $types_array=explode(',', $types);
+ for ($i=0; $i<sizeof($types_array); $i++){
+ $type=trim($types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $includes_or_filter_h->removeFilter('filter_'.$type);
+ $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }else{
+ $includes_or_filter->removeFilter('filter_'.$type);
+ $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }
+ }
+ }
+ }
+
+ if ($except_types){
+ $except_types_array=explode(',', $except_types);
+ for ($i=0; $i<sizeof($except_types_array); $i++){
+ $type=trim($except_types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $excepts_and_filter_h->removeFilter('filter_'.$type);
+ $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }else{
+ $excepts_and_filter->removeFilter('filter_'.$type);
+ $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }
+ }
+ }
+ }
+
+ $object->addFilter('includes_filter', $includes_or_filter);
+ $object->addFilter('excepts_filter', $excepts_and_filter);
+
+ $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
+ $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/kernel/units/images/image_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/system/cache
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/system/cache (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/system/cache (revision 6786)
Property changes on: branches/unlabeled/unlabeled-1.2.2/system/cache
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,5 ##
+*.*
+proj-*
+core
+in-*
+themes
Index: branches/unlabeled/unlabeled-1.2.2/system
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/system (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/system (revision 6786)
Property changes on: branches/unlabeled/unlabeled-1.2.2/system
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+export
Index: branches/unlabeled/unlabeled-1.2.2/admin/install/upgrades/changelog_1_3_0.txt
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/admin/install/upgrades/changelog_1_3_0.txt (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/admin/install/upgrades/changelog_1_3_0.txt (revision 6786)
@@ -0,0 +1,82 @@
+File in-portal/index.php changed
+File in-portal/admin/advanced_view.php is removed; release_1_2_1 revision 1.25
+File in-portal/admin/browse.php is removed; release_1_2_1 revision 1.35
+File in-portal/admin/install.php changed
+File in-portal/admin/category/addcategory.php is removed; release_1_2_1 revision 1.20
+File in-portal/admin/category/addcategory_custom.php is removed; release_1_2_1 revision 1.14
+File in-portal/admin/category/addcategory_customfields.php is removed; release_1_2_1 revision 1.5
+File in-portal/admin/category/addcategory_images.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addcategory_permissions.php is removed; release_1_2_1 revision 1.11
+File in-portal/admin/category/addcategory_relations.php is removed; release_1_2_1 revision 1.8
+File in-portal/admin/category/addimage.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addpermission.php is removed; release_1_2_1 revision 1.9
+File in-portal/admin/category/addpermission_modules.php is removed; release_1_2_1 revision 1.10
+File in-portal/admin/category/addrelation.php is removed; release_1_2_1 revision 1.8
+File in-portal/admin/category/category_items.php is removed; release_1_2_1 revision 1.4
+File in-portal/admin/category/category_maint.php is removed; release_1_2_1 revision 1.23.32.1
+File in-portal/admin/category/permcacheupdate.php is removed; release_1_2_1 revision 1.10
+File in-portal/admin/category/images/ddarrow.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/images/ddarrow_active.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/images/ddarrow_over.gif is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/core.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/lang.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/category/js/main.js is removed; release_1_2_1 revision 1.1
+File in-portal/admin/help/manual.pdf changed
+File in-portal/admin/install/inportal_data.sql changed
+File in-portal/admin/install/inportal_remove.sql changed
+File in-portal/admin/install/install_lib.php changed
+File in-portal/admin/install/langpacks/english.lang changed
+File in-portal/admin/install/upgrades/changelog_1_3_0.txt is new; release_1_3_0 revision 1.1.2.12
+File in-portal/admin/install/upgrades/inportal_upgrade_v1.3.0.sql is new; release_1_3_0 revision 1.1.2.1
+File in-portal/admin/install/upgrades/readme_1_3_0.txt is new; release_1_3_0 revision 1.1.2.2
+File in-portal/kernel/parser.php changed
+File in-portal/kernel/admin/advanced_view.php is removed; release_1_2_1 revision 1.4
+File in-portal/kernel/admin/include/toolbar/advanced_view.php is removed; release_1_2_1 revision 1.11.2.1
+File in-portal/kernel/admin/include/toolbar/browse.php is removed; release_1_2_1 revision 1.17.2.1
+File in-portal/kernel/admin/include/toolbar/editcategory_permissions.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin/include/toolbar/editcategory_relations.php is removed; release_1_2_1 revision 1.2
+File in-portal/kernel/admin/include/toolbar/editcategory_relationselect.php is removed; release_1_2_1 revision 1.6.2.1
+File in-portal/kernel/admin/include/toolbar/editgroup_permissions.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin/include/toolbar/editgroup_users.php is removed; release_1_2_1 revision 1.1
+File in-portal/kernel/admin_templates/incs/config_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/form_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/grid_blocks.tpl changed
+File in-portal/kernel/admin_templates/incs/script.js changed
+File in-portal/kernel/admin_templates/regional/phrases_edit.tpl changed
+File in-portal/kernel/admin_templates/tools/system_tools.tpl changed
+File in-portal/kernel/include/emailmessage.php changed
+File in-portal/kernel/include/image.php changed
+File in-portal/kernel/include/modules.php changed
+File in-portal/kernel/units/admin/admin_config.php changed
+File in-portal/kernel/units/categories/categories_tag_processor.php changed
+File in-portal/kernel/units/configuration/configuration_event_handler.php changed
+File in-portal/kernel/units/email_events/email_events_event_handler.php changed
+File in-portal/kernel/units/general/cat_event_handler.php changed
+File in-portal/kernel/units/general/cat_tag_processor.php changed
+File in-portal/kernel/units/general/inp_ses_storage.php changed
+File in-portal/kernel/units/general/main_event_handler.php changed
+File in-portal/kernel/units/general/helpers/mod_rewrite_helper.php changed
+File in-portal/kernel/units/general/helpers/permissions_helper.php changed
+File in-portal/kernel/units/users/users_event_handler.php changed
+File in-portal/themes/default/search_results.tpl changed
+File in-portal/themes/default/common/head.tpl changed
+File in-portal/themes/default/common/pagetop.tpl changed
+File kernel4_dev/kernel4/application.php changed
+File kernel4_dev/kernel4/event_manager.php changed
+File kernel4_dev/kernel4/startup.php changed
+File kernel4_dev/kernel4/db/db_event_handler.php changed
+File kernel4_dev/kernel4/db/db_tag_processor.php changed
+File kernel4_dev/kernel4/db/dblist.php changed
+File kernel4_dev/kernel4/parser/template_parser.php changed
+File kernel4_dev/kernel4/processors/main_processor.php changed
+File kernel4_dev/kernel4/session/session.php changed
+File kernel4_dev/kernel4/utility/debugger.php changed
+File kernel4_dev/kernel4/utility/email.php changed
+File kernel4_dev/kernel4/utility/formatters/password_formatter.php changed
+File cmseditor/fckeditor.js changed
+File cmseditor/editor/filemanager/browser/default/connectors/php/commands.php changed
+
+
+Changes in phrases and events:
+
+
Property changes on: branches/unlabeled/unlabeled-1.2.2/admin/install/upgrades/changelog_1_3_0.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/units/groups/groups_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/units/groups/groups_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/units/groups/groups_event_handler.php (revision 6786)
@@ -0,0 +1,19 @@
+<?php
+
+ class GroupsEventHandler extends kDBEventHandler {
+
+ /**
+ * Adds grouping by userid
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($event->Special == 'total') {
+ $object =& $event->getObject();
+ $object->AddGroupByField('%1$s.GroupId');
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/units/groups/groups_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/units/custom_data/custom_data_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/units/custom_data/custom_data_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/units/custom_data/custom_data_event_handler.php (revision 6786)
@@ -0,0 +1,7 @@
+<?php
+
+ class CustomDataEventHandler extends kDBEventHandler {
+
+
+ }
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/units/custom_data/custom_data_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/units/images/image_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/units/images/image_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/units/images/image_event_handler.php (revision 6786)
@@ -0,0 +1,336 @@
+<?php
+class ImageEventHandler extends kDBEventHandler {
+
+ function mapEvents()
+ {
+ parent::mapEvents(); // ensure auto-adding of approve/decine and so on events
+ $image_events = Array(
+ 'OnAfterCopyToTemp'=>'ImageAction',
+ 'OnBeforeDeleteFromLive'=>'ImageAction',
+ 'OnBeforeCopyToLive'=>'ImageAction',
+ 'OnBeforeItemDelete'=>'ImageAction',
+ 'OnAfterClone'=>'ImageAction',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $image_events);
+ }
+
+ function customProcessing(&$event, $type)
+ {
+ $object =& $event->GetObject();
+ switch ($type)
+ {
+ case 'before' :
+ if ($object->GetDBField('LocalImage'))
+ {
+ $object->SetDBField('Url', '');
+ }
+ else
+ {
+ $object->SetDBField('LocalPath', '');
+ }
+
+ if ($object->GetDBField('LocalThumb'))
+ {
+ $object->SetDBField('ThumbUrl', '');
+ }
+ else
+ {
+ $object->SetDBField('ThumbPath', '');
+ }
+
+ if ($object->GetDBField('SameImages'))
+ {
+ $object->SetDBField('LocalImage', 1);
+ $object->SetDBField('LocalPath', '');
+ $object->SetDBField('Url', '');
+ }
+ break;
+ case 'after' :
+ if ($object->GetDBField('DefaultImg') )
+ {
+ $sql = 'UPDATE '.$object->TableName.' SET DefaultImg=0 WHERE ResourceId='.
+ $object->GetDBField('ResourceId').' AND ImageId<>'.
+ $object->GetId();
+ $res = $this->Conn->Query($sql);
+ }
+ break;
+ default:
+ }
+ }
+
+ function ImageAction(&$event)
+ {
+ $id = $event->getEventParam('id');
+ $object =& $this->Application->recallObject($event->Prefix.'.-item', $event->Prefix);
+ if (in_array($event->Name, Array('OnBeforeDeleteFromLive','OnAfterClone')) ) {
+ $object->SwitchToLive();
+ }
+ elseif ($event->Name == 'OnBeforeItemDelete') {
+ // keep current table
+ }
+ else {
+ $object->SwitchToTemp();
+ }
+
+ $object->Load($id);
+
+ $fields = Array('LocalPath' => 'LocalImage', 'ThumbPath' => 'LocalThumb');
+ foreach ($fields as $a_field => $mode_field) {
+ $file = $object->GetField($a_field);
+ if (!$file) continue;
+ $source_file = FULL_PATH.$file;
+
+ switch ($event->Name) {
+ // Copy image files to pending dir and update corresponding fields in temp record
+ // Checking for existing files and renaming if nessessary - two users may upload same pending files at the same time!
+ case 'OnAfterCopyToTemp':
+ $new_file = IMAGES_PENDING_PATH . $this->ValidateFileName(FULL_PATH.IMAGES_PENDING_PATH, basename($file));
+ $dest_file = FULL_PATH.$new_file;
+ copy($source_file, $dest_file);
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+
+ // Copy image files to live dir (checking if fileexists and renameing if nessessary)
+ // and update corresponding fields in temp record (which gets copied to live automatically)
+ case 'OnBeforeCopyToLive':
+ if ( $object->GetDBField($mode_field) ) { // if image is local
+ // rename file if it exists in live folder
+ $new_file = IMAGES_PATH . $this->ValidateFileName(FULL_PATH.IMAGES_PATH, basename($file));
+ $dest_file = FULL_PATH.$new_file;
+ rename($source_file, $dest_file);
+ }
+ else { // if image is remote url - remove local file (if any), update local file field with empty value
+ if (file_exists($source_file)) @unlink($source_file);
+ $new_file = '';
+ }
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+
+ case 'OnBeforeDeleteFromLive': // Delete image files from live folder before copying over from temp
+ case 'OnBeforeItemDelete': // Delete image files when deleteing Image object
+ @unlink(FULL_PATH.$file);
+ break;
+
+ case 'OnAfterClone': // Copy files when cloning objects, renaming it on the fly
+ $path_info = pathinfo($file);
+ $new_file = $path_info['dirname'].'/'.$this->ValidateFileName(FULL_PATH.$path_info['dirname'], $path_info['basename']);
+ $dest_file = FULL_PATH . $new_file;
+ copy($source_file, $dest_file);
+ $object->Fields[$a_field]['skip_empty'] = false;
+ $object->SetDBField($a_field, $new_file);
+ break;
+ }
+ }
+ if ( in_array($event->Name, Array('OnAfterClone', 'OnBeforeCopyToLive', 'OnAfterCopyToTemp')) ) {
+ $object->Update(null, true);
+ }
+ }
+
+ function ValidateFileName($path, $name)
+ {
+ $parts = pathinfo($name);
+ $ext = '.'.$parts['extension'];
+ $filename = substr($parts['basename'], 0, -strlen($ext));
+ $new_name = $filename.$ext;
+ while ( file_exists($path.'/'.$new_name) )
+ {
+ if ( preg_match("/({$filename}_)([0-9]*)($ext)/", $new_name, $regs) ) {
+ $new_name = $regs[1].($regs[2]+1).$regs[3];
+ }
+ else {
+ $new_name = $filename.'_1'.$ext;
+ }
+ }
+ return $new_name;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnSetPrimary(&$event)
+ {
+ $object =& $event->getObject();
+ $object->SetDBField('DefaultImg', 1);
+ $object->Update();
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+// $parent_info = $object->getLinkedInfo();
+ $id = $object->GetDBField('ResourceId');
+// $id = $parent_info['ParentId'] ? $parent_info['ParentId'] : $this->Application->GetVar('p_id');
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE ResourceId='.$id.' AND DefaultImg=1';
+ if(!$this->Conn->GetOne($sql))
+ {
+ $object->SetDBField('DefaultImg', 1);
+ }
+ if($object->GetDBField('DefaultImg') && $object->Validate())
+ {
+
+ $sql = 'UPDATE '.$object->TableName.'
+ SET DefaultImg = 0
+ WHERE ResourceId = '.$id.' AND ImageId <> '.$object->GetDBField('ImageId');
+ $this->Conn->Query($sql);
+ $object->SetDBField('Enabled', 1);
+ }
+ }
+
+ function OnAfterItemCreate(&$event)
+ {
+ $event->CallSubEvent('OnBeforeItemUpdate');
+ $object =& $event->getObject();
+ $object->Update();
+ }
+
+ /**
+ * Deletes all selected items.
+ * Automatically recurse into sub-items using temp handler, and deletes sub-items
+ * by calling its Delete method if sub-item has AutoDelete set to true in its config file
+ *
+ * @param kEvent $event
+ */
+ function OnMassDelete(&$event)
+ {
+ $event->status=erSUCCESS;
+
+ $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
+
+ $this->StoreSelectedIDs($event);
+
+ $event->setEventParam('ids', $this->getSelectedIDs($event) );
+ $this->customProcessing($event, 'before');
+ $ids = $event->getEventParam('ids');
+
+ $object =& $event->getObject();
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE DefaultImg=1';
+ $primary = $this->Conn->GetOne($sql);
+ if( $primary && ($key = array_search($primary, $ids)) )
+ {
+ $sql = 'SELECT ImageId FROM '.$object->TableName.' WHERE DefaultImg=0';
+ $res = $this->Conn->Query($sql);
+ if($res)
+ {
+ unset($ids[$key]);
+ }
+ }
+
+ if($ids)
+ {
+ $temp->DeleteItems($event->Prefix, $event->Special, $ids);
+ }
+ $this->clearSelectedIDs($event);
+ }
+
+ /*function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+
+ if ( $object->GetDBField('ThumbPath') || $object->GetDBField('SameImages') )
+ {
+ // return local image or url
+ $path = $object->GetDBField('LocalThumb') ? PROTOCOL.SERVER_NAME.BASE_PATH.$object->GetDBField('ThumbPath') : $object->GetDBField('ThumbUrl');
+ if ( $object->GetDBField('LocalThumb') && !file_exists(FULL_PATH.$object->GetDBField('ThumbPath')) ) $path = '';
+ }
+ else { // if we need full which is not the same as thumb
+ $path = $object->GetDBField('LocalImage') ? PROTOCOL.SERVER_NAME.BASE_PATH.$object->GetDBField('LocalPath') : $object->GetDBField('Url');
+ if ( $object->GetDBField('LocalImage') && !file_exists(FULL_PATH.$object->GetDBField('LocalPath')) ) $path = '';
+ }
+
+ $object->SetDBField('ImageUrl', $path);
+ }*/
+
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $types=$event->getEventParam('types');
+ $except_types=$event->getEventParam('except');
+ $object =& $event->getObject();
+ $type_clauses = Array();
+
+ if( !$this->Application->IsAdmin() )
+ {
+ $object->addFilter('active', '%1$s.Enabled = 1');
+ }
+
+ if($product_id = $event->getEventParam('product_id'))
+ {
+ $object->removeFilter('parent_filter');
+ $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
+ WHERE ProductId = '.$product_id;
+ $resource_id = (int) $this->Conn->GetOne($sql);
+ $object->addFilter('product_images', '%1$s.ResourceId = '.$resource_id);
+ }
+
+ $type_clauses['additional']['include'] = '%1$s.DefaultImg != 1';
+ $type_clauses['additional']['except'] = '%1$s.DefaultImg = 1';
+ $type_clauses['additional']['having_filter'] = false;
+
+ /********************************************/
+
+ $includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter->setType(FLT_TYPE_AND);
+
+ $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter_h->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter_h->setType(FLT_TYPE_AND);
+
+ $except_types_array=explode(',', $types);
+
+ if ($types){
+ $types_array=explode(',', $types);
+ for ($i=0; $i<sizeof($types_array); $i++){
+ $type=trim($types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $includes_or_filter_h->removeFilter('filter_'.$type);
+ $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }else{
+ $includes_or_filter->removeFilter('filter_'.$type);
+ $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }
+ }
+ }
+ }
+
+ if ($except_types){
+ $except_types_array=explode(',', $except_types);
+ for ($i=0; $i<sizeof($except_types_array); $i++){
+ $type=trim($except_types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $excepts_and_filter_h->removeFilter('filter_'.$type);
+ $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }else{
+ $excepts_and_filter->removeFilter('filter_'.$type);
+ $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }
+ }
+ }
+ }
+
+ $object->addFilter('includes_filter', $includes_or_filter);
+ $object->addFilter('excepts_filter', $excepts_and_filter);
+
+ $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
+ $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/units/images/image_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/head.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/head.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/head.tpl (revision 6786)
@@ -0,0 +1,43 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+
+<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">
+
+ <table cellpadding="0" cellspacing="0" width="100%" border="0">
+ <tr>
+ <td valign="middle">
+ <a href="<inp2:m_t t="sections_list" section="in-portal:root" module="In-Portal" pass="m"/>" target="main"><img title="In-portal" src="img/globe.gif" width="84" height="82" border="0"></a>
+ </td>
+ <td valign="middle">
+ <a href="<inp2:m_t t="sections_list" section="in-portal:root" module="In-Portal" pass="m"/>" target="main"><img title="In-portal" src="img/logo.gif" width="150" height="82" border="0"></a>
+ </td>
+ <td width="100%">
+ </td>
+ <td width="400" valign="top">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <td height="73" valign="top">
+ <img src="img/blocks.gif" width="400" height="73" title="" alt="" /><br />
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" style="background: url(img/version_bg.gif) top right repeat-y;" class="head_version" valign="absmiddle" height="18">
+ <img title="" src="img/spacer.gif" width="1" height="10" align="absmiddle">
+ <inp2:m_phrase name="la_Logged_in_as"/> <b> <inp2:u_LoginName/> </b>
+ <a href="<inp2:m_t t="index" u_event="OnLogout" pass="m,u"/>" target="_parent"><img src="img/blue_bar_logout.gif" height="16" width="16" align="absmiddle" border="0"></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#000000" colspan="4">
+ <img title="" src="img/spacer.gif" width="1" height="1" /><br />
+ </td>
+ </tr>
+ </table>
+
+<inp2:m_include t="incs/footer"/>
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/head.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/sections_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/sections_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/sections_list.tpl (revision 6786)
@@ -0,0 +1,56 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<link rel="stylesheet" rev="stylesheet" href="incs/sections_list.css" type="text/css" />
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_DefineElement name="section_list_header" icon_module="">
+ <!-- section header -->
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: url(<inp2:$SectionPrefix_ModulePath module="#session#"/>img/logo_bg.gif) no-repeat top right;">
+ <td valign="top" class="admintitle" align="left" style="padding-top: 2px; padding-bottom: 2px;">
+ <inp2:m_if check="m_RecallEquals" name="section" value="in-portal:root">
+ <img width="46" height="46" src="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/<inp2:adm_GetSectionIcon icon="icon46_{$icon}"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$label" default="$label"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$label" default="$label"/>
+ <inp2:m_else/>
+ <img width="46" height="46" src="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/<inp2:adm_GetSectionIcon icon="icon46_{$icon}"/>.gif" align="absmiddle" title="<inp2:adm_GetSectionTitle phrase="$label"/>">&nbsp;<inp2:adm_GetSectionTitle phrase="$label"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+
+ <inp2:m_ParseBlock name="blue_bar" prefix="$SectionPrefix" title_preset="tree_#section#" icon="icon46_{$icon}"/>
+</inp2:m_DefineElement>
+
+<inp2:adm_PrintSection section_name="#session#" render_as="section_list_header"/>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="top" width="100%">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_DefineElement name="section_element" icon_module="">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td class="subitem_icon">
+ <img src="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon46_list_<inp2:m_param name="icon"/>.gif" border="0" alt="<inp2:m_phrase name="$label"/>" align="absmiddle"/>
+ </td>
+ <td class="subitem_description">
+ <a href="<inp2:m_param name="section_url"/>" class="dLink" title="<inp2:m_phrase name="$label"/>" target="main"><inp2:m_phrase name="$label"/></a>
+ <inp2:m_if check="m_ParamEquals" name="is_tab" value="1">
+ <inp2:m_phrase name="la_Description_{$parent}"/>
+ <inp2:m_else/>
+ <inp2:m_phrase name="la_Description_{$section_name}"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </inp2:m_DefineElement>
+
+ <inp2:m_set odd_even="table_color1"/>
+ <inp2:adm_PrintSections block="section_element" section_name="#session#"/>
+ </table>
+ </td>
+
+ <td valign="top" align="right">
+ <inp2:adm_ModuleInclude template="summary/#section#"/>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/sections_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/index.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/index.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/index.tpl (revision 6786)
@@ -0,0 +1,55 @@
+<inp2:m_RequireLogin login_template="login"/>
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">-->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=<inp2:lang_GetCharset/>">
+ <title><inp2:m_GetConfig var="Site_Name"/> - <inp2:m_Phrase label="la_AdministrativeConsole"/></title>
+ <inp2:m_base_ref/>
+
+ <link rel="icon" href="img/favicon.ico" type="image/x-icon" />
+ <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" rev="stylesheet" href="incs/style.css" type="text/css" />
+
+ <script type="text/javascript">
+ window.name = 'main_frame';
+ lala = navigator.appVersion.substring(0,1);
+
+ if (navigator.appName == "Netscape") {
+ if (lala != "5") {
+ document.write("<frameset rows='96,*' framespacing='0' scrolling='no' frameborder='0'>");
+ } else {
+ document.write("<frameset rows='95,*' framespacing='0' scrolling='no' frameborder='0'>");
+ }
+ } else {
+ document.write("<frameset rows='94,*' framespacing='0' scrolling='no' frameborder='0'>");
+ }
+
+ function getFrame($name)
+ {
+ var $frameset = window.frames;
+ for ($i = 0; $i < window.length; $i++) {
+ if ($frameset[$i].name == $name) {
+ return $frameset[$i];
+ }
+ }
+ return window;
+ }
+ </script>
+ </head>
+
+ <frame src="<inp2:m_t t="head" pass="m" m_cat_id="0" m_opener="s" no_pass_through="1"/>" name="head" scrolling="no" noresize>
+ <frameset cols="200,*" border="0">
+ <frame src="<inp2:m_t t="tree" pass="m" m_cat_id="0" m_opener="s" no_pass_through="1"/>" name="menu" target="main" noresize scrolling="auto" marginwidth="0" marginheight="0">
+ <inp2:m_DefineElement name="root_node">
+ <frame src="<inp2:m_param name="section_url"/>" name="main" marginwidth="0" marginheight="0" frameborder="no" noresize scrolling="auto">
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="root_node" section_name="in-portal:root"/>
+ </frameset>
+ </frameset>
+ <noframes>
+ <body bgcolor="#FFFFFF">
+ <p></p>
+ </body>
+ </noframes>
+</html>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/index.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/tab_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/tab_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/tab_blocks.tpl (revision 6786)
@@ -0,0 +1,58 @@
+<inp2:m_block name="init_tab"/>
+ <inp2:m_if prefix="m" function="is_active" templ="$t$"/>
+ <inp2:m_set main_prefix="$main_prefix"/>
+ <inp2:m_endif/>
+<inp2:m_blockend/>
+
+<inp2:m_block name="prepare_tab"/>
+ <inp2:m_if prefix="m" function="is_active" templ="$t$"/>
+ <inp2:m_set active="active_" bgcolor="#FFA916" class="tab"/>
+ <inp2:m_else/>
+ <inp2:m_set active="" bgcolor="#009FF0" class="tab2"/>
+ <inp2:m_endif/>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" style="border-top: 1px solid #000000;">
+ <a href="javascript:go_to_tab('<inp2:m_param name="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab_direct" pass="m"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" style="border-top: 1px solid #000000;">
+ <a href="<inp2:m_t t="$t" pass="$pass"/>" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
+
+<inp2:m_block name="tab_list"/>
+ <inp2:m_ParseBlock name="prepare_tab" t="$t"/>
+ <td>
+ <table style="background: <inp2:m_get param="bgcolor"/> url(img/tab_<inp2:m_get param="active"/>back.jpg) no-repeat top left;" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>left.gif" width="15" height="23"></td>
+ <td nowrap align="center" <inp2:m_if check="m_getequals" name="active" value="active_">style="border-top: black 1px solid;"</inp2:m_if> background="img/tab_<inp2:m_get param="active"/>back.gif">
+ <a href="javascript:go_to_list('<inp2:m_get param="main_prefix"/>', '<inp2:m_param name="t"/>')" class="<inp2:m_get param="class"/>" onClick=""><inp2:m_phrase name="$title"/></a><br>
+ </td>
+ <td><img alt="" src="img/tab_<inp2:m_get param="active"/>right.gif" width="15" height="23"></td>
+ </tr>
+ </table>
+ </td>
+<inp2:m_blockend/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/tab_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/style.css
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/style.css (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/style.css (revision 6786)
@@ -0,0 +1,587 @@
+/* --- In-Portal --- */
+
+
+.head_version {
+ font-family: verdana, arial;
+ font-size: 10px;
+ font-weight: normal;
+ color: white;
+ padding-right: 5px;
+ text-decoration: none;
+}
+
+body {
+ font-family: Verdana, Arial, Helvetica, Sans-serif;
+ font-size: 12px;
+ color: #000000;
+ scrollbar-3dlight-color: #333333;
+ scrollbar-arrow-color: #ffffff;
+ scrollbar-track-color: #88d2f8;
+ scrollbar-darkshadow-color: #333333;
+ scrollbar-highlight-color: #009ffd;
+ scrollbar-shadow-color: #009ffd;
+ scrollbar-face-color: #009ffd;
+ overflow-x: auto; overflow-y: auto;
+}
+
+A {
+ color: #006699;
+ text-decoration: none;
+}
+
+A:hover {
+ color: #009ff0;
+ text-decoration: none;
+}
+
+TD {
+ font-family: verdana,helvetica;
+ font-size: 10pt;
+ text-decoration: none;
+}
+
+form {
+ display: inline;
+}
+
+.text {
+ font-family: verdana, arial;
+ font-size: 12px;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.tablenav {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+
+ text-decoration: none;
+ background-color: #73C4F5;
+ background: url(../img/tabnav_back.gif) repeat-x;
+}
+
+.tablenav_link {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+ text-decoration: none;
+}
+
+.header_left_bg {
+ background: url(../img/tabnav_left.gif) no-repeat;
+}
+
+.tablenav_link:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ color: #ffcc00;
+ text-decoration: none;
+}
+
+.tableborder {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+ border-top-width: 0px;
+ border-collapse: collapse;
+}
+
+.tableborder_full, .tableborder_full_kernel {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+}
+
+
+.button {
+ font-family: arial, verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #000000;
+ background: url(../img/button_back.gif) #f9eeae repeat-x;
+ text-decoration: none;
+}
+
+.button-disabled {
+ font-family: arial, verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #676767;
+ background: url(../img/button_back_disabled.gif) #f9eeae repeat-x;
+ text-decoration: none;
+}
+
+.hint_red {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-style: normal;
+ color: #FF0000;
+ /* background-color: #F0F1EB; */
+}
+
+.tree_head {
+ font-family: verdana, arial;
+ font-size: 10px;
+ font-weight: bold;
+ color: #FFFFFF;
+ text-decoration: none;
+}
+
+.admintitle {
+ font-family: verdana, arial;
+ font-size: 20px;
+ font-weight: bold;
+ color: #009FF0;
+ text-decoration: none;
+}
+
+.table_border_notop, .table_border_nobottom {
+ background-color: #F0F1EB;
+ border: 1px solid #000000;
+}
+
+.table_border_notop {
+ border-top-width: 0px;
+}
+
+.table_border_nobottom {
+ border-bottom-width: 0px;
+}
+
+.pagination_bar {
+ background-color: #D7D7D7;
+ border: 1px solid #000000;
+ border-top-width: 0px;
+}
+
+/* Categories */
+
+.priority {
+ color: #FF0000;
+ padding-left: 1px;
+ padding-right: 1px;
+ font-size: 11px;
+}
+
+.cat_no, .cat_desc, .cat_new, .cat_pick, .cats_stats {
+ font-family: arial, verdana, sans-serif;
+}
+
+.cat_no {
+ font-size: 10px;
+ color: #707070;
+}
+
+.cat_desc {
+ font-size: 9pt;
+ color: #000000;
+}
+
+.cat_new {
+ font-size: 12px;
+ vertical-align: super;
+ color: blue;
+}
+
+.cat_pick {
+ font-size: 12px;
+ vertical-align: super;
+ color: #009900;
+}
+
+.cats_stats {
+ font-size: 11px;
+ color: #707070;
+}
+
+/* Links */
+
+.link, .link:hover, .link_desc, .link_detail {
+ font-family: arial, helvetica, sans-serif;
+}
+
+.link {
+ font-size: 9pt;
+ color: #1F569A;
+}
+
+.link:hover {
+ font-size: 9pt;
+ color: #009FF0;
+}
+
+.link_desc {
+ font-size: 9pt;
+ color: #000000;
+}
+
+.link_detail {
+ font-size: 11px;
+ color: #707070;
+}
+
+.link_rate, .link_review, .link_modify, .link_div, .link_new, .link_top, .link_pop, .link_pick {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.link_rate, .link_review, .link_modify, .link_div {
+ text-decoration: none;
+}
+
+.link_rate { color: #006600; }
+.link_review { color: #A27900; }
+.link_modify { color: #800000; }
+.link_div { color: #000000; }
+
+.link_new, .link_top, .link_pop, .link_pick {
+ vertical-align: super;
+}
+
+.link_new { color: #0000FF; }
+.link_top { color: #FF0000; }
+.link_pop { color: FFA500; }
+.link_pick { color: #009900; }
+
+/* ToolBar */
+
+.divider {
+ BACKGROUND-COLOR: #999999
+}
+
+.toolbar {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ border: 1px solid #000000;
+ border-width: 0 1 1 1;
+ background-color: #F0F1EB;
+}
+
+.current_page {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: #C4C4C4;
+ padding-left: 1px;
+ padding-right: 1px;
+}
+
+.nav_url {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ color: #1F569A;
+}
+
+.nav_arrow {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: normal;
+ color: #1F569A;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.nav_current_item {
+ font-family: verdana;
+ font-size: 12px;
+ font-weight: bold;
+ color: #666666;
+}
+
+/* Edit forms */
+
+.hint {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ color: #666666;
+}
+
+.table_color1, .table_color2 {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: normal;
+ color: #000000;
+ text-decoration: none;
+}
+
+.table_color1 { background-color: #F6F6F6; }
+.table_color2 { background-color: #EBEBEB; }
+
+
+.table_white, .table_white_selected {
+ font-family: verdana, arial;
+ font-weight: normal;
+ font-size: 14px;
+ color: #000000;
+ text-decoration: none;
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
+
+.table_white {
+ background-color: #FFFFFF;
+}
+
+.table_white_selected {
+ background-color: #C6D6EF;
+}
+
+.subsectiontitle {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+
+ color: #FFFFFF;
+
+}
+
+.subsectiontitle:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+
+ color: #FFCC00;
+}
+
+.error {
+ font-family: arial, helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 9pt;
+ color: #FF0000;
+}
+
+/* Tabs */
+
+.tab_border {
+ border: 1px solid #000000;
+ border-width: 1 0 0 0;
+}
+
+.tab, .tab:hover {
+ font-family: verdana, arial, helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ color: #000000;
+ text-decoration: none;
+}
+
+.tab2, .tab2:hover {
+ font-family: verdana, arial, helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.tab2 { color: #FFFFFF; }
+.tab2:hover { color: #000000; }
+
+/* Item DIVS */
+
+.selected_div { background-color: #C6D6EF; }
+.notselected_div { background-color: #FFFFFF; }
+
+/* Item tabs */
+
+
+.itemtab_active {
+ background: url("../img/itemtabs/tab_active.gif") #eee repeat-x;
+}
+
+.itemtab_inactive {
+ background: url("../img/itemtabs/tab_inactive.gif") #F9EEAE repeat-x;
+}
+
+
+/* Grids */
+
+.columntitle, .columntitle:hover {
+ font-family: verdana, arial;
+ font-size: 14px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+}
+
+.columntitle { color: #FFFFFF; }
+.columntitle:hover { color: #FFCC00; }
+
+.columntitle_small, .columntitle_small:hover {
+ font-family: verdana, arial;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: #999999;
+ text-decoration: none;
+}
+
+.columntitle_small { color: #FFFFFF; }
+.columntitle_small:hover { color: #FFCC00; }
+
+/* ----------------------------- */
+
+.section_header_bg {
+ background: url(../img/logo_bg.gif) no-repeat top right;
+}
+
+.small {
+ font-size: 9px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+
+/* order preview & preview_print styles */
+
+.order_print_defaults TD,
+.order_preview_header,
+.order_preview_header TD,
+.order_print_preview_header TD,
+.order_preview_field_name,
+.order-totals-name,
+.arial2r,
+.orders_print_flat_table TD {
+ font-family: Arial;
+ font-size: 10pt;
+}
+
+.order_preview_header, .order_preview_header TD, .order_print_preview_header TD {
+ background-color: #C9E9FE;
+ font-weight: bold;
+}
+
+.order_print_preview_header TD {
+ background-color: #FFFFFF;
+}
+
+.order_preview_field_name {
+ font-weight: bold;
+ padding: 2px 4px 2px 4px;
+}
+
+.order-totals-name {
+ font-style: normal;
+}
+
+.border1 {
+ border: 1px solid #111111;
+}
+
+.arial2r {
+ color: #602830;
+ font-weight: bold;
+}
+
+.orders_flat_table, .orders_print_flat_table {
+ border-collapse: collapse;
+ margin: 5px;
+}
+
+.orders_flat_table TD {
+ padding: 2px 5px 2px 5px;
+ border: 1px solid #444444;
+}
+
+.orders_print_flat_table TD {
+ border: 1px solid #000000;
+ padding: 2px 5px 2px 5px;
+}
+
+.help_box {
+ padding: 5px 10px 5px 10px;
+}
+
+.progress_bar
+{
+ background: url(../img/progress_bar_segment.gif);
+}
+
+.grid_id_cell TD {
+ padding-right: 2px;
+}
+
+/*.transparent {
+ filter: alpha(opacity=50);
+ -moz-opacity: .5;
+ opacity: .5;
+}*/
+
+.none_transparent {
+
+}
+
+.subitem_icon {
+ vertical-align: top;
+ padding-top: 0px;
+ text-align: center;
+ width: 28px;
+}
+
+.subitem_description {
+ vertical-align: middle;
+}
+
+.dLink, .dLink:hover {
+ display: block;
+ margin-bottom: 5px;
+ font-family: Verdana;
+ font-size: 13px;
+ font-weight: bold;
+ color: #2C73CB;
+}
+
+.dLink {
+ text-decoration: none;
+}
+
+.dLink:hover {
+ text-decoration: underline;
+}
+
+a.config-header, a.config-header:hover {
+ color: #FFFFFF;
+ font-size: 11px;
+}
+
+.catalog-tab-left {
+ background: url(../img/itemtabs/tab_left.gif) top left no-repeat;
+}
+
+.catalog-tab-middle {
+ background: url(../img/itemtabs/tab_middle.gif) top left repeat-x;
+}
+
+.catalog-tab-right {
+ background: url(../img/itemtabs/tab_right.gif) top right no-repeat;
+}
+
+catalog-tab-separator td {
+ background: #FFFFFF;
+}
+
+.catalog-tab-selected td {
+ background-color: #E0E0DA;
+ cursor: default;
+}
+
+.catalog-tab-unselected td, .catalog-tab-unselected td span {
+ background-color: #F0F1EB;
+ cursor: pointer;
+}
+
+.catalog-tab {
+ display: none;
+ width: 100%;
+}
+
+.progress-text {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ color: #414141;
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/incs/style.css
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js (revision 6786)
@@ -0,0 +1,1043 @@
+if ( !( isset($init_made) && $init_made ) ) {
+ var Grids = new Array();
+ var Toolbars = new Array();
+ var $Menus = new Array();
+ var $ViewMenus = new Array();
+ var $nls_menus = new Array();
+
+ var $form_name = 'kernel_form';
+ if(!$fw_menus) var $fw_menus = new Array();
+
+ var $env = '';
+ var submitted = false;
+ var $edit_mode = false;
+ var $init_made = true; // in case of double inclusion of script.js :)
+
+ // hook processing
+ var hBEFORE = 1; // this is const, but including this twice causes errors
+ var hAFTER = 2; // this is const, but including this twice causes errors
+ var $hooks = new Array();
+}
+
+function getArrayValue()
+{
+ var $value = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length) {
+ $current_key = arguments[$i];
+ if (isset($value[$current_key])) {
+ $value = $value[$current_key];
+ }
+ else {
+ return false;
+ }
+ $i++;
+ }
+ return $value;
+}
+
+function setArrayValue()
+{
+ // first argument - array, other arguments - keys (arrays too), last argument - value
+ var $array = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length - 1) {
+ $current_key = arguments[$i];
+ if (!isset($array[$current_key])) {
+ $array[$current_key] = new Array();
+ }
+ $array = $array[$current_key];
+ $i++;
+ }
+ $array[$array.length] = arguments[arguments.length - 1];
+}
+
+function processHooks($function_name, $hook_type, $prefix_special)
+{
+ var $i = 0;
+ var $local_hooks = getArrayValue($hooks, $function_name, $hook_type);
+
+ while($i < $local_hooks.length) {
+ $local_hooks[$i]($function_name, $prefix_special);
+ $i++;
+ }
+}
+
+function registerHook($function_name, $hook_type, $hook_body)
+{
+ setArrayValue($hooks, $function_name, $hook_type, $hook_body);
+}
+
+function resort_grid($prefix_special, $field, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_Sort1', $field);
+ submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
+}
+
+function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax)
+{
+ if(!isset($field_pos)) $field_pos = 1;
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos,$field);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos+'_Dir',$direction);
+ set_hidden_field($prefix_special+'_SortPos',$field_pos);
+ submit_event($prefix_special,'OnSetSortingDirect', null, null, $ajax);
+}
+
+function reset_sorting($prefix_special)
+{
+ submit_event($prefix_special,'OnResetSorting');
+}
+
+function set_per_page($prefix_special, $per_page, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_PerPage', $per_page);
+ submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
+}
+
+function submit_event(prefix_special, event, t, form_action, $ajax)
+{
+ if ($ajax) {
+ return $Catalog.submit_event(prefix_special, event, t);
+ }
+
+ if (event) {
+ set_hidden_field('events[' + prefix_special + ']', event);
+ }
+ if (t) set_hidden_field('t', t);
+
+ if (form_action) {
+ var old_env = '';
+ if (!form_action.match(/\?/)) {
+ document.getElementById($form_name).action.match(/.*(\?.*)/);
+ old_env = RegExp.$1;
+ }
+ document.getElementById($form_name).action = form_action + old_env;
+ }
+ submit_kernel_form();
+}
+
+function submit_action($url, $action)
+{
+ $form = document.getElementById($form_name);
+ $form.action = $url;
+ set_hidden_field('Action', $action);
+ submit_kernel_form();
+}
+
+function show_form_data()
+{
+ var $kf = document.getElementById($form_name);
+ $ret = '';
+ for(var i in $kf.elements)
+ {
+ $elem = $kf.elements[i];
+ $ret += $elem.id + ' = ' + $elem.value + "\n";
+ }
+ alert($ret);
+}
+
+function submit_kernel_form()
+{
+ if (submitted) {
+ return;
+ }
+ submitted = true;
+
+ var $form = document.getElementById($form_name);
+ processHooks('SubmitKF', hBEFORE);
+ if (typeof $form.onsubmit == "function") {
+ $form.onsubmit();
+ }
+
+ $form.submit();
+ processHooks('SubmitKF', hAFTER);
+ $form.target = '';
+ $form.t.value = t;
+
+ window.setTimeout(function() {submitted = false}, 500);
+}
+
+function set_event(prefix_special, event)
+{
+ var event_field=document.getElementById('events[' + prefix_special + ']');
+ if(isset(event_field))
+ {
+ event_field.value = event;
+ }
+}
+
+function isset(variable)
+{
+ if(variable==null) return false;
+ return (typeof(variable)=='undefined')?false:true;
+}
+
+function in_array(needle, haystack)
+{
+ return array_search(needle, haystack) != -1;
+}
+
+function array_search(needle, haystack)
+{
+ for (var i=0; i<haystack.length; i++)
+ {
+ if (haystack[i] == needle) return i;
+ }
+ return -1;
+}
+
+function print_pre(variable, msg)
+{
+ if (!isset(msg)) msg = '';
+ var s = msg;
+ for (prop in variable) {
+ s += prop+" => "+variable[prop] + "\n";
+ }
+ alert(s);
+}
+
+function go_to_page($prefix_special, $page, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_Page', $page);
+ submit_event($prefix_special, null, null, null, $ajax);
+}
+
+function go_to_list(prefix_special, tab)
+{
+ set_hidden_field(prefix_special+'_GoTab', tab);
+ submit_event(prefix_special,'OnUpdateAndGoToTab',null);
+}
+
+function go_to_tab(prefix_special, tab)
+{
+ set_hidden_field(prefix_special+'_GoTab', tab);
+ submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
+}
+
+function go_to_id(prefix_special, id)
+{
+ set_hidden_field(prefix_special+'_GoId', id);
+ submit_event(prefix_special,'OnPreSaveAndGo')
+}
+
+// in-portal compatibility functions: begin
+function getScriptURL($script_name, tpl)
+{
+ tpl = tpl ? '-'+tpl : '';
+ var $asid = get_hidden_field('sid');
+ return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+tpl+'&en=0';
+}
+
+function OpenEditor(extra_env,TargetForm,TargetField)
+{
+// var $url = getScriptURL('admin/editor/editor_new.php');
+ var $url = getScriptURL('admin/index.php', 'popups/editor');
+// alert($url);
+ $url = $url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'html_edit',800,575);
+}
+
+function OpenUserSelector(extra_env,TargetForm,TargetField)
+{
+ var $url = getScriptURL('admin/users/user_select.php');
+ $url += '&destform='+TargetForm+'&Selector=radio&destfield='+TargetField+'&IdField=Login';
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'user_select',800,575);
+ return false;
+}
+
+function OpenCatSelector(extra_env)
+{
+ var $url = getScriptURL('admin/cat_select.php');
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'catselect',750,400);
+}
+
+function OpenItemSelector(extra_env,$TargetForm)
+{
+ var $url = getScriptURL('admin/relation_select.php') + '&destform='+$TargetForm;
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'groupselect',750,400);
+}
+
+function OpenUserEdit($user_id, $extra_env)
+{
+ var $url = getScriptURL('admin/users/adduser.php') + '&direct_id=' + $user_id;
+ if( isset($extra_env) ) $url += $extra_env;
+ window.location.href = $url;
+}
+
+function OpenLinkEdit($link_id, $extra_env)
+{
+ var $url = getScriptURL('in-link/admin/addlink.php') + '&item=' + $link_id;
+ if( isset($extra_env) ) $url += $extra_env;
+ window.location.href = $url;
+}
+
+function OpenHelp($help_link)
+{
+
+// $help_link.match('http://(.*).lv/in-commerce/admin(.*)');
+// alert(RegExp.$2);
+ openwin($help_link,'HelpPopup',750,400);
+}
+
+function openEmailSend($url, $type, $prefix_special)
+{
+ var $kf = document.getElementById($form_name);
+ var $prev_action = $kf.action;
+ var $prev_opener = get_hidden_field('m_opener');
+
+ $kf.action = $url;
+ set_hidden_field('m_opener', 'p');
+ $kf.target = 'sendmail';
+ set_hidden_field('idtype', 'group');
+ set_hidden_field('idlist', Grids[$prefix_special].GetSelected().join(',') );
+ openwin('','sendmail',750,400);
+ submit_kernel_form();
+
+ $kf.action = $prev_action;
+ set_hidden_field('m_opener', $prev_opener);
+}
+// in-portal compatibility functions: end
+
+function openSelector($prefix, $url, $dst_field, $window_size, $event)
+{
+ var $kf = document.getElementById($form_name);
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+ $regex = $regex.exec($url);
+
+ var $t = $regex[3];
+ var $window_name = 'select_'+$t.replace(/(\/|-)/g, '_');
+ set_hidden_field('return_m', $regex[4]);
+
+ if (!isset($window_size)) $window_size = '750x400';
+
+ $window_size = $window_size.split('x');
+
+ if (!isset($event)) $event = '';
+ processHooks('openSelector', hBEFORE);
+
+ var $prev_action = $kf.action;
+ var $prev_opener = get_hidden_field('m_opener');
+
+ set_hidden_field('m_opener', 'p');
+ set_hidden_field('main_prefix', $prefix);
+ set_hidden_field('dst_field', $dst_field);
+ set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
+
+ openwin('', $window_name, $window_size[0], $window_size[1]);
+ $kf.action = $url;
+ $kf.target = $window_name;
+
+ submit_event($prefix, $event, $t);
+
+ processHooks('openSelector', hAFTER);
+ $kf.action = $prev_action;
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+function InitTranslator(prefix, field, t, multi_line)
+{
+ var $kf = document.getElementById($form_name);
+ var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+
+ $regex = $regex.exec($kf.action);
+ set_hidden_field('return_m', $regex[4]);
+ var $prev_opener = get_hidden_field('m_opener');
+ if (!isset(multi_line)) multi_line = 0;
+ openwin('', $window_name, 750, 400);
+ set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
+ set_hidden_field('m_opener', 'p');
+
+ set_hidden_field('translator_wnd_name', $window_name);
+ set_hidden_field('translator_field', field);
+ set_hidden_field('translator_t', t);
+ set_hidden_field('translator_prefixes', prefix);
+ set_hidden_field('translator_multi_line', multi_line);
+ $kf.target = $window_name;
+
+ return $prev_opener;
+}
+
+function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+
+function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+ set_hidden_field('translator_resource_id', resource_id);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+function openTranslator(prefix,field,url,wnd)
+{
+ var $kf = document.getElementById($form_name);
+
+ set_hidden_field('trans_prefix', prefix);
+ set_hidden_field('trans_field', field);
+ set_hidden_field('events[trans]', 'OnLoad');
+
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
+ var $t = $regex.exec(url)[3];
+ $kf.target = wnd;
+ submit_event(prefix,'',$t,url);
+}
+
+function openwin($url,$name,$width,$height)
+{
+ var $window_params = 'width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
+ return window.open($url,$name,$window_params);
+}
+
+function opener_action(new_action)
+{
+ set_hidden_field('m_opener', new_action);
+}
+
+function std_precreate_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnPreCreate', edit_template)
+}
+
+function std_new_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'OnNew', edit_template)
+}
+
+function std_edit_item(prefix_special, edit_template)
+ {
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnEdit',edit_template)
+}
+
+function std_edit_temp_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'',edit_template)
+}
+
+function std_delete_items(prefix_special, t, $ajax)
+{
+ if (inpConfirm('Are you sure you want to delete selected items?')) {
+ submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
+ }
+}
+
+
+// set current form base on ajax
+function set_form($prefix_special, $ajax)
+{
+ if ($ajax) {
+ $form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
+ }
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function set_hidden_field($field_id, $value)
+{
+ var $kf = document.getElementById($form_name);
+ var $field = $kf.elements[$field_id];
+ if ($field) {
+ $field.value = $value;
+ return true;
+ }
+
+ $field = document.createElement('INPUT');
+ $field.type = 'hidden';
+ $field.name = $field_id;
+ $field.id = $field_id;
+ $field.value = $value;
+
+ $kf.appendChild($field);
+ return false;
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function setInnerHTML($field_id, $value)
+{
+ var $element = document.getElementById($field_id);
+ if (!$element) return false;
+ $element.innerHTML = $value;
+}
+
+function get_hidden_field($field)
+{
+ var $kf = document.getElementById($form_name);
+ return $kf.elements[$field] ? $kf.elements[$field].value : false;
+}
+
+function search($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearch', null, null, $ajax);
+}
+
+function search_reset($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
+}
+
+function search_keydown($event)
+{
+ $event = $event ? $event : event;
+ if ($event.keyCode == 13) {
+ var $prefix_special = this.getAttribute('PrefixSpecial');
+ var $grid = this.getAttribute('Grid');
+ search($prefix_special, $grid, parseInt(this.getAttribute('ajax')));
+ }
+}
+
+function getRealLeft(el)
+{
+ if (typeof(el) == 'string') {
+ el = document.getElementById(el);
+ }
+ xPos = el.offsetLeft;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ xPos += tempEl.offsetLeft;
+ tempEl = tempEl.offsetParent;
+ }
+ // if (obj.x) return obj.x;
+ return xPos;
+}
+
+function getRealTop(el)
+{
+ if (typeof(el) == 'string') {
+ el = document.getElementById(el);
+ }
+ yPos = el.offsetTop;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ yPos += tempEl.offsetTop;
+ tempEl = tempEl.offsetParent;
+ }
+
+// if (obj.y) return obj.y;
+ return yPos;
+}
+
+function show_viewmenu($toolbar, $button_id)
+{
+ var $img = $toolbar.GetButtonImage($button_id);
+ var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
+ var $pos_y = getRealTop($img) + 32;
+
+ var $prefix_special = '';
+ window.triedToWriteMenus = false;
+
+ if($ViewMenus.length == 1)
+ {
+ $prefix_special = $ViewMenus[$ViewMenus.length-1];
+ $fw_menus[$prefix_special+'_view_menu']();
+ $Menus[$prefix_special+'_view_menu'].writeMenus('MenuContainers['+$prefix_special+']');
+ window.FW_showMenu($Menus[$prefix_special+'_view_menu'], $pos_x, $pos_y);
+ }
+ else
+ {
+ // prepare menus
+ for(var $i in $ViewMenus)
+ {
+ $prefix_special = $ViewMenus[$i];
+ $fw_menus[$prefix_special+'_view_menu']();
+ }
+ $Menus['mixed'] = new Menu('ViewMenu_mixed');
+
+ // merge menus into new one
+ for(var $i in $ViewMenus)
+ {
+ $prefix_special = $ViewMenus[$i];
+ $Menus['mixed'].addMenuItem( $Menus[$prefix_special+'_view_menu'] );
+ }
+
+ $Menus['mixed'].writeMenus('MenuContainers[mixed]');
+ window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
+ }
+}
+
+function set_window_title($title)
+{
+ var $window = window;
+ if($window.parent) $window = $window.parent;
+ $window.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
+}
+
+function set_filter($prefix_special, $filter_id, $filter_value, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('filter_id', $filter_id);
+ set_hidden_field('filter_value', $filter_value);
+ submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
+}
+
+function filters_remove_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnRemoveFilters', null, null, $ajax);
+}
+
+function filters_apply_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnApplyFilters', null, null, $ajax);
+}
+
+function RemoveTranslationLink($string, $escaped)
+{
+ if (!isset($escaped)) $escaped = true;
+
+ if ($escaped) {
+ return $string.match(/&lt;a href=&quot;(.*)&quot;&gt;(.*)&lt;\/a&gt;/) ? RegExp.$2 : $string;
+ }
+ else {
+ return $string.match(/<a href="(.*)">(.*)<\/a>/) ? RegExp.$2 : $string;
+ }
+}
+
+function redirect($url)
+{
+ window.location.href = $url;
+}
+
+function update_checkbox_options($cb_mask, $hidden_id)
+{
+ var $kf = document.getElementById($form_name);
+ var $tmp = '';
+ for (var i = 0; i < $kf.elements.length; i++)
+ {
+ if ( $kf.elements[i].id.match($cb_mask) )
+ {
+ if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
+ }
+ }
+ if($tmp.length > 0) $tmp += '|';
+ document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
+}
+
+// related to lists operations (moving)
+
+
+
+ function move_selected($from_list, $to_list)
+ {
+ if (typeof($from_list) != 'object') $from_list = document.getElementById($from_list);
+ if (typeof($to_list) != 'object') $to_list = document.getElementById($to_list);
+
+ if (has_selected_options($from_list))
+ {
+ var $from_array = select_to_array($from_list);
+ var $to_array = select_to_array($to_list);
+ var $new_from = Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $from_array.length; $i++)
+ {
+ $cur = $from_array[$i];
+ if ($cur[2]) // If selected - add to To array
+ {
+ $to_array[$to_array.length] = $cur;
+ }
+ else //Else - keep in new From
+ {
+ $new_from[$new_from.length] = $cur;
+ }
+ }
+
+ $from_list = array_to_select($new_from, $from_list);
+ $to_list = array_to_select($to_array, $to_list);
+ }
+ else
+ {
+ alert('Please select items to perform moving!');
+ }
+ }
+
+ function select_to_array($aSelect)
+ {
+ var $an_array = new Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
+ }
+ return $an_array;
+ }
+
+ function array_to_select($anArray, $aSelect)
+ {
+ var $initial_length = $aSelect.length;
+ for (var $i = $initial_length - 1; $i >= 0; $i--)
+ {
+ $aSelect.options[$i] = null;
+ }
+
+ for (var $i = 0; $i < $anArray.length; $i++)
+ {
+ $cur = $anArray[$i];
+ $aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
+ }
+ }
+
+ function select_compare($a, $b)
+ {
+ if ($a[0] < $b[0])
+ return -1;
+ if ($a[0] > $b[0])
+ return 1;
+ return 0;
+ }
+
+ function select_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $result += $aSelect.options[$i].value + '|';
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function selected_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ if ($cur.selected && $cur.value != '')
+ {
+ $result += $cur.value + '|';
+ }
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function string_to_selected($str, $aSelect)
+ {
+ var $cur = null;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $aSelect.options[$i].selected = $str.match('\\|' + $cur.value + '\\|') ? true : false;
+ }
+ }
+
+ function set_selected($selected_options, $aSelect)
+ {
+ if (!$selected_options.length) return false;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ for (var $k = 0; $k < $selected_options.length; $k++)
+ {
+ if ($aSelect.options[$i].value == $selected_options[$k])
+ {
+ $aSelect.options[$i].selected = true;
+ }
+ }
+ }
+ }
+
+ function get_selected_count($theList)
+ {
+ var $count = 0;
+ var $cur = null;
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $count++;
+ }
+ return $count;
+ }
+
+ function get_selected_index($aSelect, $typeIndex)
+ {
+ var $index = 0;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected)
+ {
+ $index = $i;
+ if ($typeIndex == 'firstSelected') break;
+ }
+ }
+ return $index;
+ }
+
+ function has_selected_options($theList)
+ {
+ var $ret = false;
+ var $cur = null;
+
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $ret = true;
+ }
+ return $ret;
+ }
+
+ function select_sort($aSelect)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ var $to_array = select_to_array($aSelect);
+ $to_array.sort(select_compare);
+ array_to_select($to_array, $aSelect);
+ }
+
+ function move_options_up($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $selected_options = Array();
+ var $first_selected = get_selected_index($aSelect, 'firstSelected');
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected && ($first_selected > 0) )
+ {
+ swap_options($aSelect, $i, $i - $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
+ }
+ else if ($first_selected == 0)
+ {
+ //alert('Begin of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function move_options_down($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $last_selected = get_selected_index($aSelect, 'lastSelected');
+ var $selected_options = Array();
+
+ for (var $i = $aSelect.length - 1; $i >= 0; $i--)
+ {
+ if ($aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0))
+ {
+ swap_options($aSelect, $i, $i + $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
+ }
+ else if ($last_selected + 1 == $aSelect.length)
+ {
+ //alert('End of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function swap_options($aSelect, $src_num, $dst_num)
+ {
+ var $src_html = $aSelect.options[$src_num].innerHTML;
+ var $dst_html = $aSelect.options[$dst_num].innerHTML;
+ var $src_value = $aSelect.options[$src_num].value;
+ var $dst_value = $aSelect.options[$dst_num].value;
+
+ var $src_option = document.createElement('OPTION');
+ var $dst_option = document.createElement('OPTION');
+
+ $aSelect.remove($src_num);
+ $aSelect.options.add($dst_option, $src_num);
+ $dst_option.innerText = $dst_html;
+ $dst_option.value = $dst_value;
+ $dst_option.innerHTML = $dst_html;
+
+ $aSelect.remove($dst_num);
+ $aSelect.options.add($src_option, $dst_num);
+ $src_option.innerText = $src_html;
+ $src_option.value = $src_value;
+ $src_option.innerHTML = $src_html;
+ }
+
+ function getXMLHTTPObject(content_type)
+ {
+ if (!isset(content_type)) content_type = 'text/plain';
+ var http_request = false;
+ if (window.XMLHttpRequest) { // Mozilla, Safari,...
+ http_request = new XMLHttpRequest();
+ if (http_request.overrideMimeType) {
+ http_request.overrideMimeType(content_type);
+ // See note below about this line
+ }
+ } else if (window.ActiveXObject) { // IE
+ try {
+ http_request = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {}
+ }
+ }
+ return http_request;
+ }
+
+ function str_repeat($symbol, $count)
+ {
+ var $i = 0;
+ var $ret = '';
+ while($i < $count) {
+ $ret += $symbol;
+ $i++;
+ }
+ return $ret;
+ }
+
+ function getDocumentFromXML(xml)
+ {
+ if (window.ActiveXObject) {
+ var doc = new ActiveXObject("Microsoft.XMLDOM");
+ doc.async=false;
+ doc.loadXML(xml);
+ }
+ else {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(xml,"text/xml");
+ }
+ return doc;
+ }
+
+
+ function addEvent(el, evname, func) {
+ if (is.ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+ };
+
+ function set_persistant_var($var_name, $var_value, $t, $form_action)
+ {
+ set_hidden_field('field', $var_name);
+ set_hidden_field('value', $var_value);
+ submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
+ }
+
+ /*functionremoveEvent(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+ };*/
+
+ function setCookie($Name, $Value)
+ {
+ // set cookie
+ if(getCookie($Name) != $Value)
+ {
+ document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/';
+ }
+ }
+
+ function getCookie($Name)
+ {
+ // get cookie
+ var $cookieString = document.cookie;
+ var $index = $cookieString.indexOf($Name+'=');
+ if($index == -1) return null;
+
+ $index = $cookieString.indexOf('=',$index)+1;
+ var $endstr = $cookieString.indexOf(';',$index);
+ if($endstr == -1) $endstr = $cookieString.length;
+ return unescape($cookieString.substring($index, $endstr));
+ }
+
+ function deleteCookie($Name)
+ {
+ // deletes cookie
+ if (getCookie($Name))
+ {
+ document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
+ }
+ }
+
+ function addElement($dst_element, $tag_name) {
+ var $new_element = document.createElement($tag_name.toUpperCase());
+ $dst_element.appendChild($new_element);
+ return $new_element;
+ }
+
+ Math.sum = function($array) {
+ var $i = 0;
+ var $total = 0;
+ while ($i < $array.length) {
+ $total += $array[$i];
+ $i++;
+ }
+ return $total;
+ }
+
+ Math.average = function($array) {
+ return Math.sum($array) / $array.length;
+ }
+
+ // remove spaces and underscores from a string, used for nls_menu
+ function rs(str)
+ {
+ return str.replace(/[ _]+/g, '.');
+ }
+
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/tree.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/tree.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/tree.tpl (revision 6786)
@@ -0,0 +1,125 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
+
+<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#DCEBF6">
+
+<script type="text/javascript">
+ function credits(url)
+ {
+ var width = 200;
+ var height = 200;
+ var screen_x = (screen.availWidth-width)/2;
+ var screen_y = (screen.availHeight-height)/2;
+ window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y);
+ }
+</script>
+
+<script src="js/ajax.js"></script>
+<script src="js/tree.js"></script>
+
+<style type="text/css">
+ .tree_head.td, .tree_head, .tree_head:hover {
+ font-weight: bold;
+ font-size: 10px;
+ color: #FFFFFF;
+ font-family: Verdana, Arial;
+ text-decoration: none;
+ }
+
+ .tree {
+ padding: 0px;
+ border: none;
+ border-collapse: collapse;
+ }
+
+ .tree tr td {
+ padding: 0px;
+ margin: 0px;
+ font-family: helvetica, arial, verdana,;
+ font-size: 11px;
+ white-space: nowrap;
+ }
+
+ .tree tr td a {
+ font-size: 11px;
+ color: #000000;
+ font-family: Helvetica, Arial, Verdana;
+ text-decoration: none;
+ }
+
+ .tree tr td a:hover {
+ color: #009FF0;
+ }
+</style>
+
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr style="background: #5291DE url(img/menu_bar.gif) repeat-x left bottom;" class="tree_head">
+ <td align="left" width="80%" height="21">
+ &nbsp;<a class="tree_head" href="javascript:credits('<inp2:m_Link index_file="help/credits.php" destform="popup"/>');">In-Portal v <inp2:adm_ModuleVersion module="In-Portal"/></a>
+ </td>
+ <td align="right" width="20%">
+ <select name="language" style="width: 62px; border: 0px; background-color: #FFFFFF; font-size: 9px; color: black;" onchange="submit_event('lang', 'OnChangeLanguage', 'index');">
+ <inp2:m_DefineElement name="lang_elem">
+ <option value="<inp2:Field name="LanguageId"/>" <inp2:m_if check="SelectedLanguage">selected="selected"</inp2:m_if> ><inp2:Field name="PackName"/></option>
+ </inp2:m_DefineElement>
+ <inp2:lang_ListLanguages render_as="lang_elem" row_start_render_as="html:" row_end_render_as="html:"/>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" style="padding: 5px;">
+ <inp2:m_DefineElement name="xml_node" icon_module="">
+ <inp2:m_if check="m_ParamEquals" param="children_count" value="0">
+ <item href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif"><inp2:m_phrase name="$label" escape="1"/></item>
+ <inp2:m_else/>
+ <folder href="<inp2:m_param name="section_url"/>" onclick="<inp2:m_param name="onclick"/>" name="<inp2:m_phrase name="$label" escape="1"/>" icon="<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" load_url="<inp2:m_param name="late_load"/>"><inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/></folder>
+ </inp2:m_if>
+ </inp2:m_DefineElement>
+
+ <table class="tree">
+ <tbody id="tree">
+ </tbody>
+ </table>
+ <script type="text/javascript">
+ var TREE_ICONS_PATH = 'img/tree'
+
+ <inp2:m_DefineElement name="root_node">
+ var the_tree = new TreeFolder('tree', '<inp2:m_param name="label"/>', '<inp2:m_param name="section_url"/>', '<inp2:$SectionPrefix_ModulePath module="$icon_module"/>img/icons/icon24_<inp2:m_param name="icon"/>.gif');
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="root_node" section_name="in-portal:root"/>
+ the_tree.AddFromXML('<tree><inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root"/></tree>');
+ </script>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
+<script type="text/javascript">
+ // when changing language submit is made to frameset, not the current frame
+ var $kf = document.getElementById($form_name);
+ $kf.target = 'main_frame';
+
+
+ function checkCatalog($cat_id) {
+ var $ret = checkEditMode();
+ var $right_frame = window.parent.getFrame('main');
+ if ($ret && $right_frame.$is_catalog) {
+ $right_frame.$Catalog.go_to_cat($cat_id);
+ return 1; // this opens folder, but disables click
+ }
+ return $ret;
+ }
+
+ function checkEditMode()
+ {
+ var $phrase = "<inp2:adm_TreeEditWarrning label="la_EditingInProgress" escape="1"/>";
+ if (window.parent.getFrame('main').$edit_mode) {
+ return confirm($phrase) ? true : false;
+ }
+
+ return true;
+ }
+</script>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/tree.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/install/incs/install.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/install/incs/install.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/install/incs/install.tpl (revision 6786)
@@ -0,0 +1,153 @@
+<html>
+ <head>
+ <title>In-Portal Installation</title>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+
+ <base href="<?php echo $this->baseURL; ?>"/>
+
+ <link rel="stylesheet" type="text/css" href="incs/style.css" />
+ <script type="text/javascript" src="incs/script.js"></script>
+ </head>
+
+ <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="height: 100%">
+ <form enctype="multipart/form-data" id="install_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
+ <!-- header: begin -->
+ <tr>
+ <td height="90">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
+ <tr>
+ <td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="incs/img/globe.gif" width="84" height="91" border="0" alt="In-Portal"/></a></td>
+ <td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img title="In-portal" src="incs/img/logo.gif" width="150" height="91" border="0" alt="In-Portal"/></a></td>
+ <td rowspan="3" width="100%" align="right">&nbsp;</td>
+ <td width="400"><img title="" src="incs/img/blocks.gif" width="400" height="73" alt="blocks" /></td>
+ </tr>
+ <tr><td align="right" background="incs/img/version_bg.gif" class="head_version" valign="top"><img title="" src="incs/img/spacer.gif" width="1" height="14" alt=""/>In-Portal Version <?php echo $this->GetModuleVersion('In-Portal'); ?>: English US</td></tr>
+ <tr><td><img title="" src="incs/img/blocks2.gif" width="400" height="2" alt="blocks2"/><br /></td></tr>
+ <tr><td bgcolor="black" colspan="4"><img title="" src="incs/img/spacer.gif" width="1" height="1" alt=""/><br /></td></tr>
+ </table>
+ </td>
+ </tr>
+ <!-- header: end -->
+
+
+ <tr height="100%">
+ <td valign="top">
+ <table cellpadding=10 cellspacing=0 border=0 width="100%" height="100%">
+ <tr valign="top">
+ <td style="width: 200px; background: #009ff0 url(incs/img/bg_install_menu.gif) no-repeat bottom right; border-right: 1px solid #000">
+ <img src="incs/img/spacer.gif" width="180" height="1" border="0" alt="" /><br />
+ <span class="admintitle-white">Installation</span>
+
+ <ol class="install-steps">
+ <?php
+ echo $this->PrintSteps('<li class="current-step">%s</li>', '<li>%s</li>');
+ ?>
+ </ol>
+ </td>
+
+
+ <td>
+ <img src="incs/img/icon_install.gif" width="46" height="46" alt="" align="absmiddle" />&nbsp;<span class="admintitle"><?php echo $this->GetStepInfo('step_title'); ?></span><br /><br />
+
+ <!-- section header: begin -->
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
+ <tr>
+ <td class="tablenav" width="580" nowrap background="incs/img/tabnav_left.jpg">
+ <span class="tablenav_link"><?php echo 'Step '.$this->GetStepNumber().' - '.$this->GetStepInfo('step_title'); ?></span>
+ </td>
+ <td align="right" class="tablenav" background="incs/img/tabnav_back.jpg" width="100%">
+ <a class="link" onclick="ShowHelp('in-portal:install');">
+ <img src="incs/img/blue_bar_help.gif" border="0">
+ </a>
+ </td>
+ </tr>
+ </table>
+ <!-- section header: end -->
+
+ <!-- toolbar: begin -->
+ <table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
+ <tr>
+ <td>
+ <a href="javascript:continue_install();">
+ <img border="0" src="incs/img/toolbar/tool_select.gif" id="img_Save" width="32" height="32" border="0" alt="Save" onmouseout="swap_image('img_Save', 'toolbar/tool_select.gif');" onmouseover="swap_image('img_Save','toolbar/tool_select_f2.gif');" /><br />
+ </a>
+ </td>
+ <td>
+ <img src="incs/img/toolbar/tool_cancel.gif" id="img_Cancel" width="32" height="32" border="0" alt="Cancel" onmouseout="swap_image('img_Cancel', 'toolbar/tool_cancel.gif');" onmouseover="swap_image('img_Cancel','toolbar/tool_cancel_f2.gif');" onclick="history.go(-1);" /><br />
+ </td>
+ <td width="100%">&nbsp;</td>
+ </tr>
+ </table>
+ <!-- toolbar: end -->
+
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
+ <tr valign="top">
+ <td width="60%" bgcolor="#F0F0F0">
+ <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
+
+ <!-- step body: begin -->
+ <?php echo $this->GetStepBody(); ?>
+ <!-- step body: end -->
+
+ <!-- step error message: begin -->
+ <tr class="table_color2">
+ <td colspan="2">
+ <p class="error">
+ <?php echo $this->errorMessage; ?>
+ </p>
+ <br/>
+ </td>
+ </tr>
+ <!-- step error message: end -->
+
+ <!-- next, prev buttons: begin -->
+ <tr>
+ <td colspan="2">
+ <br />
+ <input type="submit" name="submit_form" value="Continue" class="button" />
+
+ <?php
+ if ($this->GetStepNumber() > 1 && $this->GetNextStep() != -1) {
+ echo '<input type="reset" name="cancel" value="Cancel" class="button" onclick="history.go(-1);" />';
+ }
+ ?>
+
+ <input type="hidden" name="step" value="<?php echo $this->currentStep; ?>"/>
+ <input type="hidden" name="preset" value="<?php echo $this->stepsPreset; ?>"/>
+ </td>
+ </tr>
+ <!-- next, prev buttons: end -->
+ </table>
+ </td>
+
+ <td width="40%" style="border-left: 1px solid #000; background: #f0f0f0">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <tr>
+ <td class="subsectiontitle" style="border-bottom: 1px solid #000000; background-color: #999"><?php echo $this->GetStepInfo('help_title'); ?></td>
+ </tr>
+ <tr>
+ <td class="text"><?php echo $this->GetStepInfo('help_body'); ?></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <br />
+ </td>
+ </tr>
+
+ <tr>
+ <td class="footer">
+ Powered by In-portal &copy; 1997-<?php echo date('Y'); ?>, Intechnic Corporation. All rights reserved.
+ <br /><img src="incs/img/spacer.gif" width="1" height="10" alt="" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </body>
+</html>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/install/incs/install.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.2.2/core/install/steps_db.xml
===================================================================
--- branches/unlabeled/unlabeled-1.2.2/core/install/steps_db.xml (nonexistent)
+++ branches/unlabeled/unlabeled-1.2.2/core/install/steps_db.xml (revision 6786)
@@ -0,0 +1,43 @@
+<steps>
+ <step name="db_config" title="Database Configuration">
+ <![CDATA[Host name (<i>normally "localhost"</i>), Database user name, and database Password.
+ These fields are required to connect to the database.</p><p>If you would like In-Portal
+ to use a table prefix, enter it in the field provided. This prefix can be any
+ text which can be used in the names of tables on your system. The characters entered in this field
+ are placed <i>before</i> the names of the tables used by In-Portal. For example, if you enter "inp_"
+ into the prefix field, the table named Category will be named inp_Category.</p>]]>
+ </step>
+ <step name="root_password" title="Set Root Password" help_title="Set Admin Root Password">
+ <![CDATA[<p>The Root Password is initially required to access the admin sections of In-Portal.
+ The root user cannot be used to access the front-end of the system, so it is recommended that you
+ create additional users with admin privlidges.</p>]]>
+ </step>
+ <step name="choose_modules" title="Select Modules to Install">
+ <![CDATA[<p>Select the In-Portal modules you wish to install. The modules listed to the right
+ are all modules included in this installation that are licensed to run on this server. </p>]]>
+ </step>
+ <step name="check_paths" title="Filesystem Check">
+ <![CDATA[<b>Write</b><br />Shows folder and files, that write permissions should be adjusted
+ to allow web server to write data into them.]]>
+ </step>
+ <step name="finish" title="Installation Complete" help_title="Thank You!">
+ <![CDATA[<p>Thanks for using In-Portal! Be sure to visit <a target="_new" href="http://www.in-portal.net">www.in-portal.net</a>
+ for the latest news, module releases and support. </p>
+ <p>*Make sure to clean your browser' cache after upgrading In-portal version</p>]]>
+ </step>
+ <step name="install_setup" title="Installation Maintenance">
+ <![CDATA[<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed.
+ In order to work with the maintenance functions provided to the left you must provide the Intechnic
+ Username and Password you used when obtaining the license file residing on the server, or your admin Root password.
+ <i>(Use Username 'root' if using your root password)</i></p>
+ <p>To removing your existing database and start with a fresh installation, select the first option
+ provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.</p>
+ <p>If you wish to scrap your current installation and install to a new location, choose the second option.
+ If this option is selected you will be prompted for new database configuration information.</p>
+ <p>The <i>Update License Information</i> option is used to update your In-Portal license data. Select this option if you have
+ modified your licensing status with Intechnic, or you have received new license data via email</p>
+ <p>The <i>Fix Paths</i> option should be used when the location of the In-portal files has changed.
+ For example, if you moved them from one folder to another. It will update all settings and ensure the
+ program is operational at the new location.</p>]]>
+ </step>
+</steps>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.2.2/core/install/steps_db.xml
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.2
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline