Changeset 235
- Timestamp:
- Mar 7, 2007 11:32:07 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/revision_history.txt
r137 r235 21 21 22 22 remove interdependencies: 23 - App() is the only dependency for other classes. It includes Utilities.inc.php silently.24 - Update libs requiring external files, such as html templates and email templates, classes now self-contained.23 - App() is the primary dependency for other classes. It includes Utilities.inc.php silently. 24 - Updated classes requiring external files, such as html templates and email templates, classes now self-contained. 25 25 26 26 Things with modified interfaces: -
trunk/lib/ImageThumb.inc.php
r224 r235 156 156 * 157 157 * @access public 158 * @param array $spec The specifications for a size of output image. 158 * @param array $spec The specifications for a size of output image. 159 * @param int $index The position of the specification in the spec array 160 * Use to overwrite existing spev array values. 159 161 */ 160 162 function setSpec($spec, $index=null) -
trunk/lib/Lock.inc.php
r202 r235 377 377 ?></p> 378 378 379 <?php if ($this->getSecondsElapsed() > $this->getParam('timeout')) { ?>379 <?php if ($this->getSecondsElapsed() >= $this->getParam('timeout')) { ?> 380 380 <p><?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."), $this->getEditor()) ?></p> 381 381 <input type="submit" name="unlock" value="<?php echo _("Unlock"); ?>" /> … … 416 416 function getSecondsElapsed() 417 417 { 418 if (isset($this->data['lock_datetime']) && $this->data['lock_datetime']< time()) {418 if (isset($this->data['lock_datetime']) && strtotime($this->data['lock_datetime']) < time()) { 419 419 return time() - strtotime($this->data['lock_datetime']); 420 420 } else { -
trunk/lib/Utilities.inc.php
r224 r235 150 150 function getTextColor($text, $method=1) 151 151 { 152 $r = substr(md5($text), 0, 1); 153 $g = substr(md5($text), 1, 1); 154 $b = substr(md5($text), 2, 1); 152 $hash = md5($text); 153 $rgb = array( 154 substr($hash, 0, 1), 155 substr($hash, 1, 1), 156 substr($hash, 2, 1), 157 substr($hash, 3, 1), 158 substr($hash, 4, 1), 159 substr($hash, 5, 1), 160 ); 155 161 156 162 switch ($method) { 157 case 2 :158 if (hexdec($r) > hexdec('c')) {159 $r = dechex(hexdec('f') - hexdec($r));160 }161 if (hexdec($g) > hexdec('c')) {162 $g = dechex(hexdec('f') - hexdec($g));163 }164 if (hexdec($b) > hexdec('c')) {165 $b = dechex(hexdec('f') - hexdec($b));166 }167 break;168 169 163 case 1 : 170 164 default : 171 $r = dechex(round(hexdec($r) * .8)); 172 $g = dechex(round(hexdec($g) * .8)); 173 $b = dechex(round(hexdec($b) * .6)); 165 // Reduce all hex values slighly to avoid all white. 166 array_walk($rgb, create_function('&$v', '$v = dechex(round(hexdec($v) * 0.87));')); 174 167 break; 175 } 176 177 return $r . $r . $g . $g . $b . $b; 168 case 2 : 169 foreach ($rgb as $i => $v) { 170 if (hexdec($v) > hexdec('c')) { 171 $rgb[$i] = dechex(hexdec('f') - hexdec($v)); 172 } 173 } 174 break; 175 } 176 177 return join('', $rgb); 178 178 } 179 179 … … 392 392 * @return array URL with array elements as URL key=value arguments. 393 393 */ 394 function urlEncodeArray($data, $prefix='', $_return=true) { 394 function urlEncodeArray($data, $prefix='', $_return=true) 395 { 395 396 396 397 // Data is stored in static variable. … … 428 429 * @return string url A string ready to append to a url. 429 430 */ 430 function urlEncodeArrayToString($data, $prefix='') { 431 function urlEncodeArrayToString($data, $prefix='') 432 { 431 433 432 434 $array_args = urlEncodeArray($data, $prefix); … … 708 710 * will see data before the page is finished processing. 709 711 */ 710 function flushBuffer() { 712 function flushBuffer() 713 { 711 714 echo str_repeat(' ', 205); 712 715 flush(); -
trunk/services/templates/admin_form.ihtml
r185 r235 13 13 </tr> 14 14 <tr> 15 <td class="sc-right"><label for="username" <?php $fv->err('username', ' class="error"') ?>><?php echo _("Username"); ?></label></td>15 <td class="sc-right"><label for="username" class="<?php $fv->err('username'); ?>"><?php echo _("Username"); ?></label></td> 16 16 <td> 17 17 <input type="text" class="sc-small" size="50" name="username" value="<?php echo oTxt($frm['username']); ?>" /> … … 19 19 </tr> 20 20 <tr> 21 <td class="sc-right"><label for="userpass" <?php $fv->err('userpass', ' class="error"') ?>><?php echo _("Password"); ?></label></td>21 <td class="sc-right"><label for="userpass" class="<?php $fv->err('userpass'); ?>"><?php echo _("Password"); ?></label></td> 22 22 <td> 23 23 <input type="password" class="sc-small" size="50" name="userpass" value="<?php echo oTxt($frm['userpass']); ?>" /> … … 25 25 </tr> 26 26 <tr> 27 <td class="sc-right"><label for="first_name" <?php $fv->err('first_name', ' class="error"') ?>><?php echo _("First name"); ?></label></td>27 <td class="sc-right"><label for="first_name" class="<?php $fv->err('first_name'); ?>"><?php echo _("First name"); ?></label></td> 28 28 <td> 29 29 <input type="text" class="sc-small" size="50" name="first_name" value="<?php echo oTxt($frm['first_name']); ?>" /> … … 31 31 </tr> 32 32 <tr> 33 <td class="sc-right"><label for="last_name" <?php $fv->err('last_name', ' class="error"') ?>><?php echo _("Last name"); ?></label></td>33 <td class="sc-right"><label for="last_name" class="<?php $fv->err('last_name'); ?>"><?php echo _("Last name"); ?></label></td> 34 34 <td> 35 35 <input type="text" class="sc-small" size="50" name="last_name" value="<?php echo oTxt($frm['last_name']); ?>" /> … … 37 37 </tr> 38 38 <tr> 39 <td class="sc-right"><label for="email" <?php $fv->err('email', ' class="error"') ?>><?php echo _("Email"); ?></label></td>39 <td class="sc-right"><label for="email" class="<?php $fv->err('email'); ?>"><?php echo _("Email"); ?></label></td> 40 40 <td> 41 41 <input type="text" class="sc-medium" size="50" name="email" value="<?php echo oTxt($frm['email']); ?>" /> … … 43 43 </tr> 44 44 <tr> 45 <td class="sc-right"><label for="user_type" <?php $fv->err('user_type', ' class="error"') ?>><?php echo _("User type"); ?></label></td>45 <td class="sc-right"><label for="user_type" class="<?php $fv->err('user_type'); ?>"><?php echo _("User type"); ?></label></td> 46 46 <td> 47 47 <select name="user_type" class="sc-small"> -
trunk/services/templates/password.ihtml
r185 r235 6 6 <table> 7 7 <tr> 8 <td class="sc-right"><label for="oldpassword" <?php $fv->err('oldpassword', ' class="error"') ?>><?php echo _("Old password"); ?></label></td>8 <td class="sc-right"><label for="oldpassword" class="<?php $fv->err('oldpassword'); ?>"><?php echo _("Old password"); ?></label></td> 9 9 <td> 10 10 <input type="password" class="sc-medium" size="50" name="oldpassword" /> … … 12 12 </tr> 13 13 <tr> 14 <td class="sc-right"><label for="newpassword" <?php $fv->err('newpassword', ' class="error"') ?>><?php echo _("New password"); ?></label></td>14 <td class="sc-right"><label for="newpassword" class="<?php $fv->err('newpassword'); ?>"><?php echo _("New password"); ?></label></td> 15 15 <td> 16 16 <input type="password" class="sc-medium" size="50" name="newpassword" /> … … 18 18 </tr> 19 19 <tr> 20 <td class="sc-right"><label for="newpassword2" <?php $fv->err('newpassword2', ' class="error"') ?>><?php echo _("New password again"); ?></label></td>20 <td class="sc-right"><label for="newpassword2" class="<?php $fv->err('newpassword2'); ?>"><?php echo _("New password again"); ?></label></td> 21 21 <td> 22 22 <input type="password" class="sc-medium" size="50" name="newpassword2" />
Note: See TracChangeset
for help on using the changeset viewer.