2006-12-02 04:36:16 +00:00
< ? php
/*
2009-11-17 13:48:46 +00:00
* e107 website system
*
2015-04-04 18:58:43 -07:00
* Copyright ( C ) 2008 - 2015 e107 Inc ( e107 . org )
2009-11-17 13:48:46 +00:00
* Released under the terms and conditions of the
* GNU General Public License ( http :// www . gnu . org / licenses / gpl . txt )
*
2010-01-02 22:57:41 +00:00
* Linkwords plugin - admin page
2009-11-17 13:48:46 +00:00
*
2010-01-02 22:57:41 +00:00
*/
2015-04-04 18:58:43 -07:00
require_once ( '../../class2.php' );
if ( ! getperms ( 'P' ) || ! e107 :: isInstalled ( 'linkwords' ))
{
2016-01-13 19:17:37 -08:00
e107 :: redirect ( 'admin' );
2015-04-04 18:58:43 -07:00
exit ;
}
e107 :: lan ( 'linkwords' , true ); // e_PLUGIN.'linkwords/languages/'.e_LANGUAGE.'_admin.php'
define ( 'LW_CACHE_TAG' , 'nomd5_linkwords' );
class linkwords_admin extends e_admin_dispatcher
{
protected $modes = array (
'main' => array (
'controller' => 'linkwords_ui' ,
'path' => null ,
'ui' => 'linkwords_form_ui' ,
'uipath' => null
),
);
protected $adminMenu = array (
'main/list' => array ( 'caption' => LAN_MANAGE , 'perm' => 'P' ),
'main/create' => array ( 'caption' => LAN_CREATE , 'perm' => 'P' ),
'main/prefs' => array ( 'caption' => LAN_PREFS , 'perm' => 'P' ),
// 'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P')
);
protected $adminMenuAliases = array (
'main/edit' => 'main/list'
);
protected $menuTitle = LAN_PLUGIN_LINKWORDS_NAME ;
}
class linkwords_ui extends e_admin_ui
{
protected $pluginTitle = 'Linkwords' ;
protected $pluginName = 'core' ;
// protected $eventName = 'linkwords-linkwords'; // remove comment to enable event triggers in admin.
protected $table = 'linkwords' ;
protected $pid = 'linkword_id' ;
protected $perPage = 10 ;
protected $batchDelete = true ;
// protected $batchCopy = true;
// protected $sortField = 'somefield_order';
// protected $orderStep = 10;
// protected $tabs = array('Tabl 1','Tab 2'); // Use 'tab'=>0 OR 'tab'=>1 in the $fields below to enable.
// protected $listQry = "SELECT * FROM `#tableName` WHERE field != '' "; // Example Custom Query. LEFT JOINS allowed. Should be without any Order or Limit.
protected $listOrder = 'linkword_id DESC' ;
protected $fields = array ( 'checkboxes' => array ( 'title' => '' , 'type' => null , 'data' => null , 'width' => '5%' , 'thclass' => 'center' , 'forced' => '1' , 'class' => 'center' , 'toggle' => 'e-multiselect' , ),
'linkword_id' => array ( 'title' => LAN_ID , 'data' => 'int' , 'width' => '5%' , 'help' => '' , 'readParms' => '' , 'writeParms' => '' , 'class' => 'left' , 'thclass' => 'left' , ),
'linkword_word' => array ( 'title' => LWLAN_21 , 'type' => 'tags' , 'data' => 'str' , 'width' => 'auto' , 'inline' => true , 'help' => '' , 'readParms' => '' , 'writeParms' => '' , 'class' => 'left' , 'thclass' => 'left' , ),
'linkword_link' => array ( 'title' => LWLAN_6 , 'type' => 'text' , 'data' => 'str' , 'width' => 'auto' , 'inline' => true , 'help' => '' , 'readParms' => '' , 'writeParms' => 'size=xxlarge' , 'class' => 'left' , 'thclass' => 'left' , ),
2016-12-21 12:10:21 -08:00
'linkword_active' => array ( 'title' => LAN_ACTIVE , 'type' => 'dropdown' , 'data' => 'int' , 'width' => 'auto' , 'batch' => true , 'filter' => true , 'inline' => true , 'help' => '' , 'readParms' => '' , 'writeParms' => array (), 'left' => 'center' , 'thclass' => 'left' , ),
2015-04-04 18:58:43 -07:00
2016-05-12 14:57:03 -07:00
'linkword_tooltip' => array ( 'title' => LWLAN_50 , 'type' => 'textarea' , 'data' => 'str' , 'width' => 'auto' , 'inline' => true , 'help' => '' , 'readParms' => '' , 'writeParms' => array ( 'size' => 'xxlarge' ), 'class' => 'left' , 'thclass' => 'left' , ),
'linkword_limit' => array ( 'title' => " Max. links/tips " , 'type' => 'number' , 'data' => 'int' , 'width' => '10%' , 'help' => LWLAN_63 , 'readParms' => '' , 'writeParms' => array ( 'default' => 3 ), 'class' => 'right' , 'thclass' => 'right' , ),
'linkword_tip_id' => array ( 'title' => LAN_ID , 'type' => 'number' , 'data' => 'int' , 'width' => '5%' , 'help' => LWLAN_63 , 'readParms' => '' , 'writeParms' => '' , 'class' => 'right' , 'thclass' => 'right' , ),
2015-04-04 18:58:43 -07:00
'linkword_newwindow' => array ( 'title' => LWLAN_55 , 'type' => 'boolean' , 'data' => 'int' , 'width' => 'auto' , 'inline' => true , 'help' => '' , 'filter' => true , 'readParms' => '' , 'writeParms' => '' , 'class' => 'center' , 'thclass' => 'center' , ),
2016-05-12 14:57:03 -07:00
'options' => array ( 'title' => LAN_OPTIONS , 'type' => null , 'data' => null , 'width' => '10%' , 'thclass' => 'center last' , 'class' => 'center last' , 'forced' => '1' , ),
2015-04-04 18:58:43 -07:00
);
protected $fieldpref = array ();
protected $prefs = array (
'lw_context_visibility' => array ( 'title' => LWLAN_26 , 'type' => 'checkboxes' , 'help' => '' ),
'lw_ajax_enable' => array ( 'title' => LWLAN_59 , 'type' => 'boolean' , 'data' => 'string' , 'help' => '' ),
'lw_notsamepage' => array ( 'title' => LWLAN_64 , 'type' => 'boolean' , 'data' => 'string' , 'help' => LWLAN_65 ),
'linkword_omit_pages' => array ( 'title' => LWLAN_28 , 'type' => 'textarea' , 'data' => 'string' , 'help' => '' ),
2016-05-12 14:57:03 -07:00
// 'lw_max_per_word' => array('title'=> "Maximum links/tips per word", 'type'=>'number', 'data' => 'string','help'=>'If the same word is found multiple times in a piece of text.'),
2015-04-09 20:41:44 -07:00
'lw_custom_class' => array ( 'title' => " Custom CSS Class " , 'type' => 'text' , 'writeParms' => array ( 'placeholder' => LAN_OPTIONAL ), 'data' => 'string' , 'help' => 'Will add this class to all generated links.' ),
2015-04-04 18:58:43 -07:00
);
public function init ()
{
if ( $this -> getAction () == 'list' )
{
$this -> fields [ 'linkword_word' ][ 'title' ] = LWLAN_5 ;
}
// Set drop-down values (if any).
$this -> fields [ 'linkword_active' ][ 'writeParms' ][ 'optArray' ] = array ( 1 => LAN_INACTIVE , 0 => LWLAN_52 , 2 => LWLAN_53 , 3 => LWLAN_54 );
$this -> prefs [ 'lw_context_visibility' ][ 'writeParms' ][ 'optArray' ] = array ( 'TITLE' => LWLAN_33 , 'SUMMARY' => LWLAN_34 , 'BODY' => LWLAN_35 , 'DESCRIPTION' => LWLAN_36 , 'USER_TITLE' => LWLAN_40 , 'USER_BODY' => LWLAN_41 );
if ( ! empty ( $_POST [ 'etrigger_save' ]))
{
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
}
}
// ------- Customize Create --------
2016-12-21 12:10:21 -08:00
public function beforeCreate ( $new_data , $old_data )
2015-04-04 18:58:43 -07:00
{
return $new_data ;
}
public function afterCreate ( $new_data , $old_data , $id )
{
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
// do something
}
public function onCreateError ( $new_data , $old_data )
{
// do something
}
// ------- Customize Update --------
public function beforeUpdate ( $new_data , $old_data , $id )
{
return $new_data ;
}
public function afterUpdate ( $new_data , $old_data , $id )
{
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
// do something
}
public function onUpdateError ( $new_data , $old_data , $id )
{
// do something
}
public function afterDelete ( $deleted_data , $id , $deleted_check )
{
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
}
/*
// optional - a custom page.
public function customPage ()
{
$ns = e107 :: getRender ();
$text = 'Hello World!' ;
$ns -> tablerender ( 'Hello' , $text );
}
*/
}
class linkwords_form_ui extends e_admin_form_ui
{
}
new linkwords_admin ();
require_once ( e_ADMIN . " auth.php " );
e107 :: getAdminUI () -> runPage ();
require_once ( e_ADMIN . " footer.php " );
exit ;
/*
2010-01-02 22:57:41 +00:00
require_once ( e_ADMIN . 'auth.php' );
2014-02-07 07:03:05 -08:00
2015-01-31 14:22:54 -08:00
e107 :: lan ( 'linkwords' , true ); // e_PLUGIN.'linkwords/languages/'.e_LANGUAGE.'_admin.php'
2014-02-07 07:03:05 -08:00
2008-12-13 18:04:52 +00:00
define ( 'LW_CACHE_TAG' , 'nomd5_linkwords' );
2006-12-02 04:36:16 +00:00
2015-04-04 18:58:43 -07:00
$pref = e107 :: getConfig () -> getPref ();
// print_a($pref['lw_context_visibility']);
2013-02-06 17:43:46 +01:00
2013-03-02 13:41:37 +01:00
$mes = e107 :: getMessage ();
2013-02-06 17:43:46 +01:00
$tp = e107 :: getParser ();
2013-03-02 13:41:37 +01:00
$frm = e107 :: getForm ();
2013-02-06 17:43:46 +01:00
2007-02-07 21:48:26 +00:00
$lw_context_areas = array (
2008-12-07 21:55:02 +00:00
'TITLE' => LWLAN_33 ,
'SUMMARY' => LWLAN_34 ,
'BODY' => LWLAN_35 ,
'DESCRIPTION' => LWLAN_36 ,
'USER_TITLE' => LWLAN_40 ,
'USER_BODY' => LWLAN_41
2007-02-07 21:48:26 +00:00
// Don't do the next three - linkwords are meaningless on them
2007-02-08 20:18:33 +00:00
// 'olddefault' => LWLAN_37,
// 'linktext' => LWLAN_38,
// 'rawtext' => LWLAN_39'
2007-02-07 21:48:26 +00:00
);
2008-12-07 21:55:02 +00:00
// Yes, I know its a silly order - but that's history!
2015-01-31 01:09:25 -08:00
$lwaction_vals = array ( 1 => LAN_INACTIVE , 0 => LWLAN_52 , 2 => LWLAN_53 , 3 => LWLAN_54 );
2012-11-26 15:43:42 -08:00
$frm = e107 :: getForm ();
2008-12-07 21:55:02 +00:00
// Generate dropdown for possible actions on finding a linkword
function lw_act_opts ( $curval )
{
global $lwaction_vals ;
$ret = '' ;
foreach ( $lwaction_vals as $opt => $val )
{
2010-01-02 22:57:41 +00:00
$selected = ( $curval == $opt ? " selected='selected' " : '' );
2008-12-07 21:55:02 +00:00
$ret .= " <option value=' { $opt } ' { $selected } > { $val } </option> \n " ;
}
return $ret ;
}
2007-02-07 21:48:26 +00:00
2006-12-02 04:36:16 +00:00
$deltest = array_flip ( $_POST );
2013-02-06 17:43:46 +01:00
if ( isset ( $deltest [ LAN_DELETE ]))
2006-12-02 04:36:16 +00:00
{
2013-02-06 17:43:46 +01:00
$delete_id = intval ( str_replace ( 'delete_' , '' , $deltest [ LAN_DELETE ]));
2006-12-02 04:36:16 +00:00
2010-01-02 22:57:41 +00:00
if ( $sql -> db_Count ( 'linkwords' , '(*)' , " WHERE linkword_id = " . $delete_id ))
2006-12-02 04:36:16 +00:00
{
2010-01-02 22:57:41 +00:00
$sql -> db_Delete ( 'linkwords' , 'linkword_id=' . $delete_id );
2014-10-23 11:12:13 -07:00
e107 :: getLog () -> add ( 'LINKWD_03' , 'ID: ' . $delete_id , '' );
2008-12-13 18:04:52 +00:00
$e107 -> ecache -> clear_sys ( LW_CACHE_TAG );
2013-02-06 17:43:46 +01:00
//$message = LWLAN_19;
$mes -> addSuccess ( LAN_DELETED );
2006-12-02 04:36:16 +00:00
}
}
if ( e_QUERY )
{
2010-01-02 22:57:41 +00:00
$lw_qs = explode ( '.' , e_QUERY );
2007-02-07 21:48:26 +00:00
if ( ! isset ( $lw_qs [ 0 ])) $lw_qs [ 0 ] = 'words' ;
if ( ! isset ( $lw_qs [ 1 ])) $lw_qs [ 1 ] = - 1 ;
$action = $lw_qs [ 0 ];
2008-12-07 21:55:02 +00:00
$id = intval ( $lw_qs [ 1 ]);
2007-02-07 21:48:26 +00:00
}
if ( ! isset ( $action )) $action = 'words' ;
if ( isset ( $_POST [ 'saveopts_linkword' ]))
{ // Save options page
// Array of context flags
$pref [ 'lw_context_visibility' ] = array (
2008-12-07 21:55:02 +00:00
'OLDDEFAULT' => FALSE ,
'TITLE' => FALSE ,
'USER_TITLE' => FALSE ,
'SUMMARY' => FALSE ,
'BODY' => FALSE ,
'USER_BODY' => FALSE ,
'DESCRIPTION' => FALSE ,
'LINKTEXT' => FALSE ,
'RAWTEXT' => FALSE
2007-02-07 21:48:26 +00:00
);
2008-12-13 18:04:52 +00:00
foreach ( $_POST [ 'lw_visibility_area' ] as $can_see )
2007-02-07 21:48:26 +00:00
{
2008-12-13 18:04:52 +00:00
if ( key_exists ( $can_see , $lw_context_areas ))
{
$pref [ 'lw_context_visibility' ][ $can_see ] = TRUE ;
}
2007-02-07 21:48:26 +00:00
}
2008-12-13 18:04:52 +00:00
// Text area for 'exclude' pages - use same method as for menus
$pagelist = explode ( " \r \n " , $_POST [ 'linkword_omit_pages' ]);
for ( $i = 0 ; $i < count ( $pagelist ) ; $i ++ )
{
$pagelist [ $i ] = trim ( $pagelist [ $i ]);
}
$pref [ 'lw_page_visibility' ] = '2-' . implode ( " | " , $pagelist ); // '2' for 'hide on specified pages'
$pref [ 'lw_ajax_enable' ] = isset ( $_POST [ 'lw_ajax_enable' ]);
2010-01-16 20:49:55 +00:00
$pref [ 'lw_notsamepage' ] = isset ( $_POST [ 'lw_notsamepage' ]);
2008-12-13 18:04:52 +00:00
save_prefs ();
2010-01-23 10:31:36 +00:00
$logString = implode ( ', ' , $pref [ 'lw_context_visibility' ]) . '[!br!]' . $pref [ 'lw_page_visibility' ] . '[!br!]' . $pref [ 'lw_ajax_enable' ] . '[!br!]' . $pref [ 'lw_notsamepage' ];
2015-02-15 16:07:27 -08:00
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
2014-10-23 11:12:13 -07:00
e107 :: getLog () -> add ( 'LINKWD_04' , $logString , '' );
2006-12-02 04:36:16 +00:00
}
2007-02-07 21:48:26 +00:00
2008-12-07 21:55:02 +00:00
if ( isset ( $_POST [ 'submit_linkword' ]) || isset ( $_POST [ 'update_linkword' ]))
2006-12-02 04:36:16 +00:00
{
2015-04-04 18:58:43 -07:00
if ( ! $_POST [ 'linkwords_word' ] && $_POST [ 'linkwords_url' ])
2008-12-07 21:55:02 +00:00
{ // Key fields empty
2013-02-06 17:43:46 +01:00
$mes -> addError ( LAN_REQUIRED_BLANK );
2006-12-02 04:36:16 +00:00
}
else
{
2013-02-06 17:43:46 +01:00
$data [ 'linkword_word' ] = $tp -> toDB ( $_POST [ 'linkword_word' ]);
$data [ 'linkword_link' ] = $tp -> toDB ( $_POST [ 'linkword_link' ]);
$data [ 'linkword_tooltip' ] = $tp -> toDB ( $_POST [ 'linkword_tooltip' ]);
2008-12-07 21:55:02 +00:00
$data [ 'linkword_tip_id' ] = intval ( $_POST [ 'linkword_tip_id' ]);
$data [ 'linkword_active' ] = intval ( $_POST [ 'linkword_active' ]);
$data [ 'linkword_newwindow' ] = isset ( $_POST [ 'linkword_newwindow' ]) ? 1 : 0 ;
$logString = implode ( '[!br!]' , $data );
if ( isset ( $_POST [ 'submit_linkword' ]))
{
2013-02-06 17:43:46 +01:00
if ( $sql -> db_Insert ( 'linkwords' , $data ))
2008-12-07 21:55:02 +00:00
{
2014-10-23 11:12:13 -07:00
e107 :: getLog () -> add ( 'LINKWD_01' , $logString , '' );
2013-02-06 17:43:46 +01:00
$mes -> addSuccess ( LAN_CREATED );
2008-12-07 21:55:02 +00:00
}
else
{
2013-02-06 17:43:46 +01:00
//$message = LWLAN_57;
$mes -> addError ( LAN_CREATED_FAILED );
2008-12-07 21:55:02 +00:00
}
}
elseif ( isset ( $_POST [ 'update_linkword' ]))
{
$id = intval ( varset ( $_POST [ 'lw_edit_id' ], 0 ));
2013-02-06 17:43:46 +01:00
if (( $id > 0 ) && $sql -> db_UpdateArray ( 'linkwords' , $data , ' WHERE `linkword_id`=' . $id ))
2008-12-07 21:55:02 +00:00
{
2013-02-06 17:43:46 +01:00
$mes -> addSuccess ( LAN_UPDATED );
2008-12-07 21:55:02 +00:00
$logString = 'ID: ' . $id . '[!br!]' . $logString ;
2014-10-23 11:12:13 -07:00
e107 :: getLog () -> add ( 'LINKWD_02' , $logString , '' );
2008-12-07 21:55:02 +00:00
}
else
{
2013-02-06 17:43:46 +01:00
$mes -> addError ( LAN_UPDATED_FAILED );
2008-12-07 21:55:02 +00:00
}
}
2015-02-15 16:07:27 -08:00
e107 :: getCache () -> clear_sys ( LW_CACHE_TAG );
2006-12-02 04:36:16 +00:00
}
}
2013-02-06 17:43:46 +01:00
$ns -> tablerender ( $caption , $mes -> render () . $text );
2006-12-02 04:36:16 +00:00
2008-12-07 21:55:02 +00:00
$chkNewWindow = " checked='checked' " ; // Open links in new window by default
2006-12-02 04:36:16 +00:00
if ( $action == " edit " )
{
2007-02-07 21:48:26 +00:00
if ( $sql -> db_Select ( " linkwords " , " * " , " linkword_id= " . $id ))
{
$row = $sql -> db_Fetch ();
extract ( $row );
2008-12-07 21:55:02 +00:00
$chkNewWindow = $row [ 'linkword_newwindow' ] ? " checked='checked' " : '' ; // Open links in new window by default
2007-02-07 21:48:26 +00:00
define ( " LW_EDIT " , TRUE );
}
2006-12-02 04:36:16 +00:00
}
else
{
2010-01-02 22:57:41 +00:00
$linkword_word = '' ;
$linkword_link = '' ;
$linkword_active = '' ;
$linkword_tooltip = '' ;
$linkword_tip_id = '' ;
2006-12-02 04:36:16 +00:00
}
2007-02-07 21:48:26 +00:00
if (( $action == 'words' ) || ( $action == 'edit' ))
{
2013-03-02 13:41:37 +01:00
2006-12-02 04:36:16 +00:00
$text = "
2007-02-07 21:48:26 +00:00
< form method = 'post' action = '".e_SELF."?words' >
2012-11-26 15:43:42 -08:00
< table class = 'table adminform' >
2008-12-07 21:55:02 +00:00
< colgroup >
2012-11-26 15:43:42 -08:00
< col class = 'col-label' />
< col class = 'col-control' />
2008-12-07 21:55:02 +00:00
</ colgroup >
2006-12-02 04:36:16 +00:00
< tr >
2012-11-26 15:43:42 -08:00
< td > " .LWLAN_21. " </ td >
2012-12-07 16:34:49 +01:00
< td >
< input class = 'tbox' type = 'text' name = 'linkword_word' size = '40' value = '".$linkword_word."' maxlength = '100' />
</ td >
2006-12-02 04:36:16 +00:00
</ tr >
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_6. " </ td >
< td >
< input class = 'tbox' type = 'text' name = 'linkword_link' size = '60' value = '".$linkword_link."' maxlength = '250' />< br />
< input type = 'checkbox' name = 'linkword_newwindow' value = '1' { $chkNewWindow } /> " .LWLAN_55. "
</ td >
2008-12-07 21:55:02 +00:00
</ tr >
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_50. " </ td >
< td >
< textarea rows = '3' cols = '80' class = 'tbox' name = 'linkword_tooltip' > " . $linkword_tooltip . " </ textarea >
</ td >
2008-12-07 21:55:02 +00:00
</ tr >
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_62. " </ td >
< td >
2013-02-03 14:19:24 +01:00
< input class = 'tbox' type = 'text' name = 'linkword_tip_id' size = '10' value = '".$linkword_tip_id."' maxlength = '10' />< span class = 'field-help' > " .LWLAN_63. " </ span >
2012-12-07 16:34:49 +01:00
</ td >
2006-12-02 04:36:16 +00:00
</ tr >
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_22. " </ td >
< td >
< select class = 'tbox' name = 'linkword_active' > " .lw_act_opts( $linkword_active ). " </ select >
</ td >
2006-12-02 04:36:16 +00:00
</ tr >
</ table >
2012-11-26 15:43:42 -08:00
< div class = 'buttons-bar center' >
" .
( defined ( " LW_EDIT " ) ? $frm -> admin_button ( 'update_linkword' , 'no-value' , 'update' , LAN_UPDATE ) . " <input type='hidden' name='lw_edit_id' value=' { $id } ' /> " : $frm -> admin_button ( 'submit_linkword' , 'no-value' , 'submit' , LAN_CREATE )) . "
</ div >
2012-12-07 16:34:49 +01:00
</ form > \n " ;
2006-12-02 04:36:16 +00:00
2008-12-07 21:55:02 +00:00
2007-02-07 21:48:26 +00:00
$ns -> tablerender ( LWLAN_31 , $text );
}
2007-03-06 20:17:16 +00:00
if (( $action == 'words' ) || ( $action == 'edit' ))
{
2008-12-07 21:55:02 +00:00
2007-03-06 20:17:16 +00:00
$text = " <div class='center'> \n " ;
if ( ! $sql -> db_Select ( " linkwords " ))
{
2013-02-12 21:06:20 +01:00
//$text .= LWLAN_4;
$mes -> addInfo ( LWLAN_4 );
2007-03-06 20:17:16 +00:00
}
2015-04-04 18:58:43 -07:00
else
2007-03-06 20:17:16 +00:00
{
$text = "
2012-12-07 16:34:49 +01:00
< table class = 'table adminlist' >
< colgroup >
< col style = 'width: 5%; vertical-align:top;' />
< col style = 'width: 15%; vertical-align:top;' />
< col style = 'width: 20%; vertical-align:top;' />
2013-02-03 14:19:24 +01:00
< col style = 'width: 10%; vertical-align:top;' />
2012-12-07 16:34:49 +01:00
< col style = 'width: 25%; vertical-align:top;' />
< col style = 'width: 5%; vertical-align:top;' />
< col style = 'width: 10%; vertical-align:top; text-align: center;' />
< col style = 'width: 15%; vertical-align:top; text-align: center;' />
</ colgroup >
< tr >
2013-02-06 17:43:46 +01:00
< td > " .LAN_ID. " </ td >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_5. " </ td >
< td > " .LWLAN_6. " </ td >
< td > " .LWLAN_56. " </ td >
< td > " .LWLAN_50. " </ td >
< td > " .LWLAN_60. " </ td >
< td > " .LWLAN_7. " </ td >
2013-02-06 17:43:46 +01:00
< td > " .LAN_OPTIONS. " </ td >
2007-03-06 20:17:16 +00:00
</ tr > \n " ;
2013-02-06 17:43:46 +01:00
while ( $row = $sql -> db_Fetch ())
2007-03-06 20:17:16 +00:00
{
$text .= "
< tr >
2013-02-03 14:19:24 +01:00
< td > { $row [ 'linkword_id' ]} </ td >
< td > { $row [ 'linkword_word' ]} </ td >
< td > { $row [ 'linkword_link' ]} </ td >
< td > " .( $row['linkword_newwindow'] ? LAN_YES : LAN_NO). " </ td >
< td > { $row [ 'linkword_tooltip' ]} </ td >
< td > " .( $row['linkword_tip_id'] > 0 ? $row['linkword_tip_id'] : ''). " </ td >
< td > " . $lwaction_vals[$row['linkword_active'] ]. " </ td >
< td >
< form action = '".e_SELF."' method = 'post' id = 'myform_{$row[' linkword_id ']}' onsubmit = \ " return jsconfirm(' " . LWLAN_18 . " [ID: { $row [ 'linkword_id' ] } ]') \" >
< div >
2014-02-07 07:33:33 -08:00
< input class = 'btn btn-default 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 = 'btn btn-default button' type = 'submit' value = '".LAN_DELETE."' id = 'delete_{$row[' linkword_id ']}' name = 'delete_{$row[' linkword_id ']}' />
2013-02-03 14:19:24 +01:00
</ div >
</ form > \n
</ td >
2007-03-06 20:17:16 +00:00
</ tr >
2008-12-07 21:55:02 +00:00
" ;
2007-03-06 20:17:16 +00:00
}
$text .= " </table> " ;
}
2013-02-06 17:43:46 +01:00
$ns -> tablerender ( LWLAN_11 , $mes -> render () . $text );
2007-03-06 20:17:16 +00:00
}
2007-02-07 21:48:26 +00:00
if ( $action == 'options' )
{
$menu_pages = substr ( $pref [ 'lw_page_visibility' ], 2 ); // Knock off the 'show/hide' flag
$menu_pages = str_replace ( " | " , " \n " , $menu_pages );
2008-12-07 21:55:02 +00:00
$AjaxEnable = varset ( $pref [ 'lw_ajax_enable' ], 0 );
2007-02-07 21:48:26 +00:00
$text = "
2012-11-26 15:43:42 -08:00
< div >
2007-02-07 21:48:26 +00:00
< form method = 'post' action = '".e_SELF."?options' >
2012-11-26 15:43:42 -08:00
< table class = 'table adminform' >
2007-02-07 21:48:26 +00:00
< colgroup >
2012-12-07 16:34:49 +01:00
< col style = ' width : 30 % ; />
< col style = ' width : 70 % ; />
2007-02-07 21:48:26 +00:00
</ colgroup >
< tr >
2012-11-26 15:43:42 -08:00
< td > " .LWLAN_26. " </ td >
< td > " ;
2007-02-07 21:48:26 +00:00
foreach ( $lw_context_areas as $lw_key => $lw_desc )
{
2010-01-16 20:49:55 +00:00
$checked = $pref [ 'lw_context_visibility' ][ $lw_key ] ? " checked='checked' " : '' ;
2013-02-03 14:19:24 +01:00
$text .= " <input type='checkbox' name='lw_visibility_area[]' value=' { $lw_key } ' { $checked } /> { $lw_desc } <br /> " ;
2007-02-07 21:48:26 +00:00
}
2013-02-03 14:19:24 +01:00
$text .= " <span class='field-help'> " . LWLAN_27 . " </span></td>
2007-02-07 21:48:26 +00:00
</ tr >
< tr >
2012-11-26 15:43:42 -08:00
< td > " .LWLAN_28. " </ td >
2012-12-07 16:34:49 +01:00
< td >< textarea rows = '5' cols = '60' class = 'tbox' name = 'linkword_omit_pages' > " . $menu_pages . " </ textarea >< span class = 'field-help' > " .LWLAN_29. " </ span >
2007-02-07 21:48:26 +00:00
</ td >
2008-12-07 21:55:02 +00:00
</ tr > " ;
$checked = varset ( $pref [ 'lw_ajax_enable' ], 0 ) ? 'checked=checked' : '' ;
$text .= "
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_59. " </ td >
< td >< input type = 'checkbox' name = 'lw_ajax_enable' { $checked } /></ td >
2010-01-16 20:49:55 +00:00
</ tr > " ;
$checked = varset ( $pref [ 'lw_notsamepage' ], 0 ) ? 'checked=checked' : '' ;
$text .= "
< tr >
2012-12-07 16:34:49 +01:00
< td > " .LWLAN_64. " </ td >
< td >< input type = 'checkbox' name = 'lw_notsamepage' { $checked } />< span class = 'field-help' > " .LWLAN_65. " </ span ></ td >
2007-02-07 21:48:26 +00:00
</ tr >
</ table >
2012-11-26 15:43:42 -08:00
< div class = 'buttons-bar center' >
2013-02-03 14:19:24 +01:00
" . $frm->admin_button ('saveopts_linkword','no-value','submit', LAN_UPDATE). "
2012-11-26 15:43:42 -08:00
</ div >
2007-02-07 21:48:26 +00:00
</ form >
</ div > \n " ;
2013-02-06 17:43:46 +01:00
$ns -> tablerender ( LAN_OPTIONS , $text );
2007-02-07 21:48:26 +00:00
}
2015-04-04 18:58:43 -07:00
function admin_config_adminmenu ()
2007-02-07 21:48:26 +00:00
{
if ( e_QUERY )
{
$tmp = explode ( " . " , e_QUERY );
$action = $tmp [ 0 ];
}
if ( ! isset ( $action ) || ( $action == " " ))
{
$action = " words " ;
}
$var [ 'words' ][ 'text' ] = LWLAN_24 ;
$var [ 'words' ][ 'link' ] = " admin_config.php " ;
2013-02-06 17:43:46 +01:00
$var [ 'options' ][ 'text' ] = LAN_OPTIONS ;
2007-02-07 21:48:26 +00:00
$var [ 'options' ][ 'link' ] = " admin_config.php?options " ;
show_admin_menu ( LWLAN_23 , $action , $var );
}
2006-12-02 04:36:16 +00:00
require_once ( e_ADMIN . " footer.php " );
2015-04-04 18:58:43 -07:00
*/
2006-12-02 04:36:16 +00:00
?>