Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1110473
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Aug 27, 2:33 PM
Size
3 KB
Mime Type
text/x-diff
Expires
Fri, Aug 29, 2:33 PM (8 h, 4 m)
Engine
blob
Format
Raw Data
Handle
716945
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.1.2/admin/install_over_kx.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/admin/install_over_kx.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/admin/install_over_kx.php (revision 6944)
@@ -0,0 +1,80 @@
+<?php
+
+ $MODULE_NAME = 'in-commerce';
+
+ // new startup: begin
+ if (!defined('REL_PATH'))
+ {
+ define('REL_PATH', defined('IS_INSTALL') && IS_INSTALL ? 'admin' : 'in-commerce/admin');
+ $relation_level = count( explode('/', REL_PATH) );
+ define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+ }
+ if (!defined('IS_INSTALL')) define('IS_INSTALL', 1);
+ require_once FULL_PATH.'/kernel/startup.php';
+ // new startup: end
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ require_once FULL_PATH.'/admin/install/install_lib.php';
+
+ // create module category
+ $ml_formatter =& $application->recallObject('kMultiLanguage');
+ $name_field = $ml_formatter->LangFieldName('Name');
+ $description_field = $ml_formatter->LangFieldName('Description');
+
+ $cat =& $application->recallObject('c', null, Array('skip_autoload' => true));
+ $cat->Clear();
+ $cat_fields = Array($name_field => 'Products', 'AutomaticFilename' => 1, 'Filename' => 'Products',
+ $description_field => 'Product Catalog', 'Status' => 1, 'ParentId' => 0,
+ 'CategoryTemplate' => 'in-commerce/store/category', 'CachedCategoryTemplate' => 'in-commerce/store/category');
+ $cat->SetDBFieldsFromHash($cat_fields);
+ $cat->Create();
+
+ $cat_id = $cat->GetID();
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_schema.sql';
+ if( file_exists($filename) ) RunSchemaFile($application->Conn, $filename, 'dbconnection');
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_data.sql';
+ if( file_exists($filename) )
+ {
+ $sql = file($filename);
+ for($x = 0; $x < count($sql); $x++)
+ {
+ $sql[$x] = str_replace('{ProductCatId}', $cat_id, $sql[$x]);
+ }
+ RunSQLText($application->Conn, $sql,'dbconnection');
+
+ if (!(isset($ini_file) && $ini_file)) {
+ $ini_file = FULL_PATH.'/config.php';
+ $ini_vars = inst_parse_portal_ini($ini_file, true);
+ }
+
+ $sql = 'SELECT Version FROM '.TABLE_PREFIX.'Modules WHERE Name = '.$application->Conn->qstr('In-Commerce');
+ $mod_version = $application->Conn->GetOne($sql);
+ set_ini_value('Module Versions', 'In-Commerce', $mod_version);
+ save_values();
+ }
+
+ linkCustomFields($MODULE_NAME, 'p', 11);
+
+ linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+ $cat->defineFields();
+ $application->removeObject('c-cdata');
+ $cat->SetDBField('cust_p_ItemTemplate', 'in-commerce/product/details');
+ $cat->Update();
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE (VarName = "config_files") OR (VarName LIKE "%_parsed")';
+ $application->Conn->Query($sql);
+
+ $sql = 'UPDATE '.TABLE_PREFIX.'Modules SET RootCat = '.$cat_id.' WHERE Name = '.$application->Conn->qstr('In-Commerce');
+ $application->Conn->Query($sql);
+
+ $inp_cat =& $objCatList->GetCategory($cat_id);
+ $inp_cat->UpdateCachedPath();
+ $inp_cat->UpdateACL();
+
+ finalizeModuleInstall($MODULE_NAME);
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/admin/install_over_kx.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment