Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773001
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
Sat, Feb 1, 11:42 PM
Size
14 KB
Mime Type
text/x-diff
Expires
Mon, Feb 3, 11:42 PM (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
556270
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/config/edit_label.php
===================================================================
--- trunk/admin/config/edit_label.php (revision 516)
+++ trunk/admin/config/edit_label.php (revision 517)
@@ -1,328 +1,337 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
-## ##
-## No portion of this code may be copied, reproduced or ##
+## ##
+## 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)
+ $path=dirname(realpath(__FILE__));
+ if(strlen($path))
{
- $p = $parent;
+ /* 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
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
+ {
+ $pathtoroot = ".".$pathchar;
+ }
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
- $pathtoroot = $pathtoroot.$pathchar;
+ $pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
//admin only util
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
- $admin = "admin";
+$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
-$imagesURL = $adminURL."/images";
+$imagesURL = $adminURL."/images";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
if(count($_POST)>0 && !$_GET['PhraseId'] && $add_error == '')
{
echo "<SCRIPT language=\"JavaScript\">\n";
echo " if(window.opener) window.opener.location=window.opener.location;\n";
- echo " window.close();";
+ echo " window.close();";
echo "</SCRIPT>";
die();
}
$section = "in-portal:phrase_editor";
-$ids = $_GET["PhraseId"];
+$ids = GetVar('PhraseId');
if(strlen($ids))
{
- $ids = str_replace("[","",$ids);
- $ids = str_replace("]","",$ids);
- $ids = str_replace("\"","",$ids);
- $ids = str_replace("\\","",$ids);
- $PhraseIds = explode(",",$ids);
+ $ids = str_replace("[","",$ids);
+ $ids = str_replace("]","",$ids);
+ $ids = str_replace("\"","",$ids);
+ $ids = str_replace("\\","",$ids);
+ $PhraseIds = explode(",",$ids);
+ $LangId = 0;
}
else
{
- $LangId = $_GET["LanguageId"];
+ $LangId = GetVar('LanguageId');
+ $PhraseIds = Array();
}
-$EditDirect = (int)$_GET["direct"];
+$EditDirect = (int)GetVar('direct');
if($EditDirect)
{
- $NewLabel = $_GET["label"];
- if(!$LangId)
- {
- $LangId = $objSession->Get("Language");
- }
+ $NewLabel = GetVar('label');
+ if(!$LangId)
+ {
+ $LangId = $objSession->Get("Language");
+ }
+ SetVar( 'name', Array($NewLabel) );
+}
+else
+{
+ $NewLabel = '';
}
unset($objEditItems);
if (count($PhraseIds) > 1) {
$print_list = true;
}
else {
$ado = GetADODBConnection();
$sql = "SELECT PhraseId FROM ".$objSession->GetEditTable("Phrase");
-
+
if ($LangId) {
$sql .= " WHERE LanguageId = $LangId";
}
-
+
$rs = $ado->Execute($sql);
-
- if (!$_GET['en']) {
- $selected_id = $PhraseIds[0];
- }
- else {
- $selected_id = $_GET['PhraseId'];
- }
-
+
+ $selected_id = !GetVar('en') ? $PhraseIds[0] : $_GET['PhraseId'];
+
$PhraseIdList = '';
while ($rs && !$rs->EOF) {
$PhraseIdList .= $rs->fields['PhraseId'].",";
$rs->MoveNext();
}
-
- $PhraseIdList = substr($PhraseIdList, 0, strlen($PhraseIdList));
+
+ $PhraseIdList = substr($PhraseIdList, 0, strlen($PhraseIdList));
$PhraseIdArr = explode(",", $PhraseIdList);
-
+
$print_list = false;
}
$envar = "env=".BuildEnv();
$formaction = $_SERVER["PHP_SELF"]."?".$envar;
$sec = $objSections->GetSection($section);
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","ThemeChecks");
-
+
$objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
- "swap('select', 'toolbar/tool_select.gif');",
- "LangSubmit();",
- "tool_select.gif");
+"swap('select', 'toolbar/tool_select.gif');",
+"LangSubmit();",
+"tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
- "swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
+"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
if (!$print_list) {
$x = -1;
foreach ($PhraseIdArr as $key => $value) {
if ($value == $selected_id) {
$x = $key;
}
- }
+ }
if ($x <= 0) {
$en_next = $PhraseIdArr[$x+1];
$en_prev = false;
}
else if ($x >= count($PhraseIdArr) - 1) {
$en_next = false;
$en_prev = $PhraseIdArr[$x - 1];
}
else {
$en_next = $PhraseIdArr[$x+1];
$en_prev = $PhraseIdArr[$x-1];
}
-
-
- $url = "edit_label.php?$envar&en=0";
+
+
+ $url = "edit_label.php?$envar&en=0";
$form = "frmPhrase";
- MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,1,$url, "LangSubmitMove");
+ MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,1,$url, "LangSubmitMove");
}
$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Label");
int_header($objListToolBar,NULL,$title);
?>
<form name="frmPhrase" ID="frmPhrase" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar;?>" method=POST>
<TABLE cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
<?php
-if(!is_object($objPhraseList))
+if( !isset($objPhraseList) || !is_object($objPhraseList) )
{
- $objPhraseList = new clsPhraseList();
+ $objPhraseList = new clsPhraseList();
}
+
if(!$EditDirect)
- $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase");
-
+{
+ $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase");
+}
$count_ids = 1;
if ($print_list) {
$count_ids = count($PhraseIds);
}
else {
foreach($PhraseIdArr as $key => $value) {
if ($value == $selected_id) {
$PhraseIds[0] = $value;
}
}
}
for($x=0;$x<$count_ids;$x++)
{
- $p = $objPhraseList->GetItem($PhraseIds[$x]);
-
- //echo "<pre>"; print_r($p); echo "</pre>";
-
- if(!$LangId)
- $LangId = $p->Get("LanguageId");
- if(is_object($p) && ($selected_id != '' || $count_ids > 1))
- {
- echo int_subsection_title_ret(admin_language("la_tab_General").": ".GetPrimaryTranslation($p->Get("Phrase")));
- echo "<TR ".int_table_color_ret()." >\n";
- echo " <TD>".admin_language("la_prompt_PhraseId")."</TD>\n";
- echo " <TD>".$p->Get("PhraseId")."</TD>\n";
- echo " <TD></TD>\n";
- echo "</TR>\n";
-
- echo "<TR ".int_table_color_ret()." >\n";
- echo " <TD>".admin_language("la_prompt_Label")."</TD>\n";
- echo " <TD><input size=60 type=text tabindex=\"1\" ValidationType=\"exists\" NAME=\"name[".$p->Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\"></TD>\n";
- echo " <TD></TD>\n";
- echo "</TR>\n";
-
- echo "<TR ".int_table_color_ret()." >\n";
- echo " <TD>".admin_language("la_prompt_Value")."</TD>\n";
- echo " <TD><input size=60 type=text tabindex=\"2\" ValidationType=\"exists\" NAME=\"translation[".$p->Get("PhraseId")."]\" VALUE=\"".$p->Get("Translation")."\"></TD>\n";
- echo " <TD></TD>\n";
- echo "</TR>\n";
-
- echo "<TR ".int_table_color_ret()." >\n";
- echo " <TD>".admin_language("la_prompt_PhraseType")."</TD>\n";
- echo " <TD COLSPAN=2>\n";
- echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"0\"";
- if($p->Get("PhraseType")==0)
- echo "CHECKED";
- echo ">";
- echo admin_language("la_Text_Front");
- echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"1\"";
- if($p->Get("PhraseType")==1)
- echo "CHECKED";
- echo ">";
- echo admin_language("la_Text_Admin");
- echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"2\"";
- if($p->Get("PhraseType")==2)
- echo "CHECKED";
- echo ">";
- echo admin_language("la_Text_Both");
- echo " </TD>\n";
- echo "</TR>\n";
- unset($p);
- }
+ $p = $objPhraseList->GetItem($PhraseIds[$x]);
+
+ //echo "<pre>"; print_r($p); echo "</pre>";
+
+ if(!$LangId)
+ $LangId = $p->Get("LanguageId");
+ if(is_object($p) && ($selected_id != '' || $count_ids > 1))
+ {
+ echo int_subsection_title_ret(admin_language("la_tab_General")." :: ".GetPrimaryTranslation($p->Get("Phrase")));
+ echo "<TR ".int_table_color_ret()." >\n";
+ echo " <TD>".admin_language("la_prompt_PhraseId")."</TD>\n";
+ echo " <TD>".$p->Get("PhraseId")."</TD>\n";
+ echo " <TD></TD>\n";
+ echo "</TR>\n";
+
+ echo "<TR ".int_table_color_ret()." >\n";
+ echo " <TD>".admin_language("la_prompt_Label")."</TD>\n";
+ echo " <TD><input size=60 type=text tabindex=\"1\" ValidationType=\"exists\" NAME=\"name[".$p->Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\"></TD>\n";
+ echo " <TD></TD>\n";
+ echo "</TR>\n";
+
+ echo "<TR ".int_table_color_ret()." >\n";
+ echo " <TD>".admin_language("la_prompt_Value")."</TD>\n";
+ echo " <TD><input size=60 type=text tabindex=\"2\" ValidationType=\"exists\" NAME=\"translation[".$p->Get("PhraseId")."]\" VALUE=\"".$p->Get("Translation")."\"></TD>\n";
+ echo " <TD></TD>\n";
+ echo "</TR>\n";
+
+ echo "<TR ".int_table_color_ret()." >\n";
+ echo " <TD>".admin_language("la_prompt_PhraseType")."</TD>\n";
+ echo " <TD COLSPAN=2>\n";
+ echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"0\"";
+ if($p->Get("PhraseType")==0)
+ echo "CHECKED";
+ echo ">";
+ echo admin_language("la_Text_Front");
+ echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"1\"";
+ if($p->Get("PhraseType")==1)
+ echo "CHECKED";
+ echo ">";
+ echo admin_language("la_Text_Admin");
+ echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"2\"";
+ if($p->Get("PhraseType")==2)
+ echo "CHECKED";
+ echo ">";
+ echo admin_language("la_Text_Both");
+ echo " </TD>\n";
+ echo "</TR>\n";
+ unset($p);
+ }
}
?>
<?php
- if(strlen($NewLabel)>0)
- {
- "::".$PriTrans = GetPrimaryTranslation($NewLabel);
- }
+if(strlen($NewLabel)>0)
+{
+ "::".$PriTrans = GetPrimaryTranslation($NewLabel);
+}
+else
+{
+ $PriTrans = '';
+}
+
?>
-<?php if ($_GET['PhraseId'] == '') { ?>
-<?php int_subsection_title(admin_language("la_tab_General").":: New Phrase ".$PriTrans); ?>
+<?php if ( !GetVar('PhraseId') ) { ?>
+<?php int_subsection_title(admin_language("la_tab_General")." :: New Phrase ".$PriTrans); ?>
<TR <?php int_table_color(); ?> >
<td><?php echo admin_language("la_prompt_Label"); ?></td>
- <td><input type=text size=60 tabindex="4" NAME="name[0]" VALUE="<?php echo $_POST['name'][0]; ?>"></td>
+ <td><input type=text size=60 tabindex="4" NAME="name[0]" VALUE="<?php $names = GetVar('name'); if($names !== false) echo $names[0]; ?>"></td>
<td></td>
</tr>
<TR <?php int_table_color(); ?> >
<td><?php echo admin_language("la_prompt_Value"); ?></td>
- <td><input type=text size=60 tabindex="5" NAME="translation[0]" VALUE="<?php echo $_POST['translation'][0]; ?>"></td>
+ <td><input type=text size=60 tabindex="5" NAME="translation[0]" VALUE="<?php $traslations = GetVar('translation'); if($traslations !== false) echo $traslations[0]; ?>"></td>
<td></td>
</tr>
<TR <?php int_table_color(); ?> >
<TD><?php echo admin_language("la_prompt_PhraseType"); ?></TD>
<TD COLSPAN=2>
<input type=radio tabindex="6" NAME="phrasetype[0]" VALUE="0">
<?php echo admin_language("la_Text_Front"); ?>
<input type=radio tabindex="6" NAME="phrasetype[0]" VALUE="1">
<?php echo admin_language("la_Text_Admin"); ?>
<input type=radio tabindex="6" NAME="phrasetype[0]" VALUE="2">
<?php echo admin_language("la_Text_Both"); ?>
</TD>
</tr>
<tr>
- <td colspan="3" align="center"><font color="#FF0000"><?php echo $add_error; ?></font></td>
+ <td colspan="3" align="center"><font color="#FF0000"><?php if( isset($add_error) ) echo $add_error; ?></font></td>
</tr>
<INPUT type=hidden name="Action1" VALUE="new">
<?php } ?>
<INPUT TYPE=HIDDEN NAME="LanguageId" VALUE="<?php echo $LangId; ?>">
<INPUT type=hidden name="Action" VALUE="m_phrase_edit">
<input type=hidden name="direct" VALUE="<?php echo $EditDirect; ?>">
</FORM>
</TABLE>
<?php int_footer(); ?>
Property changes on: trunk/admin/config/edit_label.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Event Timeline
Log In to Comment