aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/cat_modify.php16
-rw-r--r--admin/include/check_integrity.class.php4
-rw-r--r--admin/notification_by_mail.php62
-rw-r--r--admin/user_list.php34
4 files changed, 37 insertions, 79 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 7492633b1..b34868657 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
@@ -208,19 +208,17 @@ $category['is_virtual'] = empty($category['dir']) ? true : false;
// Navigation path
-$url = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id=';
-
$navigation = get_cat_display_name_cache(
$category['uppercats'],
- PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='
+ get_root_url().'admin.php?page=cat_modify&cat_id='
);
-$form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$_GET['cat_id'];
+$form_action = get_root_url().'admin.php?page=cat_modify&cat_id='.$_GET['cat_id'];
//----------------------------------------------------- template initialization
$template->set_filename( 'categories', 'admin/cat_modify.tpl');
-$base_url = PHPWG_ROOT_PATH.'admin.php?page=';
+$base_url = get_root_url().'admin.php?page=';
$cat_list_url = $base_url.'cat_list';
$self_url = $cat_list_url;
@@ -236,8 +234,6 @@ $template->assign(
'CAT_COMMENT' => @htmlspecialchars($category['comment']),
'status_values' => array('public','private'),
- 'false_true' => array('false', 'true'),
- 'no_yes' => array('no','yes'),
'CAT_STATUS' => $category['status'],
'CAT_VISIBLE' => $category['visible'],
@@ -256,7 +252,7 @@ $template->assign(
'MAIL_CONTENT' => empty($_POST['mail_content'])
? '' : stripslashes($_POST['mail_content']),
'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'],
- 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=cat_modify',
+ 'U_HELP' => get_root_url().'popuphelp.php?page=cat_modify',
'F_ACTION' => $form_action,
)
@@ -367,7 +363,7 @@ SELECT id,tn_ext,path
;';
$row = mysql_fetch_array(pwg_query($query));
$src = get_thumbnail_url($row);
- $url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
+ $url = get_root_url().'admin.php?page=picture_modify';
$url.= '&image_id='.$category['representative_picture_id'];
$tpl_representant['picture'] =
diff --git a/admin/include/check_integrity.class.php b/admin/include/check_integrity.class.php
index 52c7f2642..db6584ade 100644
--- a/admin/include/check_integrity.class.php
+++ b/admin/include/check_integrity.class.php
@@ -259,14 +259,14 @@ class check_integrity
{
$submit_ignore = true;
}
-
+
$template->append('c13y_list', $c13y_display);
}
$template->assign('c13y_show_submit_automatic_correction', $submit_automatic_correction);
$template->assign('c13y_show_submit_ignore', $submit_ignore);
- $template->concat_var('ADMIN_CONTENT', $template->parse('check_integrity', true));
+ $template->concat('ADMIN_CONTENT', $template->parse('check_integrity', true));
}
}
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index 9dae9b692..f728c69d0 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -582,7 +582,7 @@ $template->set_filenames
)
);
-$template->assign_vars
+$template->assign
(
array
(
@@ -628,43 +628,30 @@ if ($must_repost)
$repost_submit_name = 'send_submit';
}
- $template->assign_block_vars
- (
- 'repost',
- array
- (
- 'REPOST_SUBMIT_NAME' => $repost_submit_name
- )
- );
+ $template->assign('REPOST_SUBMIT_NAME', $repost_submit_name);
}
switch ($page['mode'])
{
case 'param' :
{
- $template->assign_block_vars(
+ $template->assign(
$page['mode'],
array(
- 'SEND_HTML_MAIL_YES' => ($conf['nbm_send_html_mail'] ? 'checked="checked"' : ''),
- 'SEND_HTML_MAIL_NO' => (!$conf['nbm_send_html_mail'] ? 'checked="checked"' : ''),
+ 'SEND_HTML_MAIL' => $conf['nbm_send_html_mail'],
'SEND_MAIL_AS' => $conf['nbm_send_mail_as'],
- 'SEND_DETAILED_CONTENT_YES' => ($conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
- 'SEND_DETAILED_CONTENT_NO' => (!$conf['nbm_send_detailed_content'] ? 'checked="checked"' : ''),
+ 'SEND_DETAILED_CONTENT' => $conf['nbm_send_detailed_content'],
'COMPLEMENTARY_MAIL_CONTENT' => $conf['nbm_complementary_mail_content'],
- 'SEND_RECENT_POST_DATES_YES' => ($conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : ''),
- 'SEND_RECENT_POST_DATES_NO' => (!$conf['nbm_send_recent_post_dates'] ? 'checked="checked"' : '')
+ 'SEND_RECENT_POST_DATES' => $conf['nbm_send_recent_post_dates'],
));
break;
}
case 'subscribe' :
{
- $template->assign_block_vars(
- $page['mode'],
- array(
- ));
+ $template->assign( $page['mode'], true );
- $template->assign_vars(
+ $template->assign(
array(
'L_CAT_OPTIONS_TRUE' => l10n('nbm_subscribe_col'),
'L_CAT_OPTIONS_FALSE' => l10n('nbm_unsubscribe_col')
@@ -700,41 +687,35 @@ switch ($page['mode'])
'category_option_true' => $opt_true,
'category_option_true_selected' => $opt_true_selected,
'category_option_false' => $opt_false,
- 'category_option_true_selected' => $opt_false_selected,
+ 'category_option_false_selected' => $opt_false_selected,
)
);
+ $template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
break;
}
case 'send' :
{
- $template->assign_block_vars($page['mode'], array());
+ $tpl_var = array('users'=> array() );
$data_users = do_action_send_mail_notification('list_to_send');
- if (count($data_users) == 0)
- {
- $template->assign_block_vars($page['mode'].'.send_empty', array());
- }
- else
- {
- $template->assign_block_vars(
- $page['mode'].'.send_data',
- array(
- 'CUSTOMIZE_MAIL_CONTENT' => isset($_POST['send_customize_mail_content']) ? stripslashes($_POST['send_customize_mail_content']) : $conf['nbm_complementary_mail_content']
- ));
+ $tpl_var['CUSTOMIZE_MAIL_CONTENT'] =
+ isset($_POST['send_customize_mail_content'])
+ ? stripslashes($_POST['send_customize_mail_content'])
+ : $conf['nbm_complementary_mail_content'];
- foreach ($data_users as $num => $nbm_user)
+ if (count($data_users))
+ {
+ foreach ($data_users as $nbm_user)
{
if (
(!$must_repost) or // Not timeout, normal treatment
(($must_repost) and in_array($nbm_user['check_key'], $_POST['send_selection'])) // Must be repost, show only user to send
)
{
- $template->assign_block_vars(
- $page['mode'].'.send_data.user_send_mail',
+ $tpl_var['users'][] =
array(
- 'CLASS' => ($num % 2 == 1) ? 'nbm_user2' : 'nbm_user1',
'ID' => $nbm_user['check_key'],
'CHECKED' => ( // not check if not selected, on init select<all
isset($_POST['send_selection']) and // not init
@@ -743,11 +724,11 @@ switch ($page['mode'])
'USERNAME'=> $nbm_user['username'],
'EMAIL' => get_email_address_as_display_text($nbm_user['mail_address']),
'LAST_SEND'=> $nbm_user['last_send']
- ));
+ );
}
}
}
-
+ $template->assign($page['mode'], $tpl_var);
break;
}
}
@@ -755,7 +736,6 @@ switch ($page['mode'])
// +-----------------------------------------------------------------------+
// | Sending html code |
// +-----------------------------------------------------------------------+
-$template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
$template->assign_var_from_handle('ADMIN_CONTENT', 'notification_by_mail');
?> \ No newline at end of file
diff --git a/admin/user_list.php b/admin/user_list.php
index 3b7194594..992e90c58 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -440,7 +440,7 @@ DELETE FROM '.USER_GROUP_TABLE.'
}
redirect(
- PHPWG_ROOT_PATH.
+ get_root_url().
'admin.php'.
get_query_string_diff(array(), false)
);
@@ -483,11 +483,11 @@ else
$template->assign(
array(
- 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=user_list',
+ 'U_HELP' => get_root_url().'popuphelp.php?page=user_list',
'F_ADD_ACTION' => $base_url,
'F_USERNAME' => @htmlentities($_GET['username']),
- 'F_FILTER_ACTION' => PHPWG_ROOT_PATH.'admin.php'
+ 'F_FILTER_ACTION' => get_root_url().'admin.php'
));
// Hide radio-button if not allow to assign adviser
@@ -524,34 +524,13 @@ $template->assign('direction_selected',
if (isset($_POST['pref_submit']))
{
-// echo '<pre>'; print_r($_POST); echo '</pre>';
$template->assign(
array(
- 'ADVISER_YES' => 'true' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
- 'ADVISER_NO' => 'false' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
'NB_IMAGE_LINE' => $_POST['nb_image_line'],
'NB_LINE_PAGE' => $_POST['nb_line_page'],
'MAXWIDTH' => $_POST['maxwidth'],
'MAXHEIGHT' => $_POST['maxheight'],
'RECENT_PERIOD' => $_POST['recent_period'],
- 'EXPAND_YES' => 'true' == $_POST['expand'] ? 'checked="checked"' : '',
- 'EXPAND_NO' => 'false' == $_POST['expand'] ? 'checked="checked"' : '',
- 'SHOW_NB_COMMENTS_YES' => 'true' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
- 'SHOW_NB_COMMENTS_NO' => 'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
- 'SHOW_NB_HITS_YES' => 'true' == $_POST['show_nb_hits'] ? 'checked="checked"' : '',
- 'SHOW_NB_HITS_NO' => 'false' == $_POST['show_nb_hits'] ? 'checked="checked"' : '',
- 'ENABLED_HIGH_YES' => 'true' == $_POST['enabled_high'] ? 'checked="checked"' : '',
- 'ENABLED_HIGH_NO' => 'false' == $_POST['enabled_high'] ? 'checked="checked"' : '',
-
- 'STATUS_ACTION_SET' => 'set' == $_POST['status_action'] ? 'checked="checked"' : '',
- 'LEVEL_ACTION_SET' => 'set' == $_POST['level_action'] ? 'checked="checked"' : '',
- 'NB_IMAGE_LINE_ACTION_SET' => 'set' == $_POST['nb_image_line_action'] ? 'checked="checked"' : '',
- 'NB_LINE_PAGE_ACTION_SET' => 'set' == $_POST['nb_line_page_action'] ? 'checked="checked"' : '',
- 'TEMPLATE_ACTION_SET' => 'set' == $_POST['template_action'] ? 'checked="checked"' : '',
- 'LANGUAGE_ACTION_SET' => 'set' == $_POST['language_action'] ? 'checked="checked"' : '',
- 'RECENT_PERIOD_ACTION_SET' => 'set' == $_POST['recent_period_action'] ? 'checked="checked"' : '',
- 'MAXWIDTH_ACTION_SET' => 'set' == $_POST['maxwidth_action'] ? 'checked="checked"' : '',
- 'MAXHEIGHT_ACTION_SET' => 'set' == $_POST['maxheight_action'] ? 'checked="checked"' : '',
));
}
else
@@ -645,9 +624,11 @@ foreach ($page['filtered_users'] as $num => $local_user)
$visible_user_list[] = $local_user;
}
+// allow plugins to fill template var plugin_user_list_column_titles and
+// plugin_columns/plugin_actions for each user in the list
$visible_user_list = trigger_event('loc_visible_user_list', $visible_user_list);
-foreach ($visible_user_list as $num => $local_user)
+foreach ($visible_user_list as $local_user)
{
$groups_string = preg_replace(
'/(\d+)/e',
@@ -696,9 +677,10 @@ foreach ($visible_user_list as $num => $local_user)
'EMAIL' => get_email_address_as_display_text($local_user['email']),
'GROUPS' => $groups_string,
'PROPERTIES' => implode( ', ', $properties),
+ 'plugin_columns' => isset($local_user['plugin_columns']) ? $local_user['plugin_columns'] : array(),
+ 'plugin_actions' => isset($local_user['plugin_actions']) ? $local_user['plugin_actions'] : array(),
)
);
- trigger_action('loc_append_user_list', $local_user);
}
// +-----------------------------------------------------------------------+