[geeklog-cvs] Geeklog-1.x/public_html/admin/plugins/links category.php, 1.7, 1.8
Dirk Haun
dhaun at qs1489.pair.com
Sun Dec 30 04:45:46 EST 2007
Update of /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links
In directory qs1489.pair.com:/tmp/cvs-serv79926/public_html/admin/plugins/links
Modified Files:
category.php
Log Message:
Resolved undefined text strings (thanks, Euan). Also changed it so that category.php uses COM_showMessage now.
Index: category.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links/category.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** category.php 29 Dec 2007 19:06:23 -0000 1.7
--- category.php 30 Dec 2007 09:45:44 -0000 1.8
***************
*** 155,159 ****
function links_edit_category ($cid,$pid)
{
! global $_TABLES, $LANG_LINKS_ADMIN, $LANG_ADMIN, $LANG_ACCESS, $_CONF, $_USER;
$retval = '';
--- 155,160 ----
function links_edit_category ($cid,$pid)
{
! global $_CONF, $_TABLES, $_USER,
! $LANG_LINKS_ADMIN, $LANG_ADMIN, $LANG_ACCESS;
$retval = '';
***************
*** 189,193 ****
if ($access < 3) {
! return $LANG_LINKS[47];
}
--- 190,194 ----
if ($access < 3) {
! return $LANG_LINKS_ADMIN[60];
}
***************
*** 271,275 ****
function links_save_category($cid, $old_cid, $pid, $category, $description, $tid, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon)
{
! global $_TABLES, $_CONF, $_USER, $LANG_LINKS, $LANG_LINKS_ADMIN, $_LI_CONF;
// Convert array values to numeric permission values
--- 272,276 ----
function links_save_category($cid, $old_cid, $pid, $category, $description, $tid, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon)
{
! global $_CONF, $_TABLES, $_USER, $LANG_LINKS, $LANG_LINKS_ADMIN, $_LI_CONF;
// Convert array values to numeric permission values
***************
*** 284,289 ****
// Check cid to make sure not illegal
if (($cid == $_LI_CONF['root']) || ($cid == 'user')) {
! $result = $LANG_LINKS_ADMIN[35];
! return $result;
}
// check that they didn't delete the cid. If so, get the hidden one
--- 285,289 ----
// Check cid to make sure not illegal
if (($cid == $_LI_CONF['root']) || ($cid == 'user')) {
! return 11;
}
// check that they didn't delete the cid. If so, get the hidden one
***************
*** 294,298 ****
// This would create orphans
if ($cid==DB_getItem($_TABLES['linkcategories'], 'pid',"cid='{$pid}'")) {
! return $LANG_LINKS_ADMIN[48];
}
--- 294,298 ----
// This would create orphans
if ($cid==DB_getItem($_TABLES['linkcategories'], 'pid',"cid='{$pid}'")) {
! return 12;
}
***************
*** 329,338 ****
// no access rights: user should not be here
$display .= COM_siteHeader ('menu');
! $display .= COM_startBlock ($LANG_LINKS[41], '',
COM_getBlockTemplate ('_msg_block', 'header'));
! $display .= $LANG_LINKS[44];
$display .= COM_endBlock(COM_getBlockTemplate ('_msg_block', 'footer'));
$display .= COM_siteFooter ();
! COM_accessLog(sprintf($LANG_LINKS[45], $_USER['username']));
echo $display;
exit;
--- 329,338 ----
// no access rights: user should not be here
$display .= COM_siteHeader ('menu');
! $display .= COM_startBlock ($LANG_LINKS[14], '',
COM_getBlockTemplate ('_msg_block', 'header'));
! $display .= $LANG_LINKS_ADMIN[60];
$display .= COM_endBlock(COM_getBlockTemplate ('_msg_block', 'footer'));
$display .= COM_siteFooter ();
! COM_accessLog(sprintf($LANG_LINKS_ADMIN[61], $_USER['username'], $cid));
echo $display;
exit;
***************
*** 387,398 ****
}
! return PLG_afterSaveSwitch (
! $_LI_CONF['aftersave'],
! COM_buildURL ("{$_CONF['site_url']}/links/portal.php?what=category&item={$cid}"),
! 'links',
! 2
! );
!
! // return $result;
}
--- 387,391 ----
}
! return 10;
}
***************
*** 416,440 ****
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],
$A['perm_group'],$A['perm_members'],$A['perm_anon']);
! if ($access>2) {
// has edit rights
// Check for subfolders and sublinks
! $sf = DB_count ($_TABLES['linkcategories'], 'pid', $cid);
! $sl = DB_count ($_TABLES['links'], 'cid', $cid);
! if (($sf=='0') && ($sl=='0')) {
// No subfolder/links so OK to delete
! DB_delete ( $_TABLES['linkcategories'], 'cid', $cid);
! return $LANG_LINKS_ADMIN[37];
} else {
// Subfolders and/or sublinks exist so return a message
! return $LANG_LINKS_ADMIN[38];
}
} else {
// no access
! return $LANG_LINKS_ADMIN[45];
COM_accessLog(sprintf($LANG_LINKS_ADMIN[46], $_USER['username']));
}
} else {
// no such category
! return $LANG_LINKS_ADMIN[47];
}
}
--- 409,433 ----
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],
$A['perm_group'],$A['perm_members'],$A['perm_anon']);
! if ($access > 2) {
// has edit rights
// Check for subfolders and sublinks
! $sf = DB_count($_TABLES['linkcategories'], 'pid', $cid);
! $sl = DB_count($_TABLES['links'], 'cid', $cid);
! if (($sf == 0) && ($sl == 0)) {
// No subfolder/links so OK to delete
! DB_delete($_TABLES['linkcategories'], 'cid', $cid);
! return 13;
} else {
// Subfolders and/or sublinks exist so return a message
! return 14;
}
} else {
// no access
! return 15;
COM_accessLog(sprintf($LANG_LINKS_ADMIN[46], $_USER['username']));
}
} else {
// no such category
! return 16;
}
}
***************
*** 452,490 ****
// delete category
if ((($mode == $LANG_ADMIN['delete']) && !empty ($LANG_ADMIN['delete'])) || ($mode=="delete")) {
! $cid = COM_applyFilter ($_REQUEST['cid']);
! if (!isset ($cid) || empty ($cid)) { // || ($cid == 0)
! COM_errorLog ('Attempted to delete category cid=' . $cid );
! $display .= COM_refresh ($_CONF['site_admin_url'] . '/plugins/links/category.php');
} else {
! $display .= COM_siteHeader ('menu', $LANG_LINKS_ADMIN[11]);
! $result = links_delete_category ($cid);
! $display .= COM_startBlock ($LANG_LINKS[41], '', COM_getBlockTemplate ('_msg_block', 'header'));
! $display .= $result;
! $display .= COM_endBlock(COM_getBlockTemplate ('_msg_block', 'footer'));
$display .= links_list_categories($root);
$display .= COM_siteFooter();
-
}
// save category
} else if (($mode == $LANG_ADMIN['save']) && !empty ($LANG_ADMIN['save'])) {
! $display .= COM_siteHeader ('menu', $LANG_LINKS_ADMIN[11]);
! $result = links_save_category (COM_applyFilter ($_POST['cid']),
COM_applyFilter ($_POST['old_cid']),
! COM_applyFilter ($_POST['pid']), $_POST['category'], $_POST['description'],
! COM_applyFilter ($_POST['tid']),
COM_applyFilter ($_POST['owner_id'], true),
COM_applyFilter ($_POST['group_id'], true),
$_POST['perm_owner'], $_POST['perm_group'],
$_POST['perm_members'], $_POST['perm_anon']);
- $display .= COM_startBlock ($LANG_LINKS[41], '', COM_getBlockTemplate ('_msg_block', 'header'));
- if ($result==1) {
- $display .= $LANG_LINKS_ADMIN[39];
- } else {
- $display .= $result;
- }
- $display .= COM_endBlock(COM_getBlockTemplate ('_msg_block', 'footer'));
$display .= links_list_categories($root);
$display .= COM_siteFooter();
--- 445,474 ----
// delete category
if ((($mode == $LANG_ADMIN['delete']) && !empty ($LANG_ADMIN['delete'])) || ($mode=="delete")) {
! $cid = COM_applyFilter($_REQUEST['cid']);
! if (!isset($cid) || empty($cid)) {
! COM_errorLog('Attempted to delete category cid=' . $cid );
! $display .= COM_refresh($_CONF['site_admin_url'] . '/plugins/links/category.php');
} else {
! $msg = links_delete_category($cid);
! $display .= COM_siteHeader('menu', $LANG_LINKS_ADMIN[11]);
! $display .= COM_showMessage($msg, 'links');
$display .= links_list_categories($root);
$display .= COM_siteFooter();
}
// save category
} else if (($mode == $LANG_ADMIN['save']) && !empty ($LANG_ADMIN['save'])) {
! $msg = links_save_category (COM_applyFilter ($_POST['cid']),
COM_applyFilter ($_POST['old_cid']),
! COM_applyFilter ($_POST['pid']), $_POST['category'],
! $_POST['description'], COM_applyFilter ($_POST['tid']),
COM_applyFilter ($_POST['owner_id'], true),
COM_applyFilter ($_POST['group_id'], true),
$_POST['perm_owner'], $_POST['perm_group'],
$_POST['perm_members'], $_POST['perm_anon']);
+ $display .= COM_siteHeader ('menu', $LANG_LINKS_ADMIN[11]);
+ $display .= COM_showMessage ($msg, 'links');
$display .= links_list_categories($root);
$display .= COM_siteFooter();
More information about the geeklog-cvs
mailing list