Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 11:10 PM

in-portal

Index: branches/unlabeled/unlabeled-1.3.4/admin/modules/addmodule.php
===================================================================
--- branches/unlabeled/unlabeled-1.3.4/admin/modules/addmodule.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.4/admin/modules/addmodule.php (revision 554)
@@ -0,0 +1,226 @@
+<?php
+##############################################################
+##In-portal ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law. ##
+##############################################################
+if(!strlen($pathtoroot))
+{
+ $path=dirname(realpath(__FILE__));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+
+$sub = substr($pathtoroot,strlen($pathchar)*-1);
+if($sub!=$pathchar)
+{
+ $pathtoroot = $pathtoroot.$pathchar;
+}
+//echo $pathtoroot;
+
+require_once($pathtoroot."kernel/startup.php");
+
+$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+
+$localURL=$rootURL."kernel/";
+$adminURL=$rootURL.$admin;
+$imagesURL = $adminURL."/images";
+
+//admin only util
+
+$pathtolocal = $pathtoroot."kernel/";
+
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+require_once($pathtoroot.$admin."/listview/listview.php");
+
+$pathtolocal = $pathtoroot;
+
+//Set Section
+$section = 'in-portal:addmodule';
+
+//Set Environment Variable
+$envar = "env=" . BuildEnv();
+
+//Display header
+
+
+$order = $objConfig->Get("Module_SortOrder");
+
+$orderBy = trim($objConfig->Get("Module_SortField")." ".$order);
+if(strlen($orderBy))
+{
+ $orderBy = " ORDER BY LoadOrder,".$orderBy;
+}
+else
+ $orderBy = " ORDER BY LoadOrder";
+
+
+
+$objModules->Clear();
+$sql = "SELECT * FROM ".GetTablePrefix()."Modules";
+
+$objModules->Query_Item($sql);
+
+$objModList = new clsModList();
+
+$path = $pathtoroot;
+
+$new = array();
+if ($dir = @opendir($path))
+{
+ while (($file = readdir($dir)) !== false)
+ {
+ if($file !="." && $file !=".." && substr($file,0,1)!="_")
+ {
+ if(is_dir($path.$pathchar.$file))
+ {
+ $inst_file = $path.$pathchar.$file.$pathchar.$admin."/install.php";
+ if(file_exists($inst_file))
+ {
+ if(!$objModules->ModuleInstalled($file))
+ {
+ $new[$file] = $inst_file;
+ }
+ }
+ }
+ }
+ }
+ closedir($dir);
+}
+
+
+foreach($new as $mod => $file)
+{
+ $m = new clsModule();
+
+ unset($data);
+ $data = array();
+ $status= admin_language("la_text_ready_to_install");
+
+ $mod_tmp_name_arr = explode('-', $mod);
+
+ $mod_tmp_name = '';
+ foreach ($mod_tmp_name_arr as $names) {
+ $mod_tmp_name .= ucfirst($names)."-";
+ }
+
+ $mod_tmp_name = substr($mod_tmp_name, 0, strlen($mod_tmp_name) - 1);
+
+ if (_ModuleLicensed($mod_tmp_name)) {
+ $data["Url"] = "<A HREF=\"".$rootURL.$mod."/admin/install.php?env=".BuildEnv()."&redirect=1\">$status</A>";
+ }
+ else {
+ $data["Url"] = '<a href="'.$rootURL.'admin/modules/upgrade_lic.php?env='.BuildEnv().'"><font color="#FF0000">'.admin_language("la_module_not_licensed").'</font></a>';
+ }
+
+ $data["Name"] = $mod_tmp_name;
+ $objModList->AddItemFromArray($data);
+}
+
+$itemcount = $objModList->NumItems();
+
+$title = admin_language("la_Text_Install")." ".admin_language("la_Text_Modules")." (".$itemcount.")";
+
+$objListView = new clsListView(NULL,$objModList);
+$objListView->IdField = "Name";
+$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl";
+
+$objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Available_Modules"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Name");
+$objListView->ColumnHeaders->Add("Url",admin_language("la_prompt_Install_Status"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Version");
+
+$objListView->ColumnHeaders->SetSort("Name",$order);
+
+$objListView->PrintToolBar = FALSE;
+$objListView->SearchBar = FALSE;
+$objListView->checkboxes= FALSE;
+$objListView->SearchAction="";
+$objListView->CurrentPageVar = "Page_Modules";
+$objListView->PerPageVar = "Perpage_Modules";
+$objListView->CheckboxName = "";
+$objListView->TotalItemCount = $itemcount;
+$objListView->SelectorType="none";
+
+int_header(null,NULL,$title);
+?>
+<FORM method="POST" ACTION="" NAME="modlistform" ID="modlistform">
+<?php
+ $objListView->PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */
+ $objListView->SliceItems();
+ print $objListView->PrintList();
+?>
+<input type="hidden" name="Action" value="">
+</FORM>
+<!-- CODE FOR VIEW MENU -->
+<form method="post" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>" name="viewmenu">
+<input type="hidden" name="fieldname" value="">
+<input type="hidden" name="varvalue" value="">
+<input type="hidden" name="varvalue2" value="">
+<input type="hidden" name="Action" value="">
+</form>
+<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
+<script>
+initSelectiorContainers()
+</script>
+
+<!-- END CODE-->
+<?php int_footer(); ?>
Property changes on: branches/unlabeled/unlabeled-1.3.4/admin/modules/addmodule.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline