Changeset 485
- Timestamp:
- Aug 14, 2014 8:29:47 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r468 r485 5 5 * For details visit the project site: <http://trac.strangecode.com/codebase/> 6 6 * Copyright 2001-2012 Strangecode, LLC 7 * 7 * 8 8 * This file is part of The Strangecode Codebase. 9 9 * … … 12 12 * Free Software Foundation, either version 3 of the License, or (at your option) 13 13 * any later version. 14 * 14 * 15 15 * The Strangecode Codebase is distributed in the hope that it will be useful, but 16 16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 18 18 * details. 19 * 19 * 20 20 * You should have received a copy of the GNU General Public License along with 21 21 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 82 82 if (preg_match('/.*_id$/i', $field)) { 83 83 $output[$field] = <<<E_O_F 84 84 85 85 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 86 86 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> … … 101 101 <input type="file" name="$field" id="$field" /> 102 102 <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f> 103 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\ \$s\"><strong>%2\\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div>103 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\$s\"><strong>%2\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div> 104 104 <\x3fphp } \x3f> 105 105 <div class="sc-help"><\x3fphp printf(_("Allowed file types: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div> … … 157 157 158 158 // Textarea small 159 case 'tinytiny' : 159 160 case 'text' : 160 161 case 'tinyblob' : … … 164 165 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 165 166 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 166 <textarea name="$field" id="$field" rows="8" cols="40" class="sc- shortsc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>167 <textarea name="$field" id="$field" rows="8" cols="40" class="sc-tall sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 167 168 </div> 168 169 E_O_F; … … 178 179 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 179 180 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 180 <textarea name="$field" id="$field" rows="8" cols="40" class="sc- shortsc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>181 <textarea name="$field" id="$field" rows="8" cols="40" class="sc-fullscreen sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 181 182 </div> 182 183 E_O_F; -
trunk/css/codebase.inc.css
r455 r485 12 12 z-index: 2000000000; /* Close to the maximum of a 32-bit integer. */ 13 13 margin: 1em 0; 14 padding: .6em .6em .3em;15 border: 1px solid #ddd;16 14 background: #fafafa; 15 padding: 0; 16 border: none; 17 17 } 18 .sc-msg-success { color: #090; } 19 .sc-msg-notice { color: #C60; } 20 .sc-msg-warning, 21 .sc-msg-error { color: #f00; } 18 form .sc-msg-success label { color: #76B15B; font-weight: bold; } 19 form .sc-msg-notice label { color: #B19332; font-weight: bold; } 20 form .sc-msg-warning label { color: #9200AE; font-weight: bold; } 21 form .sc-msg-error label { color: #b34; font-weight: bold; } 22 .sc-msg > .sc-msg-success { color: #76B15B; font-weight: bold; } 23 .sc-msg > .sc-msg-notice { color: #B19332; font-weight: bold; } 24 .sc-msg > .sc-msg-warning { color: #9200AE; font-weight: bold; } 25 .sc-msg > .sc-msg-error { color: #b34; font-weight: bold; } 22 26 .sc-msg > .sc-msg-success, 23 27 .sc-msg > .sc-msg-notice, 24 28 .sc-msg > .sc-msg-warning, 25 29 .sc-msg > .sc-msg-error { 26 background: #fafafa;27 padding:0;28 margin: .5em 0;30 padding: .25em .5em; 31 margin: 5px 0; 32 color: #fff; 29 33 } 34 .sc-msg > .sc-msg-success a, 35 .sc-msg > .sc-msg-notice a, 36 .sc-msg > .sc-msg-warning a, 37 .sc-msg > .sc-msg-error a { 38 color: #fff; 39 } 40 .sc-msg > .sc-msg-success { background-color: #76B15B; } 41 .sc-msg > .sc-msg-notice { background-color: #B19332; } 42 .sc-msg > .sc-msg-warning { background-color: #9200AE; } 43 .sc-msg > .sc-msg-error { background-color: #b34; } 30 44 31 45 /* PEdit.inc.php ---------------------------------------------------- */ -
trunk/css/utilities.inc.css
r456 r485 40 40 .sc-clearboth { clear: both; } 41 41 .sc-help { color: #999; font-weight: normal; } 42 .sc-hidden { display: none; visibility: hidden;}42 .sc-hidden { display: none; } 43 43 .sc-monospaced { font-family: monospace; } 44 44 .sc-padleft { padding-left: 10px; } 45 45 .sc-padright { padding-right: 10px; } 46 .sc-marginleft { margin-left: 10px; } 47 .sc-marginright { margin-right: 10px; } 46 48 .sc-right { text-align: right; } 47 49 .sc-normal { font-weight: normal; } 48 50 .sc-nowrap { white-space: nowrap; } 49 51 .sc-dim { 50 filter:alpha(opacity= 25);51 -moz-opacity:. 25;52 opacity:. 25;52 filter:alpha(opacity=33); 53 -moz-opacity:.33; 54 opacity:.33; 53 55 } 54 56 .sc-note:hover { cursor: help; } -
trunk/docs/version.txt
r380 r485 1 2.1. 7dev1 2.1.8dev -
trunk/lib/Navigation.inc.php
r484 r485 198 198 199 199 /** 200 * Returns the path from root up to the current page as an array. 201 * 202 * @access public 203 * @param string $key Which value to use in the path (usually head_title or body_title or just title). 204 * @return mixed Path (string) or false if path param is not set. 205 */ 206 public function getPathArray($key='title') 207 { 208 $path = array(); 209 if ($this->getParam('path')) { 210 foreach ($this->pages as $page) { 211 $path[] = strip_tags($page[$key]); 212 } 213 } 214 return $path; 215 } 216 217 /** 200 218 * Returns the text path from root up to the current page, separated by the 201 219 * path_delimiter. … … 207 225 public function getPath($key='title') 208 226 { 209 if ($this->getParam('path')) { 210 $path = ''; 211 $pathmark = ''; 227 228 $path = $this->getPathArray(); 229 return empty($path) ? '' : join(oTxt($this->getParam('path_delimiter'), true), $path); 230 } 231 232 /** 233 * Returns the breadcrumbs from the root page to the current page. 234 * Breadcrumbs are the text path with pages titles linked to that page. 235 * 236 * @access public 237 * @return string Breadcrumbs or empty string if breadcrumbs param not set. 238 */ 239 public function getBreadcrumbsArray() 240 { 241 $app =& App::getInstance(); 242 243 if ($this->getParam('breadcrumbs')) { 244 $breadcrumbs = array(); 245 $crumb_count = sizeof($this->pages); 212 246 foreach ($this->pages as $page) { 213 $path .= oTxt($pathmark . strip_tags($page[$key]), true); 214 $pathmark = $this->getParam('path_delimiter'); 215 } 216 return $path; 247 if ($crumb_count <= $this->getParam('chop_breadcrumbs')) { 248 // Stop gathering crumbs. 249 break; 250 } 251 if ($crumb_count <= 1) { 252 // The last crumb. 253 if ('' == trim($page['url']) || $crumb_count <= $this->getParam('chop_breadcrumb_links')) { 254 // A crumb with no link. 255 $breadcrumbs[] = array( 256 'url' => false, 257 'title' => sprintf($this->getParam('last_crumb_format'), $page['title']) 258 ); 259 } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) { 260 // A normal linked crumb. 261 $breadcrumbs[] = array( 262 'url' => $page['url'], 263 'title' => sprintf($this->getParam('last_crumb_format'), $page['title']) 264 ); 265 } 266 } else { 267 if ('' == trim($page['url'])) { 268 // A crumb with no link. 269 $breadcrumbs[] = array( 270 'url' => false, 271 'title' => $page['title'] 272 ); 273 } else { 274 // A normal linked crumb. 275 $breadcrumbs[] = array( 276 'url' => $page['url'], 277 'title' => $page['title'] 278 ); 279 } 280 } 281 $crumb_count--; 282 } 283 return $breadcrumbs; 217 284 } else { 218 return false;285 return array(); 219 286 } 220 287 } … … 247 314 } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) { 248 315 // A normal linked crumb. 249 $breadcrumbs[] = '<a href="' . $ app->oHREF($page['url']). '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>';316 $breadcrumbs[] = '<a href="' . $page['url'] . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>'; 250 317 } 251 318 } else { … … 255 322 } else { 256 323 // A normal linked crumb. 257 $breadcrumbs[] = '<a href="' . $ app->oHREF($page['url']). '">' . oTxt($page['title'], true) . '</a>';324 $breadcrumbs[] = '<a href="' . $page['url'] . '">' . oTxt($page['title'], true) . '</a>'; 258 325 } 259 326 } -
trunk/lib/Upload.inc.php
r484 r485 82 82 // Enforce valid upload_path parameter. 83 83 if (isset($params['upload_path'])) { 84 $ params['upload_path']= realpath($params['upload_path']);84 $upload_path = realpath($params['upload_path']); 85 85 // Source must be directory. 86 if (!is_dir($ params['upload_path'])) {87 $app->logMsg(sprintf('Attempting to auto-create upload directory: %s', $ params['upload_path']), LOG_NOTICE, __FILE__, __LINE__);86 if (!is_dir($upload_path)) { 87 $app->logMsg(sprintf('Attempting to auto-create upload directory: %s', $upload_path), LOG_NOTICE, __FILE__, __LINE__); 88 88 if (version_compare(PHP_VERSION, '5.0.0', '>=')) { 89 89 // Recursive. 90 mkdir($ params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'), true);90 mkdir($upload_path, isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'), true); 91 91 } else { 92 mkdir($ params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'));92 mkdir($upload_path, isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms')); 93 93 } 94 if (!is_dir($ params['upload_path'])) {94 if (!is_dir($upload_path)) { 95 95 $app->logMsg(sprintf('Upload directory invalid: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__); 96 96 trigger_error(sprintf('Upload directory invalid: %s', $params['upload_path']), E_USER_ERROR); … … 98 98 } 99 99 // Source must be writable. 100 if (!is_writable($ params['upload_path'])) {100 if (!is_writable($upload_path)) { 101 101 $app->logMsg(sprintf('Upload directory not writable: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__); 102 102 trigger_error(sprintf('Upload directory not writable: %s', $params['upload_path']), E_USER_ERROR); … … 197 197 if (is_array($custom_file_name) && sizeof($custom_file_name) == 1) { 198 198 // Is an array, but just one value. Pull it out. 199 $ custom_file_name = current($custom_file_name);199 $file_name = current($custom_file_name); 200 200 $this->_raiseMsg(sprintf(_("The file %s has been renamed to %s."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__); 201 201 $app->logMsg(sprintf('Using custom file name: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__); … … 520 520 $app =& App::getInstance(); 521 521 522 if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && $this->getParam('display_messages') & $type> 0)) {522 if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && ($this->getParam('display_messages') & $type) > 0)) { 523 523 $app->raiseMsg($message, $type, $file, $line); 524 524 } -
trunk/lib/Utilities.inc.php
r479 r485 139 139 * @param string $text Text to clean. 140 140 * @param bool $preserve_html If set to true, oTxt will not translate <, >, ", or ' 141 * characters into HTML entities. This allows HTML to pass through un munged.142 * @return string Cleanedtext.141 * characters into HTML entities. This allows HTML to pass through undisturbed. 142 * @return string HTML-safe text. 143 143 */ 144 144 function oTxt($text, $preserve_html=false)
Note: See TracChangeset
for help on using the changeset viewer.