aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-03-21 22:58:59 +0000
committerrub <rub@piwigo.org>2006-03-21 22:58:59 +0000
commit3609c224c74f50a9049524ebedc996ddd1187108 (patch)
treeae767f4294b4907f8cf3746cb18c70fdb91aa8c8
parente584310d3a51bcae7be00513a852ad43e22c585b (diff)
[NBM] Step 3: Layout Model
o Rename mailtousers.php on notification_by_mail.php o Deactivate temporary function on notification_by_mail.php o First design layout, no function activated, it's only a model git-svn-id: http://piwigo.org/svn/trunk@1091 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin.php2
-rw-r--r--admin/notification_by_mail.php (renamed from admin/mailtousers.php)120
-rw-r--r--language/en_UK.iso-8859-1/admin.lang.php14
-rw-r--r--language/en_UK.iso-8859-1/help/notification_by_mail.html2
-rw-r--r--language/fr_FR.iso-8859-1/admin.lang.php14
-rw-r--r--language/fr_FR.iso-8859-1/help/notification_by_mail.html2
-rw-r--r--template/yoga/admin.tpl2
-rw-r--r--template/yoga/admin/notification_by_mail.tpl60
8 files changed, 207 insertions, 9 deletions
diff --git a/admin.php b/admin.php
index a965e2878..fa9a23cc0 100644
--- a/admin.php
+++ b/admin.php
@@ -76,7 +76,7 @@ $template->assign_vars(
'U_FAQ'=> $link_start.'help',
'U_SITES'=> $link_start.'remote_site',
'U_MAINTENANCE'=> $link_start.'maintenance',
- 'U_MAILTOUSERS'=> $link_start.'mailtousers',
+ 'U_NOTIFICATION_BY_MAIL'=> $link_start.'notification_by_mail',
'U_CONFIG_GENERAL'=> $conf_link.'general',
'U_CONFIG_COMMENTS'=> $conf_link.'comments',
'U_CONFIG_DISPLAY'=> $conf_link.'default',
diff --git a/admin/mailtousers.php b/admin/notification_by_mail.php
index c2539a398..ee31ef077 100644
--- a/admin/mailtousers.php
+++ b/admin/notification_by_mail.php
@@ -27,7 +27,7 @@
// +-----------------------------------------------------------------------+
// +-----------------------------------------------------------------------+
-// | include
+// | include |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
@@ -47,7 +47,7 @@ include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
check_status(ACCESS_ADMINISTRATOR);
// +-----------------------------------------------------------------------+
-// | functions
+// | functions |
// +-----------------------------------------------------------------------+
/*
* Search an available check_key
@@ -252,20 +252,119 @@ order by
}
// +-----------------------------------------------------------------------+
-// | Main
+// | Main |
// +-----------------------------------------------------------------------+
update_data_user_mail_notification();
-send_all_user_mail_notification();
+//send_all_user_mail_notification();
+if (!isset($_GET['mode']))
+{
+ $page['mode'] = 'send';
+}
+else
+{
+ $page['mode'] = $_GET['mode'];
+}
// +-----------------------------------------------------------------------+
-// | template initialization |
+// | template initialization |
// +-----------------------------------------------------------------------+
+$template->set_filenames(
+ array(
+ 'double_select' => 'admin/double_select.tpl',
+ 'notification_by_mail'=>'admin/notification_by_mail.tpl'
+ )
+ );
+
+$base_url = get_root_url().'admin.php';
+
+$template->assign_vars(
+ array(
+ 'U_TABSHEET_TITLE' => l10n('nbm_'.$page['mode'].'_mode'),
+ 'U_HELP' => add_url_param(get_root_url().'/popuphelp.php', 'page=notification_by_mail'),
+ 'U_PARAM_MODE' => add_url_param($base_url.get_query_string_diff(array('mode')), 'mode=param'),
+ 'U_SUBSCRIBE_MODE' => add_url_param($base_url.get_query_string_diff(array('mode')), 'mode=subscribe'),
+ 'U_SEND_MODE' => add_url_param($base_url.get_query_string_diff(array('mode')), 'mode=send'),
+ 'F_ACTION'=> $base_url.get_query_string_diff(array())
+ ));
+
+switch ($page['mode'])
+{
+ case 'param' :
+ {
+ $template->assign_block_vars(
+ $page['mode'],
+ array(
+ //'HISTORY_YES'=>$history_yes
+ ));
+ break;
+ }
+ case 'subscribe' :
+ {
+ $template->assign_block_vars(
+ $page['mode'],
+ array(
+ //'HISTORY_YES'=>$history_yes
+ ));
+
+ $template->assign_vars(
+ array(
+ 'L_CAT_OPTIONS_TRUE' => l10n('nbm_subscribe_col'),
+ 'L_CAT_OPTIONS_FALSE' => l10n('nbm_unsubscribe_col')
+ )
+ );
+
+
+/* $template->assign_block_vars(
+ $blockname,
+ array('SELECTED'=>$selected,
+ 'VALUE'=>$category['id'],
+ 'OPTION'=>$option
+ ));*/
+ $template->assign_block_vars(
+ 'category_option_true',
+ array('SELECTED'=>'',
+ 'VALUE'=>'rub',
+ 'OPTION'=>'rub [rub@phpwebgallery.net]'
+ ));
+
+ break;
+ }
+ case 'send' :
+ {
+ $template->assign_block_vars(
+ $page['mode'],
+ array(
+ //'HISTORY_YES'=>$history_yes
+ ));
-$title = l10n('nbm_Send mail to users');
+ $template->assign_vars(
+ array(
+ 'L_CAT_OPTIONS_TRUE' => l10n('nbm_send_col'),
+ 'L_CAT_OPTIONS_FALSE' => l10n('nbm_nosend_col')
+ )
+ );
+
+
+/* $template->assign_block_vars(
+ $blockname,
+ array('SELECTED'=>$selected,
+ 'VALUE'=>$category['id'],
+ 'OPTION'=>$option
+ ));*/
+ $template->assign_block_vars(
+ 'category_option_true',
+ array('SELECTED'=>' selected="selected"',
+ 'VALUE'=>'rub',
+ 'OPTION'=>'rub [2006-03-20 23:35:23]'
+ ));
+
+ break;
+ }
+}
// +-----------------------------------------------------------------------+
-// | infos & errors display |
+// | infos & errors display |
// +-----------------------------------------------------------------------+
/*echo '<pre>';
@@ -290,4 +389,11 @@ if (count($page['infos']) != 0)
echo '</pre>';
*/
+
+// +-----------------------------------------------------------------------+
+// | 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/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php
index ab32c46f4..1596d3d24 100644
--- a/language/en_UK.iso-8859-1/admin.lang.php
+++ b/language/en_UK.iso-8859-1/admin.lang.php
@@ -253,6 +253,20 @@ $lang['nbm_Send mail to users'] = 'Send mail to users';
$lang['nbm_To unsubscribe send a message to %s.'] = 'To unsubscribe send a message to %s.';
$lang['nbm_User %s [%s] added.'] = 'User %s [%s] added.';
$lang['nbm_item_notification'] = 'Notification';
+$lang['nbm_param_mode'] = 'Parameter';
+$lang['nbm_subscribe_mode'] = 'Subscribe';
+$lang['nbm_send_mode'] = 'Send';
+$lang['nbm_title_param'] = 'Parameters';
+$lang['nbm_send_detailed_content'] = 'Send detailed content';
+$lang['nbm_complementary_mail_content'] = 'Complementary mail content';
+$lang['nbm_title_subscribe'] = 'Subscribe/unscribe users';
+$lang['nbm_warning_subscribe_unsubcribe'] = 'Warning, subscribe or unscribe send mails to users [Not Implemented]';
+$lang['nbm_subscribe_col'] = 'Subscribed';
+$lang['nbm_unsubscribe_col'] = 'Unsubcribed';
+$lang['nbm_title_send'] = 'Select sendings';
+$lang['nbm_send_submit'] = 'Send';
+$lang['nbm_send_col'] = 'To send';
+$lang['nbm_nosend_col'] = 'No to send';
$lang['no_write_access'] = 'no write access';
$lang['order_by'] = 'order by';
$lang['path'] = 'path';
diff --git a/language/en_UK.iso-8859-1/help/notification_by_mail.html b/language/en_UK.iso-8859-1/help/notification_by_mail.html
new file mode 100644
index 000000000..aa977a816
--- /dev/null
+++ b/language/en_UK.iso-8859-1/help/notification_by_mail.html
@@ -0,0 +1,2 @@
+<h2>Notification by mail</h2>
+
diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php
index 19185232c..0ad69bced 100644
--- a/language/fr_FR.iso-8859-1/admin.lang.php
+++ b/language/fr_FR.iso-8859-1/admin.lang.php
@@ -253,6 +253,20 @@ $lang['nbm_Send mail to users'] = 'Envoi de mail aux utilisateurs';
$lang['nbm_To unsubscribe send a message to %s.'] = 'Pour vous désinscrire, envoyer un mail à %s.';
$lang['nbm_User %s [%s] added.'] = 'Utilisateur %s [%s] ajouté.';
$lang['nbm_item_notification'] = 'Notification';
+$lang['nbm_param_mode'] = 'Paramètrage';
+$lang['nbm_subscribe_mode'] = 'Inscription';
+$lang['nbm_send_mode'] = 'Envoi';
+$lang['nbm_title_param'] = 'Paramètres';
+$lang['nbm_send_detailed_content'] = 'Envoi d\'un contenu détaillé';
+$lang['nbm_complementary_mail_content'] = 'Contenu complémentaire au mail';
+$lang['nbm_title_subscribe'] = 'Inscrire/desinscrire les utilisateurs';
+$lang['nbm_warning_subscribe_unsubcribe'] = 'Attention, l\'inscription ou la desincription entraine l\'envoi de mails aux utilisateurs concernés [Fonction non implementée]';
+$lang['nbm_subscribe_col'] = 'Inscrits';
+$lang['nbm_unsubscribe_col'] = 'Non Inscrits';
+$lang['nbm_title_send'] = 'Sélection des envois';
+$lang['nbm_send_submit'] = 'Envoyer';
+$lang['nbm_send_col'] = 'A envoyer';
+$lang['nbm_nosend_col'] = 'A ne pas envoyer';
$lang['no_write_access'] = 'pas d\'accès en écriture';
$lang['order_by'] = 'trier selon';
$lang['path'] = 'chemin';
diff --git a/language/fr_FR.iso-8859-1/help/notification_by_mail.html b/language/fr_FR.iso-8859-1/help/notification_by_mail.html
new file mode 100644
index 000000000..aa977a816
--- /dev/null
+++ b/language/fr_FR.iso-8859-1/help/notification_by_mail.html
@@ -0,0 +1,2 @@
+<h2>Notification by mail</h2>
+
diff --git a/template/yoga/admin.tpl b/template/yoga/admin.tpl
index ca789c1d0..785e312d9 100644
--- a/template/yoga/admin.tpl
+++ b/template/yoga/admin.tpl
@@ -18,7 +18,7 @@
<li><a href="{U_HISTORY}">{lang:history}</a></li>
<li><a href="{U_CAT_UPDATE}">{lang:update}</a></li>
<li><a href="{U_MAINTENANCE}">{lang:Maintenance}</a></li>
- <li><a href="{U_MAILTOUSERS}">{lang:nbm_item_notification}</a></li>
+ <li><a href="{U_NOTIFICATION_BY_MAIL}">{lang:nbm_item_notification}</a></li>
</ul>
</dd>
diff --git a/template/yoga/admin/notification_by_mail.tpl b/template/yoga/admin/notification_by_mail.tpl
new file mode 100644
index 000000000..36bff3cf3
--- /dev/null
+++ b/template/yoga/admin/notification_by_mail.tpl
@@ -0,0 +1,60 @@
+<!-- $Id: notification_by_mail.tpl Ruben ARNAUD -->
+<div class="titrePage">
+ <ul class="categoryActions">
+ <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+ </ul>
+ <h2>{lang:nbm_Send mail to users} [{U_TABSHEET_TITLE}]</h2>
+ <h3>
+ <p style="text-align:center;">
+ <a href="{U_PARAM_MODE}">{lang:nbm_param_mode}</a> |
+ <a href="{U_SUBSCRIBE_MODE}">{lang:nbm_subscribe_mode}</a> |
+ <a href="{U_SEND_MODE}">{lang:nbm_send_mode}</a>
+ </p>
+ </h3>
+</div>
+
+<form method="post" name="notification_by_mail" action="{F_ACTION}">
+
+ <!-- BEGIN param -->
+ <fieldset>
+ <legend><strong>{lang:nbm_title_param}</strong></legend>
+
+ <table>
+ <tr>
+ <td><label for="send_detailed_content">{lang:nbm_send_detailed_content} </label></td>
+ <td><input type="checkbox" name="send_detailed_content" id="send_detailed_content" value="true" {param.SEND_DETAILED_CONTENT}/></td>
+ </tr>
+ <tr>
+ <td><label for="complementary_mail_content">{lang:nbm_complementary_mail_content} </label></td>
+ <td><textarea cols="50" rows="5" name="complementary_mail_content" id="complementary_mail_content">{param.COMPLEMENTARY_MAIL_CONTENT}</textarea></td>
+ </tr>
+ </table>
+ </fieldset>
+
+ <p>
+ <input type="submit" value="{lang:Submit}" name="param_submit" {TAG_INPUT_ENABLED} />
+ <input type="reset" value="{lang:Reset}" name="param_reset" />
+ </p>
+ <!-- END param -->
+
+ <!-- BEGIN subscribe -->
+ <fieldset>
+ <legend><strong>{lang:nbm_title_subscribe}</strong></legend>
+ <legend><center><i>{lang:nbm_warning_subscribe_unsubcribe}</i></center></legend>
+ {DOUBLE_SELECT}
+ </fieldset>
+ <!-- END subscribe -->
+
+ <!-- BEGIN send -->
+ <fieldset>
+ <legend><strong>{lang:nbm_title_send}</strong></legend>
+ {DOUBLE_SELECT}
+ </fieldset>
+
+ <p>
+ <input type="submit" value="{lang:nbm_send_submit}" name="sene_submit" {TAG_INPUT_ENABLED} />
+ <input type="reset" value="{lang:Reset}" name="send_reset" />
+ </p>
+ <!-- END send -->
+
+</form>