Changeset 497 for trunk/services
- Timestamp:
- Sep 15, 2014 9:44:27 PM (10 years ago)
- Location:
- trunk/services
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/services/admins.php
r479 r497 34 34 require_once 'codebase/lib/FormValidator.inc.php'; 35 35 require_once 'codebase/lib/SortOrder.inc.php'; 36 require_once 'codebase/lib/ TemplateGlue.inc.php';36 require_once 'codebase/lib/HTML.inc.php'; 37 37 require_once 'codebase/lib/Prefs.inc.php'; 38 38 require_once 'codebase/lib/Lock.inc.php'; … … 229 229 } 230 230 231 $fv->numericRange('admin_id', -32768, 32767, _("<strong>Admin id</strong> must be a valid number between -32768and 32767."));231 $fv->numericRange('admin_id', 0, 32767, _("<strong>Admin id</strong> must be a valid number between 0 and 32767.")); 232 232 233 233 $fv->isEmpty('username', _("<strong>Username</strong> cannot be blank.")); … … 235 235 236 236 $fv->isEmpty('userpass', _("<strong>Passwords</strong> cannot be blank.")); 237 $fv->stringLength('userpass', 6, 36, _("<strong>Passwords</strong> must be between 6and 36 characters long."));237 $fv->stringLength('userpass', 8, 36, _("<strong>Passwords</strong> must be between 8 and 36 characters long.")); 238 238 239 239 $fv->stringLength('first_name', 0, 255, _("<strong>First name</strong> must contain less than 256 characters.")); … … 242 242 243 243 $fv->isEmpty('email', _("<strong>Email</strong> cannot be blank.")); 244 $fv->stringLength('email', 0, 255, _("<strong>Email</strong> must contain less than 256 characters."));245 244 $fv->validateEmail('email'); 246 245 } … … 267 266 'new_op' => 'insert', 268 267 'submit_buttons' => array( 269 'submit' => _("Add Administrator"),270 'repeat' => _("Add & repeat"),271 'cancel' => _("Cancel"),268 array('name' => 'submit', 'value' => _("Add Administrator"), 'class' => 'small button', 'accesskey' => 's'), 269 array('name' => 'repeat', 'value' => _("Add & repeat"), 'class' => 'small button secondary', 'accesskey' => 'r'), 270 array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'), 272 271 ), 273 272 ); … … 280 279 global $auth; 281 280 global $lock; 281 global $locally_carried_queries; 282 282 $app =& App::getInstance(); 283 283 $db =& DB::getInstance(); … … 324 324 'old_username' => $frm['username'], 325 325 'submit_buttons' => array( 326 'submit' => _("Save changes"),327 'repeat' => _("Save & edit next"),328 'reset' => _("Reset"),329 'cancel' => _("Cancel"),326 array('name' => 'submit', 'value' => _("Save changes"), 'class' => 'small button', 'accesskey' => 's'), 327 array('name' => 'repeat', 'value' => _("Save & edit next"), 'class' => 'small button secondary', 'accesskey' => 'e'), 328 array('name' => 'reset', 'value' => _("Reset"), 'class' => 'small button secondary', 'accesskey' => 'r'), 329 array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'), 330 330 ), 331 ), $frm, array('userpass' => ' ****************'));331 ), $frm, array('userpass' => 'â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢')); 332 332 333 333 return $frm; … … 339 339 global $lock; 340 340 global $cache; 341 global $locally_carried_queries; 341 342 $app =& App::getInstance(); 342 343 $db =& DB::getInstance(); … … 367 368 if ($num_admins <= 1) { 368 369 // There must always be at least one admnistrator! 369 $app->raiseMsg(_("You cannot delete the only administrator in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__);370 $app->raiseMsg(_("You cannot delete the only user in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__); 370 371 } else if ($auth->get('user_id') == $id) { 371 372 // Do not delete yourself! … … 418 419 $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $last_insert_id, $frm['username']); 419 420 420 $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);421 $app->raiseMsg(sprintf(_("The user <em>%s</em> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__); 421 422 422 423 return $last_insert_id; … … 461 462 $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id'], $frm['username']); 462 463 463 $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);464 $app->raiseMsg(sprintf(_("The user <em>%s</em> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__); 464 465 465 466 // Unlock record. -
trunk/services/lock.php
r468 r497 25 25 */ 26 26 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 27 // Redefine include_path including the codebase/services but allow local templates override global ones. 28 ini_set('include_path', join(PATH_SEPARATOR, array( 29 get_include_path(), 30 dirname(__FILE__) . '/templates' 31 ))); 32 28 33 require_once 'codebase/lib/Lock.inc.php'; 34 require_once 'codebase/lib/HTML.inc.php'; 29 35 30 36 $app->sslOn(); … … 66 72 // Templates. 67 73 include 'header.ihtml'; 68 $lock->printErrorHTML(); 74 // $lock->printErrorHTML(); 75 include 'lock.ihtml'; 69 76 include 'footer.ihtml'; 70 77 -
trunk/services/login.php
r477 r497 24 24 * login.php 25 25 */ 26 27 // Redefine include_path including the codebase/services but allow local templates override global ones. 28 ini_set('include_path', join(PATH_SEPARATOR, array( 29 get_include_path(), 30 dirname(__FILE__) . '/templates' 31 ))); 26 32 27 33 // We may want to use the add/edit interface from another script, so this … … 64 70 // Templates. 65 71 include 'header.ihtml'; 66 include ' codebase/services/templates/login_form.ihtml';72 include 'login_form.ihtml'; 67 73 include 'footer.ihtml'; 68 74 -
trunk/services/logs.php
r479 r497 25 25 */ 26 26 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 27 // Redefine include_path including the codebase/services but allow local templates override global ones. 28 ini_set('include_path', join(PATH_SEPARATOR, array( 29 get_include_path(), 30 dirname(__FILE__) . '/templates' 31 ))); 28 32 29 33 $app->sslOn(); … … 67 71 68 72 // Titles and navigation header. 69 $nav->add(sprintf(_("Viewing log:<em>%s</em>"), $tmp_prefs->get('log_file')), '/admin/logs.php');73 $nav->add(sprintf(_("Viewing <em>%s</em>"), $tmp_prefs->get('log_file')), '/admin/logs.php'); 70 74 71 75 /******************************************************************** … … 148 152 printLog($tmp_prefs->get('log_file')); 149 153 } else { 150 include 'codebase/services/templates/' .$main_template;154 include $main_template; 151 155 } 152 156 include 'footer.ihtml'; -
trunk/services/password.php
r468 r497 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 25 25 */ 26 26 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 27 // Redefine include_path including the codebase/services but allow local templates override global ones. 28 ini_set('include_path', join(PATH_SEPARATOR, array( 29 get_include_path(), 30 dirname(__FILE__) . '/templates' 31 ))); 28 32 29 33 $auth->requireLogin(); 30 34 31 35 require_once 'codebase/lib/FormValidator.inc.php'; 36 require_once 'codebase/lib/HTML.inc.php'; 32 37 33 38 /****************************************************************************** … … 36 41 37 42 // Titles and navigation header. 38 $nav->add( _("Change password"));43 $nav->add(sprintf(_("Change password for <em>%s</em>"), $auth->get('username'))); 39 44 40 45 // The object to validate form input from the user. … … 58 63 59 64 // Validate the posted data. 60 // $fv->isEmpty('oldpassword', _("You did not specify the <strong>old password</strong>.")); 61 $fv->checkRegex('oldpassword', '/^[[:alnum:][:punct:]]{0,128}$/i', true, _("The <strong>Old password</strong> specified is not valid.")); 62 if (!$fv->isEmpty('newpassword', _("You did not specify the <strong>New password</strong>."))) { 63 $fv->checkRegex('newpassword', '/^[[:alnum:][:punct:]]{6,128}$/i', true, _("The <strong>New password</strong> specified is not valid. A password must be 6 or more characters.")); 64 if ($frm['newpassword'] != $frm['newpassword2'] && !$fv->isEmpty('newpassword2', _("You need to type the <strong>New password</strong> twice."))) { 65 $fv->addError('newpassword', _("The <strong>New passwords</strong> do not match.")); 66 $fv->addError('newpassword2'); 65 if ($fv->notEmpty('oldpassword', _("You did not specify the <strong>old password</strong>."))) { 66 $fv->checkRegex('oldpassword', '/^\S{0,128}$/i', true, _("The <strong>old password</strong> specified is not valid.")); 67 } 68 if ($fv->notEmpty('newpassword', _("You did not specify the <strong>new password</strong>."))) { 69 if ($fv->checkRegex('newpassword', '/^\S{8,128}$/i', true, _("The <strong>new password</strong> specified is not valid. A password must be eight or more characters."))) { 70 if ($fv->notEmpty('newpassword2', _("You need to type the <strong>new password</strong> twice.")) && $frm['newpassword'] != $frm['newpassword2']) { 71 $fv->addError('newpassword', _("The <strong>new passwords</strong> do not match.")); 72 $fv->addError('newpassword2'); 73 } 67 74 } 68 75 } 69 76 70 77 if (!$fv->anyErrors() && false === $auth->authenticate($auth->get('username'), $frm['oldpassword'])) { 71 $fv->addError('oldpassword', _("Your <strong> Old password</strong> failed authentication."));78 $fv->addError('oldpassword', _("Your <strong>old password</strong> failed authentication.")); 72 79 $app->logMsg(sprintf('Password change failed for %s, using (md5ed) password: %s', $auth->get('username'), md5($frm['oldpassword'])), LOG_NOTICE, __FILE__, __LINE__); 73 80 } … … 84 91 // Templates. 85 92 include 'header.ihtml'; 86 include ' codebase/services/templates/password.ihtml';93 include 'password.ihtml'; 87 94 include 'footer.ihtml'; 88 95 -
trunk/services/reset_password.php
r468 r497 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 34 34 ********************************************************************/ 35 35 36 // Redefine include_path including the codebase/services but allow local templates override global ones. 37 ini_set('include_path', join(PATH_SEPARATOR, array( 38 get_include_path(), 39 dirname(__FILE__) . '/templates' 40 ))); 41 36 42 // The object to validate form input from the user. 37 43 require_once 'codebase/lib/FormValidator.inc.php'; 38 44 $fv = new FormValidator(); 45 46 require_once 'codebase/lib/HTML.inc.php'; 39 47 40 48 /******************************************************************** … … 84 92 85 93 include 'header.ihtml'; 86 include ' codebase/services/templates/reset_password.ihtml';94 include 'reset_password.ihtml'; 87 95 include 'footer.ihtml'; 88 96 -
trunk/services/templates/admin_form.ihtml
r435 r497 1 < ?php $fv->printErrorMessages(); ?>2 3 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">4 <?php $app->printHiddenSession(); ?>5 <input type="hidden" name="op" value="<?php echo $frm['new_op']; ?>" />6 < input type="hidden" name="admin_id" value="<?php echo $frm['admin_id']; ?>" />7 < input type="hidden" name="old_username" value="<?php echo $frm['old_username']; ?>" />8 9 <table>10 <tr class="sc-form-row">11 < td class="sc-right"><label for="username" class="<?php $fv->err('username'); ?>"><?php echo _("Username"); ?></label></td>12 < td>13 <input type="text" class="sc-small" size="50" name="username" value="<?php echo oTxt($frm['username']); ?>" />14 </td>15 </tr>16 <tr class="sc-form-row">17 <td class="sc-right"><label for="userpass" class="<?php $fv->err('userpass'); ?>"><?php echo _("Password"); ?></label></td>18 <td>19 <input type="password" class="sc-small" size="50" name="userpass" value="<?php echo oTxt($frm['userpass']); ?>" />20 </td>21 </tr>22 <tr class="sc-form-row">23 < td class="sc-right"><label for="first_name" class="<?php $fv->err('first_name'); ?>"><?php echo _("First name"); ?></label></td>24 <td>25 <input type="text" class="sc-small" size="50" name="first_name" value="<?php echo oTxt($frm['first_name']); ?>" />26 </td>27 </tr>28 <tr class="sc-form-row">29 < td class="sc-right"><label for="last_name" class="<?php $fv->err('last_name'); ?>"><?php echo _("Last name"); ?></label></td>30 <td>31 <input type="text" class="sc-small" size="50" name="last_name" value="<?php echo oTxt($frm['last_name']); ?>" />32 </td>33 </tr>34 <tr class="sc-form-row">35 <td class="sc-right"><label for="email" class="<?php $fv->err('email'); ?>"><?php echo _("Email"); ?></label></td>36 <td>37 < input type="text" class="sc-medium" size="50" name="email" value="<?php echo oTxt($frm['email']); ?>" />38 </ td>39 </tr>40 <tr class="sc-form-row">41 <td> </td>42 <td><?php printSubmitButtons($frm['submit_buttons']); ?></td>43 </tr>44 </table>45 </ form>1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 <?php $fv->printErrorMessages(); ?> 5 </div> 6 </header> 7 <main role="main"> 8 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 9 <?php $app->printHiddenSession(); ?> 10 <input type="hidden" name="op" value="<?php echo $frm['new_op']; ?>" /> 11 <input type="hidden" name="admin_id" value="<?php echo $frm['admin_id']; ?>" /> 12 <input type="hidden" name="old_username" value="<?php echo $frm['old_username']; ?>" /> 13 <div class="row"> 14 <div class="medium-5 large-3 columns"> 15 <label for="first_name" class="<?php $fv->err('first_name'); ?>"><?php echo _("First name"); ?></label> 16 <input type="text" class="sc-small" size="50" name="first_name" value="<?php echo oTxt($frm['first_name']); ?>" /> 17 </div> 18 <div class="medium-5 large-3 columns end"> 19 <label for="last_name" class="<?php $fv->err('last_name'); ?>"><?php echo _("Last name"); ?></label> 20 <input type="text" class="sc-small" size="50" name="last_name" value="<?php echo oTxt($frm['last_name']); ?>" /> 21 </div> 22 </div> 23 <div class="row"> 24 <div class="medium-10 large-6 columns"> 25 <label for="email" class="<?php $fv->err('email'); ?>"><?php echo _("Email address"); ?></label> 26 <input type="text" class="sc-medium" size="50" name="email" value="<?php echo oTxt($frm['email']); ?>" /> 27 </div> 28 </div> 29 <div class="row"> 30 <div class="medium-5 large-3 columns"> 31 <label for="username" class="<?php $fv->err('username'); ?>"><?php echo _("Username"); ?></label> 32 <input type="text" class="sc-small" size="50" name="username" value="<?php echo oTxt($frm['username']); ?>" /> 33 </div> 34 <div class="medium-5 large-3 columns end"> 35 <label for="userpass" class="<?php $fv->err('userpass'); ?>"><?php echo _("Password"); ?></label> 36 <input type="password" class="sc-small" size="50" name="userpass" value="<?php echo oTxt($frm['userpass']); ?>" /> 37 </div> 38 </div> 39 <div class="row"> 40 <div class="large-6 columns"> 41 <?php HTML::printButtons($frm['submit_buttons']); ?> 42 </div> 43 </div> 44 </form> 45 </main> -
trunk/services/templates/admin_list.ihtml
r483 r497 1 2 <?php $fv->printErrorMessages(); ?> 3 4 <div class="commandbox"> 5 <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add Administrator"); ?></a></span> 6 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> 7 <?php $app->printHiddenSession(false); ?> 8 <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: Admin id, Username, Userpass, First name, Last name, Email.")); ?>" /> 9 <input type="submit" value="<?php echo _("Search"); ?>" /> 10 </form> 1 <div class="sticky"> 2 <nav class="top-bar list-bar" data-topbar role="navigation" data-options="sticky_on: large"> 3 <ul class="title-area"> 4 <li class="name"><h1><a href="#"><?php echo $nav->get('title'); ?></a></h1></li> 5 <li class="toggle-topbar"><a href="#"><span><?php echo _("Show commands"); ?></span></a></li> 6 </ul> 7 <section class="top-bar-section"> 8 <ul class="left"> 9 <li class="has-form"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>" class="button"><i class="fa fa-plus"></i> <?php echo _("Add Administrator"); ?></a></li> 10 </ul> 11 <ul class="right"> 12 <li class="has-form"> 13 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get"> 14 <div class="row collapse"> 15 <?php $app->printHiddenSession(false); ?> 16 <div class="small-8 columns"> 17 <input type="text" class="" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" placeholder="<?php echo _("SearchâŠ"); ?>" title="<?php echo oTxt(_("Fields searched: question text.")); ?>" /> 18 </div> 19 <div class="small-4 columns"> 20 <input type="submit" class="button expand" value="<?php echo _("Search"); ?>" /> 21 </div> 22 </div> 23 </form> 24 </li> 25 <?php if ('' != getFormData('search_query')): ?> 26 <li class="has-form"><a href="<?php echo $app->ohref($_SERVER['PHP_SELF'], false); ?>" class="button expand"><?php echo _("Show all"); ?></a></li> 27 <?php endif ?> 28 </ul> 29 </section> 30 </nav> 11 31 </div> 12 32 <table> 33 <thead> 34 <tr> 35 <th></th> 36 <th><?php echo $so->printSortHeader('admin_tbl.admin_id', _("ID"), 'ASC'); ?></th> 37 <th><?php echo $so->printSortHeader('admin_tbl.username', _("Username"), 'ASC'); ?></th> 38 <th><?php echo $so->printSortHeader('admin_tbl.first_name', _("First"), 'ASC'); ?> <?php echo $so->printSortHeader('admin_tbl.last_name', _("Last name"), 'ASC'); ?></th> 39 <th><?php echo $so->printSortHeader('admin_tbl.seconds_online', _("Min online"), 'ASC'); ?></th> 40 <th><?php echo $so->printSortHeader('admin_tbl.last_login_datetime', _("Last login"), 'ASC'); ?></th> 41 <th><?php echo $so->printSortHeader('admin_tbl.last_login_ip', _("Remote host"), 'ASC'); ?></th> 42 <th><?php echo $so->printSortHeader('admin_tbl.added_datetime', _("Added"), 'ASC'); ?></th> 43 <th><?php echo $so->printSortHeader('admin_tbl.added_by_user_id', _("by"), 'ASC'); ?></th> 44 <th><?php echo $so->printSortHeader('admin_tbl.modified_datetime', _("Modified"), 'ASC'); ?></th> 45 <th><?php echo $so->printSortHeader('admin_tbl.modified_by_user_id', _("by"), 'ASC'); ?></th> 46 </tr> 47 </thead> 48 <tbody> 49 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 50 <tr> 51 <td> 52 <a href="#" data-dropdown="actions-for-id-<?php echo oTxt($list[$i]['admin_id']); ?>" aria-controls="actions-for-id-<?php echo oTxt($list[$i]['admin_id']); ?>" aria-expanded="false" class="sc-action dropdown" data-options="is_hover:false"><i class="fa fa-cog fa-lg"></i></a> 53 <ul id="actions-for-id-<?php echo oTxt($list[$i]['admin_id']); ?>" data-dropdown-content class="f-dropdown sc-action" aria-hidden="true" tabindex="-1"> 54 <li><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><i class="fa fa-pencil fa-fw"></i> <?php printf(_("Edit <em>%s</em>"), oTxt(truncate($list[$i]['username'], 30))) ?></a></li> 55 <li><a href="<?php echo $app->oHREF('/versions.php?record_table=admin_tbl&record_key=admin_id&boomerang=true&record_val=' . $list[$i]['admin_id']); ?>"><i class="fa fa-files-o fa-fw"></i> <?php printf(_("Versions of %s"), oTxt(truncate($list[$i]['username'], 30))) ?></a></li> 56 <li><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>"><i class="fa fa-trash-o fa-fw"></i> <?php printf(_("Delete <em>%s</em>"), oTxt(truncate($list[$i]['username'], 30))) ?></a></li> 57 </ul> 58 </td> 59 <td class="sc-nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?></td> 60 <td class="sc-nowrap"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><?php echo oTxt($list[$i]['username'], true); ?></a></td> 61 <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?></td> 62 <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?></td> 63 <td class="sc-nowrap"><?php 64 if ($auth->isLoggedIn($list[$i]['admin_id'])) { 65 ?><strong><?php echo date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) ?></strong><?php 66 } else { 67 echo Validator::validateStrDate($list[$i]['last_login_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) : ''; 68 } 69 ?></td> 70 <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?></td> 71 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['added_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])) : ''; ?></td> 72 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?></td> 73 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['modified_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])) : ''; ?></td> 74 <td class="sc-nowrap"><?php echo oTxt($list[$i]['modified_admin_username'], true); ?></td> 75 </tr> 76 <?php } ?> 77 </tbody> 78 </table> 13 79 <?php include 'list_info.ihtml'; ?> 14 15 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">16 <table class="list">17 <tr>18 <th> </th>19 <th> </th>20 <th><?php echo $so->printSortHeader('admin_tbl.admin_id', _("ID"), 'ASC'); ?></th>21 <th><?php echo $so->printSortHeader('admin_tbl.username', _("Username"), 'ASC'); ?></th>22 <th><?php echo $so->printSortHeader('admin_tbl.first_name', _("First"), 'ASC'); ?> <?php echo $so->printSortHeader('admin_tbl.last_name', _("Last name"), 'ASC'); ?></th>23 <th><?php echo $so->printSortHeader('admin_tbl.seconds_online', _("Min online"), 'ASC'); ?></th>24 <th><?php echo $so->printSortHeader('admin_tbl.last_login_datetime', _("Last login"), 'ASC'); ?></th>25 <th><?php echo $so->printSortHeader('admin_tbl.last_login_ip', _("Remote host"), 'ASC'); ?></th>26 <th><?php echo $so->printSortHeader('admin_tbl.added_datetime', _("Added"), 'ASC'); ?></th>27 <th><?php echo $so->printSortHeader('admin_tbl.added_by_user_id', _("by"), 'ASC'); ?></th>28 <th><?php echo $so->printSortHeader('admin_tbl.modified_datetime', _("Modified"), 'ASC'); ?></th>29 <th><?php echo $so->printSortHeader('admin_tbl.modified_by_user_id', _("by"), 'ASC'); ?></th>30 <th> </th>31 </tr>32 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>33 <tr>34 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/i/pen.gif" alt="Edit" width="12" height="12" border="0" /></a> </td>35 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF(sprintf('/admin/versions.php?record_table=%s&record_key=%s&record_val=%s&boomerang=true', $auth->getParam('db_table'), $auth->getParam('db_primary_key'), $list[$i]['admin_id'])); ?>"><img src="/admin/i/multiple.png" alt="" width="12" height="12" border="0" /></a> </td>36 <td class="sc-nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> </td>37 <td class="sc-nowrap"><?php echo oTxt($list[$i]['username'], true); ?> </td>38 <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> </td>39 <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> </td>40 <td class="sc-nowrap"><?php41 if ($auth->isLoggedIn($list[$i]['admin_id'])) {42 ?><strong><?php echo date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) ?></strong><?php43 } else {44 echo Validator::validateStrDate($list[$i]['last_login_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) : '';45 }46 ?> </td>47 <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> </td>48 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['added_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])) : ''; ?> </td>49 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> </td>50 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['modified_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])) : ''; ?> </td>51 <td class="sc-nowrap"><?php echo oTxt($list[$i]['modified_admin_username'], true); ?> </td>52 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> </td>53 </tr>54 <?php } ?>55 </table>56 57 <?php if ($page->total_pages > 1) { ?>58 <div class="sc-nowrap commanditem" style="float: right;"><?php echo _("Pages:"); ?> <?php $page->printPageNumbers() ?></div>59 <?php } ?>60 </form> -
trunk/services/templates/email_reset_password.txt
r189 r497 9 9 10 10 {SITE_NAME} 11 <{SITE_URL}/> 11 {SITE_URL}/ 12 12 -
trunk/services/templates/list_info.ihtml
r270 r497 1 <div> 2 <?php if ($page->total_pages > 1) { ?> 3 <span class="sc-nowrap commanditem" style="float: right;"><?php echo _("Pages:"); ?> <?php $page->printPageNumbers() ?></span> 4 <?php } ?> 5 <span class="sc-nowrap commanditem"> 6 <?php printf(_("Listing <strong>%s-%s</strong> of <strong>%s</strong> results on <strong>%s</strong> pages"), (0==$page->total_items ? 0 : $page->first_item+1), (0==$page->total_items ? 0 : $page->last_item+1), $page->total_items, $page->total_pages) ?> 7 <a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'], false); ?>"><?php echo _("List all"); ?></a> 8 <?php echo _("Per page"); ?>: <?php $page->printPerPageLinks() ?> 9 </span> 1 <div class="row"> 2 <div class="large-12 text-center columns"> 3 <ul class="inline-list"> 4 <li><?php printf(_("Listing <strong>%s-%s</strong> of <strong>%s</strong> results on <strong>%s</strong> %s"), (0==$page->total_items ? 0 : $page->first_item+1), (0==$page->total_items ? 0 : $page->last_item+1), $page->total_items, $page->total_pages, (1==$page->total_pages ? _("page") : _("pages"))); ?></li> 5 <?php if ($page->total_pages > 1) { ?> 6 <li class=""><?php $page->printPageNumbers() ?></li> 7 <li><?php echo _("Per page"); ?>: <?php $page->printPerPageLinks() ?></li> 8 <?php } ?> 9 </ul> 10 </div> 10 11 </div> -
trunk/services/templates/lock.ihtml
r295 r497 1 1 <?php 2 2 if (!is_a($lock, 'Lock')) { 3 // If the Lock object hasn't been instantiated, don't execute this template. 3 4 return null; 4 5 } 5 6 ?> 6 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 7 <?php $app->printHiddenSession() ?> 8 <input type="hidden" name="lock_id" value="<?php echo $lock->getID(); ?>" /> 9 10 <p><?php 11 printf(_("The record %s is currently being edited by %s (%d minutes elapsed). You cannot modify the record while it is locked by another user."), 12 $lock->getTitle(), 13 $lock->getEditor(), 14 date('i', $lock->getSecondsElapsed() + 60) 15 ); 16 ?></p> 17 18 <?php if ($lock->getSecondsElapsed() > $lock->timeout) { ?> 19 <p><?php printf(_("You can force unlock the record if you believe the editing session has expired. You might want to confirm with before doing this."), $lock->getEditor()) ?></p> 20 <input type="submit" name="unlock" value="<?php echo _("Unlock"); ?>" /> 21 <?php } ?> 22 23 <input type="submit" name="cancel" value="<?php echo _("Cancel"); ?>" /> 24 </form> 7 <header class="row"> 8 <div class="large-12 columns"> 9 <h1><?php echo $nav->get('title'); ?></h2> 10 </div> 11 </header> 12 <main role="main"> 13 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>"> 14 <?php $app->printHiddenSession() ?> 15 <input type="hidden" name="lock_id" value="<?php echo $lock->getID(); ?>" /> 16 <div id="sc-msg" class="sc-msg row"> 17 <div class="large-12 columns"> 18 <p class="sc-msg-notice"> 19 <?php printf(_("The record <em>%s</em> is currently being edited by %s (%d minutes elapsed). You cannot modify the record while it is locked by another user."), 20 $lock->getTitle(), 21 $lock->getEditor(), 22 date('i', $lock->getSecondsElapsed() + 60) 23 ); ?> 24 </p> 25 <?php if ($lock->getSecondsElapsed() >= $lock->getParam('timeout')) { ?> 26 <p class="sc-msg-notice"><?php printf(_("You can forcibly unlock the record if you believe the editing session has expired. You might want to confirm with %s before doing this."), $lock->getEditor()) ?></p> 27 <div class="sc-msg-notice"> 28 <?php 29 HTML::printButtons(array( 30 array('name' => 'unlock', 'value' => _("Unlock"), 'class' => 'small button alert', 'accesskey' => 'u'), 31 array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'), 32 )); 33 ?> 34 </div> 35 <?php } else { ?> 36 <div class="sc-msg-notice"> 37 <?php 38 HTML::printButtons(array( 39 array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'), 40 )); 41 ?> 42 </div> 43 <?php } ?> 44 </div> 45 </div> 46 </form> 47 </main> -
trunk/services/templates/log_list.ihtml
r457 r497 1 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> 2 <?php $app->printHiddenSession(false); ?> 3 <div class="commandbox"> 4 <?php if (is_array($logs) && !empty($logs)) { ?> 5 <table> 6 <?php 7 foreach ($logs as $l) { 8 ?> 9 <tr> 10 <td> 11 <?php if ($l['filename'] == $tmp_prefs->get('log_file')) { ?> 12 <strong class="sc-padright"><?php echo sprintf(_("%s"), $l['filename']); ?></strong> 13 <?php } else { ?> 14 <a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?log=' . $l['filename']); ?>"><strong><?php echo sprintf(_("%s"), $l['filename']); ?></strong></a> 15 <?php } ?> 16 </td> 17 <td> 18 <em class="sc-padright"><?php echo sprintf(_("%01.1f KB, last modified %s"), ($l['filesize']/1024), date($app->getParam('date_format'), $l['modified'])); ?></em> 19 </td> 20 <td> 21 <?php if (!preg_match($no_download_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=download&log=' . $l['filename']); ?>"><?php echo _("Download"); ?></a><?php } ?> 22 <?php if (!preg_match($no_archive_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=archive&log=' . $l['filename']); ?>"><?php echo _("Archive"); ?></a><?php } ?> 23 <?php if (!preg_match($no_clear_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('/admin/logs.php?op=clear&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to clear the log file %s? This will empty this file of its contents. This action is not reversible."), $l['filename'])?>')"><?php echo _("Clear"); ?></a><?php } ?> 24 <?php if (!preg_match($no_delete_files, $l['filename'])) { ?><a href="<?php echo $app->oHREF('/admin/logs.php?op=delete&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the log file %s? This will remove this log file permanently. This action is not reversible."), $l['filename'])?>')"><?php echo _("Delete"); ?></a><?php } ?> 25 </td> 26 </tr><?php 27 } 28 ?> 29 </table> 30 <?php } ?> 31 <div class="form"> 32 <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo oTxt(getFormData('search_query')); ?>" title="<?php echo _("All lines in currently viewed log file are searched."); ?>" /> 33 <label class="sc-normal"><input type="checkbox" name="search_grep"<?php frmChecked(getFormData('search_grep')) ?> /><?php echo _("Use Regex"); ?></label> 34 <input class="sc-padleft" type="submit" name="list" value="<?php echo _("Search"); ?>" /> 1 <div class="sticky"> 2 <nav class="top-bar list-bar" data-topbar role="navigation" data-options="sticky_on: large"> 3 <ul class="title-area"> 4 <li class="name"><h1><a href="#"><?php echo $nav->get('title'); ?></a></h1></li> 5 <li class="toggle-topbar"><a href="#"><span><?php echo _("Show commands"); ?></span></a></li> 6 </ul> 7 <section class="top-bar-section"> 8 <ul class="left"> 9 <li class="has-form"> 10 <button data-dropdown="loglist" aria-controls="loglist" aria-expanded="false" class="button"><?php echo _("Select log"); ?> <i class="fa fa-caret-down"></i></button> 11 </li> 12 </ul> 13 <ul class="right"> 14 <li class="has-form"> 15 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get"> 16 <div class="row collapse"> 17 <?php $app->printHiddenSession(false); ?> 18 <div class="small-5 columns"> 19 <input type="text" class="" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" placeholder="<?php echo _("SearchâŠ"); ?>" title="<?php echo oTxt(_("Fields searched: question text.")); ?>" /> 20 </div> 21 <div class="small-4 columns"> 22 <input type="checkbox" id="search_grep" name="search_grep"<?php frmChecked(getFormData('search_grep')) ?> /><label for="search_grep"><?php echo _("Regex"); ?></label> 23 </div> 24 <div class="small-3 columns"> 25 <input type="submit" class="button expand" value="<?php echo _("Search"); ?>" /> 26 </div> 27 </div> 28 </form> 29 </li> 30 <?php if ('' != getFormData('search_query')): ?> 31 <li class="has-form"><a href="<?php echo $app->ohref($_SERVER['PHP_SELF'], false); ?>" class="button expand"><?php echo _("Show all"); ?></a></li> 32 <?php endif ?> 33 </ul> 34 </section> 35 </nav> 36 <?php if (is_array($logs) && !empty($logs)) { ?> 37 <div id="loglist" data-dropdown-content class="f-dropdown content large" aria-hidden="true" tabindex="-1"> 38 <table> 39 <?php 40 foreach ($logs as $l) { 41 ?> 42 <tr> 43 <td> 44 <?php if ($l['filename'] == $tmp_prefs->get('log_file')) { ?> 45 <strong class="sc-padright"><?php echo sprintf(_("%s"), $l['filename']); ?></strong> 46 <?php } else { ?> 47 <a class="sc-padright" href="<?php echo $app->oHREF('?log=' . $l['filename']); ?>"><strong><?php echo sprintf(_("%s"), $l['filename']); ?></strong></a> 48 <?php } ?> 49 </td> 50 <td> 51 <em class="sc-padright"><?php echo sprintf(_("%01.1f KB, last modified %s"), ($l['filesize']/1024), date($app->getParam('date_format'), $l['modified'])); ?></em> 52 </td> 53 <td> 54 <?php if (!preg_match($no_download_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('?op=download&log=' . $l['filename']); ?>"><?php echo _("Download"); ?></a><?php } ?> 55 <?php if (!preg_match($no_archive_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('?op=archive&log=' . $l['filename']); ?>"><?php echo _("Archive"); ?></a><?php } ?> 56 <?php if (!preg_match($no_clear_files, $l['filename'])) { ?><a class="sc-padright" href="<?php echo $app->oHREF('?op=clear&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to clear the log file %s? This will empty this file of its contents. This action is not reversible."), $l['filename'])?>')"><?php echo _("Clear"); ?></a><?php } ?> 57 <?php if (!preg_match($no_delete_files, $l['filename'])) { ?><a href="<?php echo $app->oHREF('?op=delete&log=' . $l['filename']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the log file %s? This will remove this log file permanently. This action is not reversible."), $l['filename'])?>')"><?php echo _("Delete"); ?></a><?php } ?> 58 </td> 59 </tr><?php 60 } 61 ?> 62 </table> 35 63 </div> 64 <?php } ?> 36 65 </div> 37 66 38 <?php include 'list_info.ihtml'; ?> 39 40 <pre style="font: 9px monaco;"> 67 <pre> 41 68 <?php 42 69 for ($i = $page->first_item; $i <= $page->last_item && $page->total_items; $i++) { … … 45 72 ?> 46 73 </pre> 74 <?php include 'list_info.ihtml'; ?> 47 75 48 <?php if ($page->total_pages > 1) { ?> 49 <div class="sc-nowrap commanditem" style="float: right;"><?php echo _("Pages:"); ?> <?php $page->printPageNumbers() ?></div> 50 <?php } ?> 51 </form> 76 <style> 77 td { padding: .1rem .5rem; } 78 pre { 79 font-family: monospace; 80 font-size: .75rem; 81 line-height: 1.2; 82 padding: 15px; 83 } 84 .right .has-form .columns { 85 padding: 0 .25rem; 86 } 87 </style> -
trunk/services/templates/password.ihtml
r296 r497 1 <?php $fv->printErrorMessages(); ?> 2 3 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 4 <?php $app->printHiddenSession() ?> 5 <input type="hidden" name="op" value="update_password" /> 6 <table> 7 <tr class="sc-form-row"> 8 <td class="sc-right"><label for="oldpassword" class="<?php $fv->err('oldpassword'); ?>"><?php echo _("Old password"); ?></label></td> 9 <td> 10 <input type="password" class="sc-medium" size="50" name="oldpassword" /> 11 </td> 12 </tr> 13 <tr class="sc-form-row"> 14 <td class="sc-right"><label for="newpassword" class="<?php $fv->err('newpassword'); ?>"><?php echo _("New password"); ?></label></td> 15 <td> 16 <input type="password" class="sc-medium" size="50" name="newpassword" /> 17 </td> 18 </tr> 19 <tr class="sc-form-row"> 20 <td class="sc-right"><label for="newpassword2" class="<?php $fv->err('newpassword2'); ?>"><?php echo _("New password again"); ?></label></td> 21 <td> 22 <input type="password" class="sc-medium" size="50" name="newpassword2" /> 23 </td> 24 </tr> 25 <tr class="sc-form-row"> 26 <td> </td> 27 <td><input type="submit" value="<?php echo _("Change password"); ?>" /></td> 28 </tr> 29 </table> 30 </form> 1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 <?php $fv->printErrorMessages(); ?> 5 </div> 6 </header> 7 <main role="main"> 8 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 9 <?php $app->printHiddenSession() ?> 10 <input type="hidden" name="op" value="update_password" /> 11 <div class="row"> 12 <div class="large-6 columns"> 13 <label for="oldpassword" class="<?php $fv->err('oldpassword'); ?>"><?php echo _("Old password"); ?></label> 14 <input type="password" class="sc-medium" size="50" name="oldpassword" /> 15 </div> 16 </div> 17 <div class="row"> 18 <div class="large-6 columns"> 19 <label for="newpassword" class="<?php $fv->err('newpassword'); ?><?php $fv->err('newpassword2'); ?>"><?php echo _("New password (twice)"); ?></label> 20 <input type="password" class="sc-medium" size="50" name="newpassword" /> 21 </div> 22 </div> 23 <div class="row"> 24 <div class="large-6 columns"> 25 <input type="password" class="sc-medium" size="50" name="newpassword2" /> 26 <div class="sc-help"><?php printf(_("See the <a href=\"%s\">Strangecode password guide</a> for tips on choosing a strong password."), 'http://www.strangecode.com/support/passwords'); ?></div> 27 </div> 28 </div> 29 <div class="row"> 30 <div class="large-6 columns"> 31 <?php 32 HTML::printButtons(array(array( 33 'name' => 'submit', 34 'value' => _("Change password"), 35 'class' => 'small button', 36 'accesskey' => 's' 37 ))); 38 ?> 39 </div> 40 </div> 41 </form> 42 </main> -
trunk/services/templates/reset_password.ihtml
r189 r497 1 <p><?php echo _("If you have forgotten your password enter your username here. A new password will be emailed to you."); ?></p> 2 3 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 4 <?php $app->printHiddenSession(); ?> 5 <input type="hidden" name="op" value="reset" /> 6 <div class="sc-form-row<?php $fv->err('username'); ?>"> 7 <label for="username"><?php echo _("Username"); ?></label> 8 <input type="text" name="username" id="username" class="sc-medium" value="<?php echo oTxt($frm['username']); ?>" /> 1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 <p><?php echo _("If you have forgotten your password enter your username here. A new password will be emailed to you."); ?></p> 5 <?php $fv->printErrorMessages(); ?> 9 6 </div> 10 <div class="sc-form-row sc-submit-buttons sc-clearboth"> 11 <input type="submit" value="<?php echo _("Submit"); ?>" /> 12 </div> 13 </form> 7 </header> 8 <main role="main"> 9 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 10 <?php $app->printHiddenSession(); ?> 11 <input type="hidden" name="op" value="reset" /> 12 <div class="row<?php $fv->err('username'); ?>"> 13 <div class="large-6 columns"> 14 <label for="username"><?php echo _("Username"); ?></label> 15 <input type="text" name="username" id="username" class="sc-medium" value="<?php echo oTxt($frm['username']); ?>" /> 16 </div> 17 </div> 18 <div class="row sc-submit-buttons"> 19 <div class="large-6 columns"> 20 <?php 21 HTML::printButtons(array(array( 22 'name' => 'submit', 23 'value' => _("Submit"), 24 'class' => 'small button', 25 'accesskey' => 's' 26 ))); 27 ?> 28 </div> 29 </div> 30 </form> 31 </main> -
trunk/services/templates/versions_diff.ihtml
r457 r497 1 <div class="commandbox"> 2 <?php if (!getFormData('current', false)) { ?> 3 <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span> 4 <?php } else { ?> 5 <span class="sc-nowrap commanditem"> </span> 6 <?php } ?> 7 </div> 1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 </div> 5 </header> 6 <main role="main"> 7 <div class="row"> 8 <div class="large-12 columns"> 9 <?php 10 if (is_array($data) && !empty($data)) { 11 ?> 12 <table class="list"> 13 <thead> 14 <tr> 15 <th class="sc-padleft"><?php echo _("Field"); ?></th> 16 <th class="sc-padleft"><?php echo _("Saved version"); ?></th> 17 <th class="sc-padleft"><?php echo _("Current record"); ?></th> 18 </tr> 19 </thead> 20 <tbody> 21 <?php 22 foreach ($current as $k=>$v_c) { 23 if (isset($data[$k])) { 24 $v_d = $data[$k]; 25 $td_style = ''; 26 } else { 27 $v_d = '(Unavailable)'; 28 $td_style = 'color: #e00;'; 29 } 30 $tr_style = $v_d != $v_c ? 'font-weight:bold;' : ''; 31 ?> 32 <tr style="<?php echo $tr_style; ?>"> 33 <td class="sc-nowrap"><label><?php echo oTxt($k); ?></label></td> 34 <td style="<?php echo $td_style; ?>"><?php echo oTxt($v_d); ?></td> 35 <td style="<?php echo $td_style; ?>"><?php echo oTxt($v_c); ?></td> 36 </tr> 37 <?php } ?> 38 </tbody> 39 </table> 40 <p class="sc-help"><?php echo _("Emboldened lines indicate something changed between the saved version and the current record."); ?></p> 41 <?php 42 } 8 43 9 <?php if (is_array($data) && !empty($data) && is_array($current) && !empty($current)) { ?> 10 <table class="list"> 11 <tr> 12 <th class="sc-padleft"><?php echo _("Field"); ?></th> 13 <th class="sc-padleft"><?php echo _("Saved version"); ?></th> 14 <th class="sc-padleft"><?php echo _("Current record"); ?></th> 15 </tr> 16 <?php 17 foreach ($current as $k=>$v_c) { 18 $v_d = isset($data[$k]) ? $data[$k] : '<span style="color: #e00;">Unavailable</span>'; 19 $style = $v_d != $v_c ? ' style="font-weight: bold;"' : ''; 20 ?> 21 <tr> 22 <td class="sc-padleft sc-nowrap"<?php echo $style; ?>><label><?php echo $k; ?></label></td> 23 <td class="sc-padleft"><?php echo $v_d; ?></td> 24 <td class="sc-padleft"><?php echo $v_c; ?></td> 25 </tr> 26 <?php } ?> 27 </table> 28 <?php } ?> 44 // Buttons. 45 $action_links = array(); 46 if (!getFormData('current', false)) { 47 $action_links[] = array('href' => $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')), 'value' => _("Restore this saved version"), 'class' => 'small button alert', 'accesskey' => 'r'); 48 } 49 $action_links[] = array('href' => $app->ohref(oTxt($_SERVER['PHP_SELF'])), 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'b'); 50 HTML::printButtons($action_links); 51 ?> 52 </div> 53 </div> 54 </main> -
trunk/services/templates/versions_list.ihtml
r295 r497 1 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 2 <?php $app->printHiddenSession() ?> 3 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" /> 4 <table class="list"> 5 <tr> 6 <th class="sc-padleft" colspan="3"> </th> 7 <th class="sc-padleft"><?php echo _("ID"); ?></th> 8 <th class="sc-padleft"><?php echo _("Saved"); ?></th> 9 <th class="sc-padleft"><?php echo _("By"); ?></th> 10 </tr> 11 <?php 12 $first = true; 13 foreach ($versions as $v) { ?> 14 <tr> 15 <?php if ($first) { ?> 16 <td class="sc-padleft sc-nowrap">[<a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=view¤t=true&version_id=' . $v['version_id']); ?>">view</a>]</td> 17 <td class="sc-padleft sc-nowrap" colspan="2">(<?php echo _("Current record"); ?>)</td> 18 <?php } else { ?> 19 <td class="sc-padleft sc-nowrap">[<a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>">view</a>]</td> 20 <td class="sc-padleft sc-nowrap">[<a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>">diff</a>]</td> 21 <td class="sc-padleft sc-nowrap">[<a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>">restore</a>]</td> 22 <?php } ?> 23 <td class="sc-padleft sc-nowrap"><?php echo $v['version_id']; ?></td> 24 <td class="sc-padleft sc-nowrap"><?php echo date('d M Y H:i:s', strtotime($v['version_datetime'])); ?></td> 25 <td class="sc-padleft sc-nowrap"><?php echo $v['editor']; ?></td> 26 </tr> 27 <?php 28 $first = false; 29 } 30 ?> 31 </table> 32 <div class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></div> 33 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" /> 34 </form> 1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 </div> 5 </header> 6 <main role="main"> 7 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form"> 8 <?php $app->printHiddenSession() ?> 9 <div class="row"> 10 <div class="large-12 columns"> 11 <table> 12 <thead> 13 <tr> 14 <th></th> 15 <th><?php echo _("ID"); ?></th> 16 <th><?php echo _("Date"); ?></th> 17 <th><?php echo _("By"); ?></th> 18 </tr> 19 </thead> 20 <tbody> 21 <?php 22 $first = true; 23 foreach ($versions as $v) { ?> 24 <tr> 25 <td> 26 <a href="#" data-dropdown="actions-for-id-<?php echo oTxt($v['version_id']); ?>" aria-controls="actions-for-id-<?php echo oTxt($v['version_id']); ?>" aria-expanded="false" class="sc-action dropdown" data-options="is_hover:false"><i class="fa fa-cog fa-lg"></i></a> 27 <ul id="actions-for-id-<?php echo oTxt($v['version_id']); ?>" data-dropdown-content class="f-dropdown sc-action" aria-hidden="true" tabindex="-1"> 28 <li><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>"><i class="fa fa-eye fa-fw"></i> <?php printf(_("View version <em>%s</em>"), oTxt(truncate($v['version_id'], 30))) ?></a></li> 29 <?php if (!$first) { ?> 30 <li><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>"><i class="fa fa-columns fa-fw"></i> <?php printf(_("View differences from version %s"), oTxt(truncate($v['version_id'], 30))) ?></a></li> 31 <li><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>"><i class="fa fa-history fa-fw"></i> <?php printf(_("Restore version <em>%s</em>"), oTxt(truncate($v['version_id'], 30))) ?></a></li> 32 <?php } ?> 33 </ul> 34 </td> 35 <td class="sc-padleft sc-nowrap"><?php echo $v['version_id']; ?></td> 36 <td class="sc-padleft sc-nowrap"><?php 37 echo date(sprintf('%s %s', $app->getParam('date_format'), $app->getParam('time_format')), strtotime($v['version_datetime'])); 38 if ($first) { 39 ?> <span><em>(<?php echo _("The current record"); ?>)</em></span><?php 40 } 41 ?></td> 42 <td class="sc-padleft sc-nowrap"><?php echo $v['editor']; ?></td> 43 </tr> 44 <?php 45 $first = false; 46 } 47 ?> 48 </tbody> 49 </table> 50 <div class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></div> 51 <?php 52 HTML::printButtons(array( 53 array('name' => 'op', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'), 54 )); 55 ?> 56 </div> 57 </div> 58 </form> 59 </main> -
trunk/services/templates/versions_view.ihtml
r457 r497 1 <div class="commandbox"> 2 <span class="sc-nowrap commanditem"><a href="<?php echo $app->ohref(oTxt($_SERVER['PHP_SELF'])); ?>"><?php echo _("Back to the Versions List"); ?></a></span> 3 <?php if (!getFormData('current', false)) { ?> 4 <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span> 5 <?php } ?> 6 </div> 1 <header class="row"> 2 <div class="large-12 columns"> 3 <h1><?php echo $nav->get('title'); ?></h1> 4 </div> 5 </header> 6 <main role="main"> 7 <div class="row"> 8 <div class="large-12 columns"> 9 <?php 10 if (is_array($data) && !empty($data)) { 11 ?> 12 <table class="list"> 13 <tbody> 14 <?php 15 foreach ($data as $k => $v_d) { 16 ?> 17 <tr> 18 <td class="sc-nowrap"><label><?php echo oTxt($k); ?></label></td> 19 <td><pre><?php echo oTxt($v_d); ?></pre></td> 20 </tr> 21 <?php } ?> 22 </tbody> 23 </table> 24 <?php 25 } 7 26 8 <?php if (is_array($data) && !empty($data)) { ?> 9 <table class="list"> 10 <?php 11 while ((list($k, $v_d) = each($data))) { 12 ?> 13 <tr> 14 <td class="sc-padleft sc-nowrap"><label><?php echo $k; ?></label></td> 15 <td class="sc-padleft"><pre><?php echo $v_d; ?></pre></td> 16 </tr> 17 <?php } ?> 18 </table> 19 <?php } ?> 27 // Buttons. 28 $action_links = array(); 29 if (!getFormData('current', false)) { 30 $action_links[] = array('href' => $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')), 'value' => _("Restore this saved version"), 'class' => 'small button alert', 'accesskey' => 'r'); 31 } 32 $action_links[] = array('href' => $app->ohref(oTxt($_SERVER['PHP_SELF'])), 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'b'); 33 HTML::printButtons($action_links); 34 ?> 35 </div> 36 </div> 37 </main> -
trunk/services/versions.php
r468 r497 32 32 require_once 'codebase/lib/Version.inc.php'; 33 33 require_once 'codebase/lib/Lock.inc.php'; 34 require_once 'codebase/lib/HTML.inc.php'; 34 35 35 36 /****************************************************************************** … … 39 40 // Since we're using the singleton pattern we can instantiate a Version object earlier with custom parameters. 40 41 $version =& Version::getInstance($auth); 42 $version->setParam(array( 43 // If true, makes an exact comparison of saved vs. live table schemas. If false, just checks that the saved columns are available. 44 'db_schema_strict' => false, 45 )); 41 46 42 47 // Query arguments to retain their values between page requests. … … 80 85 $data = $version->getData($version_id); 81 86 $versionrecord = $version->getVerson($version_id); 82 $nav->add(sprintf(_(" View <em>%s</em> version %s (%s)"), $versionrecord['version_title'], $version_id, $versionrecord['version_datetime']));87 $nav->add(sprintf(_("%s <small>Version %s (%s)</small>"), $versionrecord['version_title'], $version_id, date(sprintf('%s %s', $app->getParam('date_format'), $app->getParam('time_format')), strtotime($versionrecord['version_datetime'])))); 83 88 $main_template = 'versions_view.ihtml'; 84 89 break; … … 89 94 $current = $version->getCurrent($record_table, $record_key, $record_val); 90 95 if (serialize($data) == serialize($current)) { 91 $app->raiseMsg(sprintf(_("Version <em>%s</em>is identical to the current record"), $version_id), MSG_NOTICE, __FILE__, __LINE__);96 $app->raiseMsg(sprintf(_("Version %s is identical to the current record"), $version_id), MSG_NOTICE, __FILE__, __LINE__); 92 97 } 93 $nav->add(sprintf(_(" Difference between version %s (%s) and current record."), $version_id, $versionrecord['version_datetime']));98 $nav->add(sprintf(_("%s <small>Version %s (%s)</small>"), $versionrecord['version_title'], $version_id, date(sprintf('%s %s', $app->getParam('date_format'), $app->getParam('time_format')), strtotime($versionrecord['version_datetime'])))); 94 99 $main_template = 'versions_diff.ihtml'; 95 100 break; … … 119 124 if (is_array($versions) && !empty($versions)) { 120 125 $_POST['version_title'] = $versions[0]['version_title']; 121 $nav->add(sprintf(_("%s versions of record<em>%s</em>"), sizeof($versions), $versions[0]['version_title']));126 $nav->add(sprintf(_("%s versions of <em>%s</em>"), sizeof($versions), $versions[0]['version_title'])); 122 127 $main_template = 'versions_list.ihtml'; 123 128 } else { 124 $app->raiseMsg(sprintf(_("No saved versions available for this record"), null), MSG_NOTICE, __FILE__, __LINE__);129 $app->raiseMsg(sprintf(_("No saved versions available"), null), MSG_NOTICE, __FILE__, __LINE__); 125 130 $app->dieBoomerangURL('versions'); 126 131 }
Note: See TracChangeset
for help on using the changeset viewer.