1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

GUI and LAN work on Linkwords plugin

This commit is contained in:
Tijn Kuyper
2013-02-03 14:19:24 +01:00
parent 60a03ad907
commit fecd0cb015
2 changed files with 34 additions and 47 deletions

View File

@@ -2,27 +2,14 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2010 e107 Inc (e107.org) * Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* Linkwords plugin - admin page * Linkwords plugin - admin page
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/linkwords/admin_config.php,v $ * $URL$
* $Revision$ * $Id$
* $Date$
* $Author$
*/
/**
* e107 Linkword plugin
*
* @package e107_plugins
* @subpackage linkwords
* @version $Id$;
*
* Administration page
*/ */
require_once('../../class2.php'); require_once('../../class2.php');
@@ -147,7 +134,7 @@ if (isset($_POST['submit_linkword']) || isset($_POST['update_linkword']))
{ {
if ($sql -> db_Insert('linkwords', $data)) if ($sql -> db_Insert('linkwords', $data))
{ {
$message = LWLAN_2; $message = LWLAN_2; // TODO FIX $emessage style
$admin_log->log_event('LINKWD_01',$logString,''); $admin_log->log_event('LINKWD_01',$logString,'');
} }
else else
@@ -160,7 +147,7 @@ if (isset($_POST['submit_linkword']) || isset($_POST['update_linkword']))
$id = intval(varset($_POST['lw_edit_id'],0)); $id = intval(varset($_POST['lw_edit_id'],0));
if (($id > 0) && $sql -> db_UpdateArray('linkwords', $data, ' WHERE `linkword_id`='.$id)) if (($id > 0) && $sql -> db_UpdateArray('linkwords', $data, ' WHERE `linkword_id`='.$id))
{ {
$message = LWLAN_3; $message = LWLAN_3; // TODO FIX $emessage style
$logString = 'ID: '.$id.'[!br!]'.$logString; $logString = 'ID: '.$id.'[!br!]'.$logString;
$admin_log->log_event('LINKWD_02',$logString,''); $admin_log->log_event('LINKWD_02',$logString,'');
} }
@@ -239,7 +226,7 @@ $text = "
<tr> <tr>
<td>".LWLAN_62."</td> <td>".LWLAN_62."</td>
<td> <td>
<input class='tbox' type='text' name='linkword_tip_id' size='10' value='".$linkword_tip_id."' maxlength='10' /> ".LWLAN_63." <input class='tbox' type='text' name='linkword_tip_id' size='10' value='".$linkword_tip_id."' maxlength='10' /><span class='field-help'>".LWLAN_63."</span>
</td> </td>
</tr> </tr>
@@ -269,7 +256,7 @@ if (($action == 'words') || ($action == 'edit'))
{ {
$text .= LWLAN_4; $text .= LWLAN_4;
} }
else // TODO FIX table below needs proper GUI else // TODO FIX table below needs input button to $frm style
{ {
$text = " $text = "
<table class='table adminlist'> <table class='table adminlist'>
@@ -277,7 +264,7 @@ if (($action == 'words') || ($action == 'edit'))
<col style='width: 5%; vertical-align:top;' /> <col style='width: 5%; vertical-align:top;' />
<col style='width: 15%; vertical-align:top;' /> <col style='width: 15%; vertical-align:top;' />
<col style='width: 20%; vertical-align:top;' /> <col style='width: 20%; vertical-align:top;' />
<col style='width: 5%; vertical-align:top;' /> <col style='width: 10%; vertical-align:top;' />
<col style='width: 25%; vertical-align:top;' /> <col style='width: 25%; vertical-align:top;' />
<col style='width: 5%; vertical-align:top;' /> <col style='width: 5%; vertical-align:top;' />
<col style='width: 10%; vertical-align:top; text-align: center;' /> <col style='width: 10%; vertical-align:top; text-align: center;' />
@@ -298,21 +285,21 @@ if (($action == 'words') || ($action == 'edit'))
{ {
$text .= " $text .= "
<tr> <tr>
<td>{$row['linkword_id']}</td> <td>{$row['linkword_id']}</td>
<td>{$row['linkword_word']}</td> <td>{$row['linkword_word']}</td>
<td>{$row['linkword_link']}</td> <td>{$row['linkword_link']}</td>
<td>".($row['linkword_newwindow'] ? LAN_YES : LAN_NO)."</td> <td>".($row['linkword_newwindow'] ? LAN_YES : LAN_NO)."</td>
<td>{$row['linkword_tooltip']}</td> <td>{$row['linkword_tooltip']}</td>
<td>".($row['linkword_tip_id'] > 0 ? $row['linkword_tip_id'] : '')."</td> <td>".($row['linkword_tip_id'] > 0 ? $row['linkword_tip_id'] : '')."</td>
<td >".$lwaction_vals[$row['linkword_active']]."</td> <td>".$lwaction_vals[$row['linkword_active']]."</td>
<td > <td>
<form action='".e_SELF."' method='post' id='myform_{$row['linkword_id']}' onsubmit=\"return jsconfirm('".LWLAN_18." [ID: {$row['linkword_id']} ]')\"> <form action='".e_SELF."' method='post' id='myform_{$row['linkword_id']}' onsubmit=\"return jsconfirm('".LWLAN_18." [ID: {$row['linkword_id']} ]')\">
<div> <div>
<input class='button' type='button' onclick=\"document.location='".e_SELF."?edit.{$row['linkword_id']}'\" value='".LWLAN_16."' id='edit_{$row['linkword_id']}' name='edit_linkword_id' /> <input class='btn button' type='button' onclick=\"document.location='".e_SELF."?edit.{$row['linkword_id']}'\" value='".LAN_EDIT."' id='edit_{$row['linkword_id']}' name='edit_linkword_id' />
<input class='button' type='submit' value='".LWLAN_17."' id='delete_{$row['linkword_id']}' name='delete_{$row['linkword_id']}' /> <input class='btn button' type='submit' value='".LAN_DELETE."' id='delete_{$row['linkword_id']}' name='delete_{$row['linkword_id']}' />
</div> </div>
</form>\n </form>\n
</td> </td>
</tr> </tr>
"; ";
} }
@@ -343,9 +330,9 @@ if ($action=='options')
foreach ($lw_context_areas as $lw_key=>$lw_desc) foreach ($lw_context_areas as $lw_key=>$lw_desc)
{ {
$checked = $pref['lw_context_visibility'][$lw_key] ? "checked='checked'" : ''; $checked = $pref['lw_context_visibility'][$lw_key] ? "checked='checked'" : '';
$text .= "<input type='checkbox' name='lw_visibility_area[]' value='{$lw_key}' {$checked} /> {$lw_desc}<span class='field-help>".LWLAN_27."</span><br />"; $text .= "<input type='checkbox' name='lw_visibility_area[]' value='{$lw_key}' {$checked} /> {$lw_desc}<br />";
} }
$text .= "</td> $text .= "<span class='field-help'>".LWLAN_27."</span></td>
</tr> </tr>
<tr> <tr>
@@ -370,7 +357,7 @@ if ($action=='options')
</table> </table>
<div class='buttons-bar center'> <div class='buttons-bar center'>
".$frm->admin_button('saveopts_linkword','no-value','submit', LWLAN_30)." ".$frm->admin_button('saveopts_linkword','no-value','submit', LAN_UPDATE)."
</div> </div>
</form> </form>
</div>\n"; </div>\n";
@@ -380,7 +367,7 @@ $ns -> tablerender(LWLAN_32, $text);
function admin_config_adminmenu() function admin_config_adminmenu() // TODO FIX v2 style
{ {
if (e_QUERY) if (e_QUERY)
{ {

View File

@@ -26,8 +26,8 @@ define("LWLAN_12", "Yes");
define("LWLAN_13", "No"); define("LWLAN_13", "No");
define("LWLAN_14", "Submit LinkWord"); define("LWLAN_14", "Submit LinkWord");
define("LWLAN_15", "Update LinkWord"); define("LWLAN_15", "Update LinkWord");
define("LWLAN_16", "Edit"); //define("LWLAN_16", "Edit");
define("LWLAN_17", "Delete"); //define("LWLAN_17", "Delete");
define("LWLAN_18", "Are you sure you want to delete this linkword?"); define("LWLAN_18", "Are you sure you want to delete this linkword?");
define("LWLAN_19", "Linkword deleted."); define("LWLAN_19", "Linkword deleted.");
define("LWLAN_20", "Unable to find that linkword entry."); define("LWLAN_20", "Unable to find that linkword entry.");
@@ -40,16 +40,16 @@ define("LWLAN_26", "Areas in which to enable linkwords");
define("LWLAN_27", "This is the 'context' of the displayed text"); define("LWLAN_27", "This is the 'context' of the displayed text");
define("LWLAN_28", "Pages on which to disable linkwords"); define("LWLAN_28", "Pages on which to disable linkwords");
define("LWLAN_29", "Same format as menu visibility control. One match per line. Specify a partial or complete URL. End with '!' for exact match of the end part of the link"); define("LWLAN_29", "Same format as menu visibility control. One match per line. Specify a partial or complete URL. End with '!' for exact match of the end part of the link");
define("LWLAN_30", "Save options"); //define("LWLAN_30", "Save options");
define("LWLAN_31", "Add/edit linkword"); define("LWLAN_31", "Add/edit linkword");
define("LWLAN_32", "Linkword Options"); define("LWLAN_32", "Linkword Options");
define("LWLAN_33", 'Title areas'); define("LWLAN_33", 'Title areas');
define("LWLAN_34", 'Item summaries'); define("LWLAN_34", 'Item summaries');
define("LWLAN_35", 'Body text'); define("LWLAN_35", 'Body text');
define("LWLAN_36", 'Descriptions (links etc)'); define("LWLAN_36", 'Descriptions (links etc)');
define("LWLAN_37", 'Legacy areas'); //define("LWLAN_37", 'Legacy areas');
define("LWLAN_38", 'Clickable links'); //define("LWLAN_38", 'Clickable links');
define("LWLAN_39", 'Unprocessed text'); //define("LWLAN_39", 'Unprocessed text');
define("LWLAN_40", 'User-entered titles (e.g. forum)'); define("LWLAN_40", 'User-entered titles (e.g. forum)');
define("LWLAN_41", 'User-entered body text (e.g. forum)'); define("LWLAN_41", 'User-entered body text (e.g. forum)');
// Reserve numbers for further context strings // Reserve numbers for further context strings
@@ -76,7 +76,7 @@ define('LWLAN_59', 'Enable Ajax functionality');
define('LWLAN_60', 'LW ID'); define('LWLAN_60', 'LW ID');
define('LWLAN_61', 'ID'); define('LWLAN_61', 'ID');
define('LWLAN_62', 'Tooltip ID (LW ID)'); define('LWLAN_62', 'Tooltip ID (LW ID)');
define('LWLAN_63', '(Positive integers only)'); define('LWLAN_63', 'Positive integers only');
define('LWLAN_64', 'Suppress link on current page'); define('LWLAN_64', 'Suppress link on current page');
define('LWLAN_65', 'When checked, suppresses clickable link if points to current page'); define('LWLAN_65', 'When checked, suppresses clickable link if points to current page');