1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

work on sitedown

This commit is contained in:
marj
2009-10-28 16:57:51 +00:00
parent 785018a6db
commit 4ccabca5a9
4 changed files with 691 additions and 628 deletions

View File

@@ -9,16 +9,16 @@
* Administration - Site Maintenance * Administration - Site Maintenance
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/ugflag.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/ugflag.php,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2009-09-27 21:18:37 $ * $Date: 2009-10-28 16:57:51 $
* $Author: e107coders $ * $Author: marj_nl_fr $
* *
*/ */
require_once ("../class2.php"); require_once ("../class2.php");
if(!getperms("9")) if(!getperms("9"))
{ {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
exit; exit();
} }
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
@@ -59,12 +59,13 @@ if (isset($_POST['updatesettings']))
save_prefs(); save_prefs();
$emessage->$emessage_method(UGFLAN_1, E_MESSAGE_SUCCESS); $emessage->$emessage_method(UGFLAN_1, E_MESSAGE_SUCCESS);
} }
else $emessage->$emessage_method(UGFLAN_7); else
$emessage->$emessage_method(UGFLAN_7);
if(!e_AJAX_REQUEST) if(!e_AJAX_REQUEST)
{ {
header("location:".e_SELF); header("location:".e_SELF);
exit; exit();
} }
} }
@@ -79,30 +80,20 @@ $text = "
<col class='col-label' /> <col class='col-label' />
<col class='col-control' /> <col class='col-control' />
</colgroup> </colgroup>
<tbody> <tbody>";
$elements = array(e_UC_PUBLIC=>LAN_DISABLED,
e_UC_ADMIN=>UGFLAN_8,
e_UC_MAINADMIN=>UGFLAN_9);
$text .= "
<tr> <tr>
<td class='label'>".UGFLAN_2.": </td> <td class='label'>".UGFLAN_2.": </td>
<td class='control'> <td class='control'>
<div class='auto-toggle-area autocheck'> ".$frm->radio_multi('maintainance_flag', $elements, $pref['maintainance_flag'], TRUE)."
".$frm->checkbox('maintainance_flag', '1', $pref['maintainance_flag'])."
</div>
</td> </td>
</tr>"; </tr>";
if(getperms('0'))
{
$text .= "<tr>
<td class='label'>".UGFLAN_8.":
</td>
<td class='control'>
<div class='auto-toggle-area autocheck'>
".$frm->checkbox('main_admin_only', '1', $pref['main_admin_only'])."
</div>
<div class='field-help'>".UGFLAN_9."</div>
</td>
</tr>";
}
$text .= " $text .= "
<tr> <tr>
@@ -131,7 +122,7 @@ if(!e_AJAX_REQUEST)
$e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag'); $e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag');
echo "\n</div>"; echo "\n</div>";
require_once (e_ADMIN."footer.php"); require_once (e_ADMIN."footer.php");
exit; exit();
} }
$e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag'); $e107->ns->tablerender(UGFLAN_4, $emessage->render().$text, 'core-ugflag');

View File

@@ -9,13 +9,16 @@
* Form Handler * Form Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.58 $ * $Revision: 1.59 $
* $Date: 2009-10-26 07:26:47 $ * $Date: 2009-10-28 16:57:51 $
* $Author: e107coders $ * $Author: marj_nl_fr $
* *
*/ */
if (!defined('e107_INIT')) { exit; } if(!defined('e107_INIT'))
{
exit;
}
//FIXME hardcoded text //FIXME hardcoded text
/** /**
* Automate Form fields creation. Produced markup is following e107 CSS/XHTML standards * Automate Form fields creation. Produced markup is following e107 CSS/XHTML standards
@@ -234,7 +237,8 @@ class e_form
function uc_checkbox($name, $current_value, $uc_options, $field_options = array()) function uc_checkbox($name, $current_value, $uc_options, $field_options = array())
{ {
if(!is_array($field_options)) parse_str($field_options, $field_options); if(!is_array($field_options))
parse_str($field_options, $field_options);
return ' return '
<div class="check-block"> <div class="check-block">
'.$this->_uc->vetted_tree($name, array($this, '_uc_checkbox_cb'), $current_value, $uc_options, $field_options).' '.$this->_uc->vetted_tree($name, array($this, '_uc_checkbox_cb'), $current_value, $uc_options, $field_options).'
@@ -260,7 +264,8 @@ class e_form
} }
$descr = varset($field_options['description']) ? ' <span class="smalltext">('.$this->_uc->uc_get_classdescription($classnum).')</span>' : ''; $descr = varset($field_options['description']) ? ' <span class="smalltext">('.$this->_uc->uc_get_classdescription($classnum).')</span>' : '';
return "<div class='field-spacer{$class}'{$style}>".$this->checkbox($treename.'[]', $classnum, in_array($classnum, $tmp), $field_options).$this->label($this->_uc->uc_get_classname($classnum).$descr, $treename.'[]', $classnum)."</div>\n"; return "<div class='field-spacer{$class}'{$style}>".$this->checkbox($treename.'[]', $classnum, in_array($classnum, $tmp), $field_options).$this->label($this->_uc->uc_get_classname($classnum).$descr,
$treename.'[]', $classnum)."</div>\n";
} }
@@ -284,10 +289,11 @@ class e_form
} }
function radio_multi($name, $elements, $checked, $multi_line = false) function radio_multi($name, $elements, $checked, $multi_line = FALSE)
{ {
$text = array(); $text = array();
if(is_string($elements)) parse_str($elements, $elements); if(is_string($elements))
parse_str($elements, $elements);
foreach ($elements as $value=>$label) foreach ($elements as $value=>$label)
{ {
@@ -316,14 +322,16 @@ class e_form
{ {
if($option_array == 'yesno') if($option_array == 'yesno')
{ {
$option_array = array(1=>LAN_YES,0=>LAN_NO); $option_array = array(1=>LAN_YES,
0=>LAN_NO);
} }
return $this->select_open($name, $options)."\n".$this->option_multi($option_array, $selected)."\n".$this->select_close(); return $this->select_open($name, $options)."\n".$this->option_multi($option_array, $selected)."\n".$this->select_close();
} }
function uc_select($name, $current_value, $uc_options, $select_options = array(), $opt_options = array()) function uc_select($name, $current_value, $uc_options, $select_options = array(), $opt_options = array())
{ {
return $this->select_open($name, $select_options)."\n".$this->_uc->vetted_tree($name, array($this, '_uc_select_cb'), $current_value, $uc_options, $opt_options)."\n".$this->select_close(); return $this->select_open($name, $select_options)."\n".$this->_uc->vetted_tree($name, array($this, '_uc_select_cb'), $current_value, $uc_options,
$opt_options)."\n".$this->select_close();
} }
// Callback for vetted_tree - Creates the option list for a selection box // Callback for vetted_tree - Creates the option list for a selection box
@@ -358,7 +366,8 @@ class e_form
function option($option_title, $value, $selected = false, $options = array()) function option($option_title, $value, $selected = false, $options = array())
{ {
if(false === $value) $value = ''; if(false === $value)
$value = '';
$options = $this->format_options('option', '', $options); $options = $this->format_options('option', '', $options);
$options['selected'] = $selected; //comes as separate argument just for convenience $options['selected'] = $selected; //comes as separate argument just for convenience
return "<option value='{$value}'".$this->get_attributes($options).">{$option_title}</option>"; return "<option value='{$value}'".$this->get_attributes($options).">{$option_title}</option>";
@@ -366,7 +375,8 @@ class e_form
function option_multi($option_array, $selected = false, $options = array()) function option_multi($option_array, $selected = false, $options = array())
{ {
if(is_string($option_array)) parse_str($option_array, $option_array); if(is_string($option_array))
parse_str($option_array, $option_array);
$text = ''; $text = '';
foreach ($option_array as $value=>$label) foreach ($option_array as $value=>$label)
@@ -402,7 +412,8 @@ class e_form
function submit_image($name, $value, $image, $title = '', $options = array()) function submit_image($name, $value, $image, $title = '', $options = array())
{ {
$options = $this->format_options('submit_image', $name, $options); $options = $this->format_options('submit_image', $name, $options);
switch ($image) { switch($image)
{
case 'edit': case 'edit':
$image = ADMIN_EDIT_ICON_PATH; $image = ADMIN_EDIT_ICON_PATH;
$options['class'] = 'action edit'; $options['class'] = 'action edit';
@@ -425,15 +436,17 @@ class e_form
* @param object $action [optional] default is submit * @param object $action [optional] default is submit
* @param object $label [optional] * @param object $label [optional]
* @param object $options [optional] * @param object $options [optional]
* @return * @return string
*/ */
function admin_button($name, $value, $action = 'submit', $label = '', $options = array()) function admin_button($name, $value, $action = 'submit', $label = '', $options = array())
{ {
$btype = 'submit'; $btype = 'submit';
if(strpos($action, 'action') === 0) $btype = 'button'; if(strpos($action, 'action') === 0)
$btype = 'button';
$options = $this->format_options('admin_button', $name, $options); $options = $this->format_options('admin_button', $name, $options);
$options['class'] = $action;//shorthand $options['class'] = $action;//shorthand
if(empty($label)) $label = $value; if( empty($label))
$label = $value;
return " return "
<button type='{$btype}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name)."><span>{$label}</span></button> <button type='{$btype}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name)."><span>{$label}</span></button>
@@ -442,14 +455,16 @@ class e_form
function getNext() function getNext()
{ {
if(!$this->_tabindex_enabled) return 0; if(!$this->_tabindex_enabled)
return 0;
$this->_tabindex_counter += 1; $this->_tabindex_counter += 1;
return $this->_tabindex_counter; return $this->_tabindex_counter;
} }
function getCurrent() function getCurrent()
{ {
if(!$this->_tabindex_enabled) return 0; if(!$this->_tabindex_enabled)
return 0;
return $this->_tabindex_counter; return $this->_tabindex_counter;
} }
@@ -464,31 +479,38 @@ class e_form
// //
foreach ($options as $option=>$optval) foreach ($options as $option=>$optval)
{ {
switch ($option) { switch($option)
{
case 'id': case 'id':
$ret .= $this->_format_id($optval, $name, $value); $ret .= $this->_format_id($optval, $name, $value);
break; break;
case 'class': case 'class':
if(!empty($optval)) $ret .= " class='{$optval}'"; if(! empty($optval))
$ret .= " class='{$optval}'";
break; break;
case 'size': case 'size':
if($optval) $ret .= " size='{$optval}'"; if($optval)
$ret .= " size='{$optval}'";
break; break;
case 'title': case 'title':
if($optval) $ret .= " title='{$optval}'"; if($optval)
$ret .= " title='{$optval}'";
break; break;
case 'label': case 'label':
if($optval) $ret .= " label='{$optval}'"; if($optval)
$ret .= " label='{$optval}'";
break; break;
case 'tabindex': case 'tabindex':
if($optval) $ret .= " tabindex='{$optval}'"; if($optval)
elseif(false === $optval || !$this->_tabindex_enabled) break; $ret .= " tabindex='{$optval}'";
elseif(false === $optval || !$this->_tabindex_enabled)
break;
else else
{ {
$this->_tabindex_counter += 1; $this->_tabindex_counter += 1;
@@ -497,23 +519,28 @@ class e_form
break; break;
case 'readonly': case 'readonly':
if($optval) $ret .= " readonly='readonly'"; if($optval)
$ret .= " readonly='readonly'";
break; break;
case 'selected': case 'selected':
if($optval) $ret .= " selected='selected'"; if($optval)
$ret .= " selected='selected'";
break; break;
case 'checked': case 'checked':
if($optval) $ret .= " checked='checked'"; if($optval)
$ret .= " checked='checked'";
break; break;
case 'disabled': case 'disabled':
if($optval) $ret .= " disabled='disabled'"; if($optval)
$ret .= " disabled='disabled'";
break; break;
case 'other': case 'other':
if($optval) $ret .= " $optval"; if($optval)
$ret .= " $optval";
break; break;
} }
} }
@@ -531,17 +558,22 @@ class e_form
*/ */
function _format_id($id_value, $name, $value = '', $return_attribute = 'id') function _format_id($id_value, $name, $value = '', $return_attribute = 'id')
{ {
if($id_value === false) return ''; if($id_value === false)
return '';
//format data first //format data first
$name = $this->name2id($name); $name = $this->name2id($name);
$value = trim(preg_replace('#[^a-z0-9\-]/i#', '-', $value), '-'); $value = trim(preg_replace('#[^a-z0-9\-]/i#', '-', $value), '-');
$value = str_replace("/", "-", $value); $value = str_replace("/", "-", $value);
if(!$id_value && is_numeric($value)) $id_value = $value; if(!$id_value && is_numeric($value))
$id_value = $value;
if(empty($id_value) ) return " {$return_attribute}='{$name}".($value ? "-{$value}" : '')."'";// also useful when name is e.g. name='my_name[some_id]' if( empty($id_value))
elseif(is_numeric($id_value) && $name) return " {$return_attribute}='{$name}-{$id_value}'";// also useful when name is e.g. name='my_name[]' return " {$return_attribute}='{$name}".($value ? "-{$value}" : '')."'";// also useful when name is e.g. name='my_name[some_id]'
else return " {$return_attribute}='{$id_value}'"; elseif(is_numeric($id_value) && $name)
return " {$return_attribute}='{$name}-{$id_value}'";// also useful when name is e.g. name='my_name[]'
else
return " {$return_attribute}='{$id_value}'";
} }
function name2id($name) function name2id($name)
@@ -561,13 +593,15 @@ class e_form
*/ */
function format_options($type, $name, $user_options) function format_options($type, $name, $user_options)
{ {
if(is_string($user_options)) parse_str($user_options, $user_options); if(is_string($user_options))
parse_str($user_options, $user_options);
$def_options = $this->_default_options($type); $def_options = $this->_default_options($type);
foreach (array_keys($user_options) as $key) foreach (array_keys($user_options) as $key)
{ {
if(!isset($def_options[$key])) unset($user_options[$key]);//remove it? if(!isset($def_options[$key]))
unset($user_options[$key]);//remove it?
} }
$user_options['name'] = $name; //required for some of the automated tasks $user_options['name'] = $name; //required for some of the automated tasks
@@ -582,10 +616,10 @@ class e_form
*/ */
function _default_options($type) function _default_options($type)
{ {
if(isset($this->_cached_attributes[$type])) return $this->_cached_attributes[$type]; if(isset($this->_cached_attributes[$type]))
return $this->_cached_attributes[$type];
$def_options = array( $def_options = array('id'=>'',
'id' => '',
'class'=>'', 'class'=>'',
'title'=>'', 'title'=>'',
'size'=>'', 'size'=>'',
@@ -595,12 +629,14 @@ class e_form
'disabled'=>false, 'disabled'=>false,
'tabindex'=>0, 'tabindex'=>0,
'label'=>'', 'label'=>'',
'other' => '' 'other'=>'');
);
switch ($type) { switch($type)
{
case 'hidden': case 'hidden':
$def_options = array('id' => false, 'disabled' => false, 'other' => ''); $def_options = array('id'=>false,
'disabled'=>false,
'other'=>'');
break; break;
case 'text': case 'text':
@@ -624,7 +660,11 @@ class e_form
break; break;
case 'option': case 'option':
$def_options = array('class' => '', 'selected' => false, 'other' => '', 'disabled' => false, 'label' => ''); $def_options = array('class'=>'',
'selected'=>false,
'other'=>'',
'disabled'=>false,
'label'=>'');
break; break;
case 'radio': case 'radio':
@@ -658,17 +698,12 @@ class e_form
} }
function columnSelector($columnsArray, $columnsDefault = '', $id = 'column_options') function columnSelector($columnsArray, $columnsDefault = '', $id = 'column_options')
{ {
$columnsArray = array_filter($columnsArray); $columnsArray = array_filter($columnsArray);
$text = " $text = "
<div class='col-selection-cont'> <div class='col-selection-cont'>
<a href='#".$id."' class='e-show-if-js e-expandit' title='Click to select columns to display'>" <a href='#".$id."' class='e-show-if-js e-expandit' title='Click to select columns to display'>"."<img class='icon' src='".e_IMAGE_ABS."admin_images/select_columns_16.png' alt='select columns' />"."</a>
."<img class='icon' src='".e_IMAGE_ABS."admin_images/select_columns_16.png' alt='select columns' />"
."</a>
<div id='".$id."' class='e-show-if-js e-hideme col-selection'><div class='col-selection-body'> <div id='".$id."' class='e-show-if-js e-hideme col-selection'><div class='col-selection-body'>
"; ";
unset($columnsArray['options'], $columnsArray['checkboxes']); unset($columnsArray['options'], $columnsArray['checkboxes']);
@@ -761,7 +796,10 @@ class e_form
} }
} }
if(!varset($fromval)){ $fromval = 0; } if(!varset($fromval))
{
$fromval = 0;
}
$ascdesc = (varset($ascdesc) == 'desc') ? 'asc' : 'desc'; $ascdesc = (varset($ascdesc) == 'desc') ? 'asc' : 'desc';
foreach ($fieldarray as $key=>$val) foreach ($fieldarray as $key=>$val)
@@ -776,8 +814,12 @@ class e_form
if($querypattern != "" && !varsettrue($val['nosort']) && $key != "options" && $key != "checkboxes") if($querypattern != "" && !varsettrue($val['nosort']) && $key != "options" && $key != "checkboxes")
{ {
$from = ($key == $field) ? $fromval : 0; $from = ($key == $field) ? $fromval : 0;
$srch = array("[FIELD]","[ASC]","[FROM]"); $srch = array("[FIELD]",
$repl = array($key,$ascdesc,$from); "[ASC]",
"[FROM]");
$repl = array($key,
$ascdesc,
$from);
$val['url'] = e_SELF."?".str_replace($srch, $repl, $querypattern); $val['url'] = e_SELF."?".str_replace($srch, $repl, $querypattern);
} }
@@ -842,7 +884,8 @@ class e_form
$parms = array(); $parms = array();
if(isset($data['colparms'])) //TODO rename to 'parms'. if(isset($data['colparms'])) //TODO rename to 'parms'.
{ {
if(!is_array($data['colparms'])) parse_str($data['colparms'], $data['colparms']); if(!is_array($data['colparms']))
parse_str($data['colparms'], $data['colparms']);
$parms = $data['colparms']; $parms = $data['colparms'];
} }
@@ -893,7 +936,8 @@ class e_form
break; break;
case 'boolean': case 'boolean':
$value = $value ? ADMIN_TRUE_ICON : '';// TODO - ADMIN_FALSE_ICON $value = $value ? ADMIN_TRUE_ICON:
'';// TODO - ADMIN_FALSE_ICON
break; break;
case 'url': case 'url':
@@ -965,7 +1009,8 @@ class e_form
if($type) if($type)
{ {
switch ($fields[$type]['type']) { switch($fields[$type]['type'])
{
case "datestamp": case "datestamp":
return "[date field]"; return "[date field]";
break; break;
@@ -1004,7 +1049,8 @@ class e_form
* @param array ucOptions [optional] associative array of userclass option groups to display, keyed on the option value prefix * @param array ucOptions [optional] associative array of userclass option groups to display, keyed on the option value prefix
* @return string the HTML for the form component * @return string the HTML for the form component
*/ */
function batchoptions($options, $ucOptions=null) { function batchoptions($options, $ucOptions = null)
{
$text = " $text = "
<div class='f-left'> <div class='f-left'>
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' /> <img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' />
@@ -1032,12 +1078,14 @@ class e_form
} }
if(!is_array($val)) if(!is_array($val))
{ {
if($disabled) $val = $val.' ('.LAN_NOPERMISSION.')'; if($disabled)
$val = $val.' ('.LAN_NOPERMISSION.')';
$text .= "\t".$this->option('&nbsp;&nbsp;&nbsp;&nbsp;'.$val, $key, false, array('disabled'=>$disabled))."\n"; $text .= "\t".$this->option('&nbsp;&nbsp;&nbsp;&nbsp;'.$val, $key, false, array('disabled'=>$disabled))."\n";
} }
else else
{ {
if($disabled) $val[0] = $val[0].' ('.LAN_NOPERMISSION.')'; if($disabled)
$val[0] = $val[0].' ('.LAN_NOPERMISSION.')';
$text .= "\t".$this->optgroup_open($val[0], $disabled)."\n"; $text .= "\t".$this->optgroup_open($val[0], $disabled)."\n";
foreach ($val[1] as $k=>$v) foreach ($val[1] as $k=>$v)
@@ -1080,16 +1128,20 @@ class e_form
} }
} }
class form { class form
{
function form_open($form_method, $form_action, $form_name = "", $form_target = "", $form_enctype = "", $form_js = "") { function form_open($form_method, $form_action, $form_name = "", $form_target = "", $form_enctype = "", $form_js = "")
{
$method = ($form_method ? "method='".$form_method."'" : ""); $method = ($form_method ? "method='".$form_method."'" : "");
$target = ($form_target ? " target='".$form_target."'" : ""); $target = ($form_target ? " target='".$form_target."'" : "");
$name = ($form_name ? " id='".$form_name."' " : " id='myform'"); $name = ($form_name ? " id='".$form_name."' " : " id='myform'");
return "\n<form action='".$form_action."' ".$method.$target.$name.$form_enctype.$form_js.">"; return "\n<form action='".$form_action."' ".$method.$target.$name.$form_enctype.$form_js.">";
} }
function form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") { function form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "",
$form_js = "")
{
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$value = (isset($form_value) ? " value='".$form_value."'" : ""); $value = (isset($form_value) ? " value='".$form_value."'" : "");
$size = ($form_size ? " size='".$form_size."'" : ""); $size = ($form_size ? " size='".$form_size."'" : "");
@@ -1099,7 +1151,9 @@ class form {
return "\n<input class='".$form_class."' type='text' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />"; return "\n<input class='".$form_class."' type='text' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
} }
function form_password($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") { function form_password($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = "tbox", $form_readonly = "", $form_tooltip = "",
$form_js = "")
{
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$value = (isset($form_value) ? " value='".$form_value."'" : ""); $value = (isset($form_value) ? " value='".$form_value."'" : "");
$size = ($form_size ? " size='".$form_size."'" : ""); $size = ($form_size ? " size='".$form_size."'" : "");
@@ -1109,14 +1163,17 @@ class form {
return "\n<input class='".$form_class."' type='password' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />"; return "\n<input class='".$form_class."' type='password' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
} }
function form_button($form_type, $form_name, $form_value, $form_js = "", $form_image = "", $form_tooltip = "") { function form_button($form_type, $form_name, $form_value, $form_js = "", $form_image = "", $form_tooltip = "")
{
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$image = ($form_image ? " src='".$form_image."' " : ""); $image = ($form_image ? " src='".$form_image."' " : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."' " : ""); $tooltip = ($form_tooltip ? " title='".$form_tooltip."' " : "");
return "\n<input class='button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />"; return "\n<input class='button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />";
} }
function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = "", $form_style = "", $form_wrap = "", $form_readonly = "", $form_tooltip = "") { function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = "", $form_style = "", $form_wrap = "", $form_readonly = "",
$form_tooltip = "")
{
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$readonly = ($form_readonly ? " readonly='readonly'" : ""); $readonly = ($form_readonly ? " readonly='readonly'" : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : ""); $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
@@ -1125,7 +1182,8 @@ class form {
return "\n<textarea class='tbox' cols='".$form_columns."' rows='".$form_rows."' ".$name.$form_js.$style.$wrap.$readonly.$tooltip.">".$form_value."</textarea>"; return "\n<textarea class='tbox' cols='".$form_columns."' rows='".$form_rows."' ".$name.$form_js.$style.$wrap.$readonly.$tooltip.">".$form_value."</textarea>";
} }
function form_checkbox($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "") { function form_checkbox($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "")
{
$name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
$checked = ($form_checked ? " checked='checked'" : ""); $checked = ($form_checked ? " checked='checked'" : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : ""); $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
@@ -1133,7 +1191,8 @@ class form {
} }
function form_radio($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "") { function form_radio($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "")
{
$name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
$checked = ($form_checked ? " checked='checked'" : ""); $checked = ($form_checked ? " checked='checked'" : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : ""); $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
@@ -1141,31 +1200,37 @@ class form {
} }
function form_file($form_name, $form_size, $form_tooltip = "", $form_js = "") { function form_file($form_name, $form_size, $form_tooltip = "", $form_js = "")
{
$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ""); $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : ""); $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
return "<input type='file' class='tbox' size='".$form_size."'".$name.$tooltip.$form_js." />"; return "<input type='file' class='tbox' size='".$form_size."'".$name.$tooltip.$form_js." />";
} }
function form_select_open($form_name, $form_js = "") { function form_select_open($form_name, $form_js = "")
{
return "\n<select id='".$form_name."' name='".$form_name."' class='tbox' ".$form_js." >"; return "\n<select id='".$form_name."' name='".$form_name."' class='tbox' ".$form_js." >";
} }
function form_select_close() { function form_select_close()
{
return "\n</select>"; return "\n</select>";
} }
function form_option($form_option, $form_selected = "", $form_value = "", $form_js = "") { function form_option($form_option, $form_selected = "", $form_value = "", $form_js = "")
{
$value = ($form_value !== FALSE ? " value='".$form_value."'" : ""); $value = ($form_value !== FALSE ? " value='".$form_value."'" : "");
$selected = ($form_selected ? " selected='selected'" : ""); $selected = ($form_selected ? " selected='selected'" : "");
return "\n<option".$value.$selected." ".$form_js.">".$form_option."</option>"; return "\n<option".$value.$selected." ".$form_js.">".$form_option."</option>";
} }
function form_hidden($form_name, $form_value) { function form_hidden($form_name, $form_value)
{
return "\n<input type='hidden' id='".$form_name."' name='".$form_name."' value='".$form_value."' />"; return "\n<input type='hidden' id='".$form_name."' name='".$form_name."' value='".$form_value."' />";
} }
function form_close() { function form_close()
{
return "\n</form>"; return "\n</form>";
} }
} }

View File

@@ -3,17 +3,17 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <EFBFBD>Steve Dunstan 2001-2002 | Copyright (C) 2001-2009 e107 Inc
| http://e107.org | http://e107.org
| jalist@e107.org |
| |
| Released under the terms and conditions of the | Released under the terms and conditions of the
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/redirection_class.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2009-10-20 03:59:20 $ | $Date: 2009-10-28 16:57:51 $
| $Author: e107coders $ | $Author: marj_nl_fr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -23,10 +23,11 @@ class redirection
var $self_exceptions = array(); var $self_exceptions = array();
var $page_exceptions = array(); var $page_exceptions = array();
/** /**
* Manage Member-Only Mode. * Manage Member-Only Mode.
* @return void
*/ */
function __construct() function __construct()
{ {
$this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php'); $this->self_exceptions = array(SITEURL.e_SIGNUP, SITEURL.'index.php', SITEURL.'fpw.php', SITEURL.e_LOGIN, SITEURL.'membersonly.php');
@@ -35,7 +36,7 @@ class redirection
/** /**
* Perform re-direction when Maintenance Mode is active. * Perform re-direction when Maintenance Mode is active.
* @return * @return void
*/ */
public function checkMaintenance() public function checkMaintenance()
{ {
@@ -66,8 +67,9 @@ class redirection
} }
/** check if user is logged in. /**
* * check if user is logged in.
* @return void
*/ */
public function checkMembersOnly() public function checkMembersOnly()
@@ -112,9 +114,9 @@ class redirection
$this->redirect(e_HTTP.'membersonly.php'); $this->redirect(e_HTTP.'membersonly.php');
} }
/** Store the current URL so that it can retrieved after login. /**
* @param * Store the current URL so that it can retrieved after login.
* @return * @return void
*/ */
private function saveMembersOnlyUrl() private function saveMembersOnlyUrl()
@@ -126,9 +128,9 @@ class redirection
} }
/** Restore the previously saved URL, and redirect the User to it after login. /**
* @param * Restore the previously saved URL, and redirect the User to it after login.
* @return * @return void
*/ */
private function restoreMembersOnlyUrl() private function restoreMembersOnlyUrl()
@@ -148,4 +150,3 @@ class redirection
exit(); exit();
} }
} }
?>

View File

@@ -1,22 +1,28 @@
<?php <?php
/* /*
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system - Language File. | e107 website system
|
| Copyright (C) 2001-2009 e107 Inc
| http://e107.org
|
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_ugflag.php,v $ | $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_ugflag.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2009-09-27 21:18:42 $ | $Date: 2009-10-28 16:57:51 $
| $Author: e107coders $ | $Author: marj_nl_fr $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
define("UGFLAN_1", "Maintenance settings updated"); define('UGFLAN_1', 'Maintenance settings updated');
define("UGFLAN_2", "Activate maintenance flag"); define('UGFLAN_2', 'Activate maintenance flag');
define("UGFLAN_3", "Update Maintenance Setting"); define('UGFLAN_3', 'Update Maintenance Setting');
define("UGFLAN_4", "Maintenance Setting"); define('UGFLAN_4', 'Maintenance Setting');
define("UGFLAN_5", "Text to display when site down"); define('UGFLAN_5', 'Text to display when site down');
define("UGFLAN_6", "Leave blank to display default message"); define('UGFLAN_6', 'Leave blank to display default message');
define("UGFLAN_7","Update unsuccessful as no changes were made."); define('UGFLAN_7', 'Update unsuccessful as no changes were made.');
define("UGFLAN_8","Limit access to Main-Admins only"); define('UGFLAN_8', 'Limit access to Admins only');
define("UGFLAN_9","Only Main-Admins will be able to login while the maintenance mode is active."); define('UGFLAN_9', 'Limit access to Main-Admins only');
?>