]> git.mxchange.org Git - mailer.git/commitdiff
Added grade's library include script, added template for adding grades
authorRoland Häder <roland@mxchange.org>
Sun, 21 Oct 2012 20:23:21 +0000 (20:23 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 21 Oct 2012 20:23:21 +0000 (20:23 +0000)
.gitattributes
inc/language/grade_de.php
inc/libs/grade_functions.php [new file with mode: 0644]
templates/de/html/admin/admin_add_grade_data.tpl [new file with mode: 0644]

index c4b7a0969b1e1adfeed9ba7e613fc063936fdeda..ef855fa17093ab7d429fdff162fcfa4b5963147d 100644 (file)
@@ -373,6 +373,7 @@ inc/libs/earning_functions.php svneol=native#text/plain
 inc/libs/events_functions.php svneol=native#text/plain
 inc/libs/forced_functions.php svneol=native#text/plain
 inc/libs/funcoins_functions.php svneol=native#text/plain
+inc/libs/grade_functions.php svneol=native#text/plain
 inc/libs/holiday_functions.php svneol=native#text/plain
 inc/libs/html_mail_functions.php svneol=native#text/plain
 inc/libs/jackpot_functions.php svneol=native#text/plain
@@ -1180,6 +1181,7 @@ templates/de/html/admin/admin_add_country.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_forced_ad.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_forced_campaign.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_forced_costs.tpl svneol=native#text/plain
+templates/de/html/admin/admin_add_grade_data.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_guest_menu.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_max.tpl svneol=native#text/plain
 templates/de/html/admin/admin_add_member_menu.tpl svneol=native#text/plain
index c92cb654b5de4a929684a7889adf9077432a10f0..ac7fc3d37e0bffc17d6bd854667568579fa406aa 100644 (file)
@@ -43,8 +43,22 @@ if (!defined('__SECURITY')) {
 // Language definitions
 addMessages(array(
        // Admin - error messages
-       'ADMIN_GRADE_DATA_NO_SELECTIONS' => "Es wurde keine Auswahl getroffen, bitte w&auml;hlen Sie mindestens eine Abstufung aus.",
-       'ADMIN_GRADE_DATA_404' => "Es wurden keine Abstufungen gefunden.",
+       'ADMIN_GRADE_DATA_NO_SELECTIONS' => "Es wurde keine Auswahl getroffen, bitte w&auml;hlen Sie mindestens eine Einstufung aus.",
+       'ADMIN_GRADE_DATA_404' => "Es wurden keine Einstufungen gefunden.",
+
+       // Admin - general messages
+       'ADMIN_ENTER_GRADE_DATA_NAME' => "Namen f&uuml;r Einstufung:",
+       'ADMIN_SELECT_GRADE_PARENT_ID' => "Eltern-Einstufung ausw&auml;hlen:",
+       'ADMIN_ENTER_GRADE_DATA_DESCRIPTION' => "Erkl&auml;rung/Beschreibung zur Abstufung eingeben:",
+
+       // Admin - titles
+       'ADMIN_ADD_GRADE_DATA_TITLE' => "Neue Abstufung einrichten",
+
+       // Admin - submit buttons
+       'ADMIN_ADD_GRADE_DATA_SUBMIT' => "Neue Abstufung hinzuf&uuml;gen",
+
+       // Admin - notices
+       'ADMIN_ADD_GRADE_DATA_NOTICE' => "<strong>Hinweise:</strong> Geben Sie als Namen z.B. <strong>Bronze</strong>, <strong>Silber</strong>, <strong>Gold</strong> oder <strong>Platinum</strong> ein. Als beschreibender Text k&ouml;nnten Sie z.B. eingeben, was alles ausserdem noch zu beachten gibt oder es dazu gibt.",
 ));
 
 // [EOF]
diff --git a/inc/libs/grade_functions.php b/inc/libs/grade_functions.php
new file mode 100644 (file)
index 0000000..c44ecbc
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 10/21/2012 *
+ * ===================                          Last change: 10/21/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : grade_functions.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for ext-                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer ext-                             *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Generates a option "list" for all created "parent" grade ids
+function generateGradeDataParentIdOptions ($defaultId = NULL) {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$defaultId])) {
+               // Default is no parent (NULL)
+               $whereStatement = '';
+
+               // Is default set?
+               if (!is_null($defaultId)) {
+                       // Then exlude it
+                       $whereStatement = sprintf('WHERE `grade_id`=%s', bigintval($defaultId));
+               } // END - if
+
+               // Look for all
+               $result = SQL_QUERY('SELECT
+       `grade_id`,
+       `grade_name`
+FROM
+       `{?_MYSQL_PREFIX?}_grade_data`
+' . $whereStatement . '
+ORDER BY
+       `grade_id` ASC', __FUNCTION__, __LINE__);
+
+               // Init entries arrays
+               $gradeKeys = array();
+               $gradeValues = array();
+
+               // Are there entries?
+               if (!SQL_HASZERONUMS($result)) {
+                       // Load all entries
+                       while ($grade = SQL_FETCHARRAY($result)) {
+                               // Add it to arrays
+                               $gradeKeys[] = $grade['grade_id'];
+                               $gradeValues[] = $grade['grade_name'];
+                       } // END - while
+               } // END - if
+
+               // Generate option "list"
+               $GLOBALS[__FUNCTION__][$defaultId] = generateOptions(
+                       '/ARRAY/',
+                       $gradeKeys,
+                       $gradeValues,
+                       $defaultId
+               );
+
+               // Free result
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$defaultId];
+}
+
+// [EOF]
+?>
diff --git a/templates/de/html/admin/admin_add_grade_data.tpl b/templates/de/html/admin/admin_add_grade_data.tpl
new file mode 100644 (file)
index 0000000..bb7f79a
--- /dev/null
@@ -0,0 +1,52 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_grade_data%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+       <tr>
+               <td class="table_header bottom" align="center" colspan="2">
+                       <strong>{--ADMIN_ADD_GRADE_DATA_TITLE--}</strong>
+               </td>
+       </tr>
+
+       <tr>
+               <td align="right">
+                       {--ADMIN_ENTER_GRADE_DATA_NAME--}
+               </td>
+               <td>
+                       <input type="text" class="form_field" name="grade_name" size="30" maxlength="255" />
+               </td>
+       </tr>
+
+       <tr>
+               <td align="right">
+                       {--ADMIN_SELECT_GRADE_PARENT_ID--}
+               </td>
+               <td>
+                       <select name="grade_parent_id" class="form_select" size="1">
+                               <option value="">{--SELECT_NONE--}</option>
+                               {%pipe,generateGradeDataParentIdOptions%}
+                       </select>
+               </td>
+       </tr>
+
+       <tr>
+               <td class="bottom" align="right" valign="top">
+                       {--ADMIN_ENTER_GRADE_DATA_DESCRIPTION--}
+               </td>
+               <td class="bottom">
+                       <textarea class="form_field" name="grade_description" rows="5" cols="30"></textarea>
+               </td>
+       </tr>
+
+       <tr>
+               <td class="table_footer" colspan="2">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" name="add" class="form_submit" value="{--ADMIN_ADD_GRADE_DATA_SUBMIT--}" />
+               </td>
+       </tr>
+</table>
+</form>
+</div>
+
+<div class="notice">
+       {--ADMIN_ADD_GRADE_DATA_NOTICE--}
+</div>