Changeset 324
- Timestamp:
- Apr 26, 2008 1:25:46 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r319 r324 66 66 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 67 67 <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '—', __///__)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select> 68 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=add&boomerang=true'); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo _("Add __///__") \x3f></a></span> 69 <\x3fphp if ('' != \$frm['__///___id']) { \x3f> 70 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo sprintf(_("Edit __///__ <em>%s</em>"), \$frm['__///__']) \x3f></a></span> 71 <\x3fphp } \x3f> 68 <a href="<\x3fphp echo \$app->oHREF('/admin/__///__.php?op=add&boomerang=true'); \x3f>" class="sc-warn sc-add-link"><img src="/admin/i/plus.gif" width="10" height="10" alt="[+]" /></a> 69 <a href="<\x3fphp echo \$app->oHREF('/admin/__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" class="sc-warn sc-edit-link"><img src="/admin/i/pen.gif" width="12" height="12" alt="Edit" /></a> 72 70 </div> 73 71 E_O_F; -
trunk/lib/Navigation.inc.php
r304 r324 205 205 * 206 206 * @access public 207 * 208 * @return mixed Breadcrumbs (string) or false if breadcrumbs param not set. 207 * @return string Breadcrumbs or empty string if breadcrumbs param not set. 209 208 */ 210 209 function getBreadcrumbs() … … 213 212 214 213 if ($this->getParam('breadcrumbs')) { 215 $breadcrumbs = '';214 $breadcrumbs = array(); 216 215 $pathmark = ''; 217 216 $crumb_count = sizeof($this->pages); … … 219 218 if ($crumb_count <= $this->getParam('chop_breadcrumbs')) { 220 219 // Stop gathering crumbs. 221 return $breadcrumbs;220 break; 222 221 } 223 222 if ($crumb_count <= 1) { … … 225 224 if ('' == trim($page['url']) || $crumb_count <= $this->getParam('chop_breadcrumb_links')) { 226 225 // A crumb with no link. 227 $breadcrumbs .= oTxt($pathmark, true) .sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true));226 $breadcrumbs[] = sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)); 228 227 } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) { 229 228 // A normal linked crumb. 230 $breadcrumbs .= oTxt($pathmark, true) .'<a href="' . $app->oHREF($page['url']) . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>';229 $breadcrumbs[] = '<a href="' . $app->oHREF($page['url']) . '">' . sprintf($this->getParam('last_crumb_format'), oTxt($page['title'], true)) . '</a>'; 231 230 } 232 231 } else { 233 232 if ('' == trim($page['url'])) { 234 233 // A crumb with no link. 235 $breadcrumbs .= oTxt($pathmark . $page['title'], true);234 $breadcrumbs[] = oTxt($pathmark . $page['title'], true); 236 235 } else { 237 236 // A normal linked crumb. 238 $breadcrumbs .= oTxt($pathmark, true) .'<a href="' . $app->oHREF($page['url']) . '">' . oTxt($page['title'], true) . '</a>';237 $breadcrumbs[] = '<a href="' . $app->oHREF($page['url']) . '">' . oTxt($page['title'], true) . '</a>'; 239 238 } 240 239 } … … 242 241 $crumb_count--; 243 242 } 244 return $breadcrumbs;245 } else { 246 return false;243 return join(oTxt($pathmark, true), $breadcrumbs); 244 } else { 245 return ''; 247 246 } 248 247 } -
trunk/lib/TemplateGlue.inc.php
r323 r324 302 302 * @param string $extra_clause SQL exclude cluase. Something like "WHERE girls != 'buckteeth'" 303 303 */ 304 function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='' )304 function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s') 305 305 { 306 306 $db =& DB::getInstance(); … … 326 326 } 327 327 } 328 $qid = $db->query("SELECT $key_column, $val_column FROM $db_table $extra_clause",false); 328 // $qid = $db->query("SELECT $key_column, $val_column FROM $db_table $extra_clause",false); 329 $qid = $db->query(sprintf($sql_format, $key_column, $val_column, $db_table, $extra_clause),false); 329 330 while ($row = mysql_fetch_assoc($qid)) { 330 331 $selected = in_array($row[$val_column], $preselected) ? ' selected="selected"' : '';
Note: See TracChangeset
for help on using the changeset viewer.