Changeset 324


Ignore:
Timestamp:
Apr 26, 2008 1:25:46 AM (16 years ago)
Author:
quinn
Message:

Minor updates.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/form_template.cli.php

    r319 r324  
    6666    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
    6767    <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', __///__)", '$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>
    7270</div>
    7371E_O_F;
  • trunk/lib/Navigation.inc.php

    r304 r324  
    205205     *
    206206     * @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.
    209208     */
    210209    function getBreadcrumbs()
     
    213212
    214213        if ($this->getParam('breadcrumbs')) {
    215             $breadcrumbs = '';
     214            $breadcrumbs = array();
    216215            $pathmark = '';
    217216            $crumb_count = sizeof($this->pages);
     
    219218                if ($crumb_count <= $this->getParam('chop_breadcrumbs')) {
    220219                    // Stop gathering crumbs.
    221                     return $breadcrumbs;
     220                    break;
    222221                }
    223222                if ($crumb_count <= 1) {
     
    225224                    if ('' == trim($page['url']) || $crumb_count <= $this->getParam('chop_breadcrumb_links')) {
    226225                        // 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));
    228227                    } else if ($crumb_count > $this->getParam('chop_breadcrumb_links')) {
    229228                        // 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>';
    231230                    }
    232231                } else {
    233232                    if ('' == trim($page['url'])) {
    234233                        // A crumb with no link.
    235                         $breadcrumbs .= oTxt($pathmark . $page['title'], true);
     234                        $breadcrumbs[] = oTxt($pathmark . $page['title'], true);
    236235                    } else {
    237236                        // 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>';
    239238                    }
    240239                }
     
    242241                $crumb_count--;
    243242            }
    244             return $breadcrumbs;
    245         } else {
    246             return false;
     243            return join(oTxt($pathmark, true), $breadcrumbs);
     244        } else {
     245            return '';
    247246        }
    248247    }
  • trunk/lib/TemplateGlue.inc.php

    r323 r324  
    302302 * @param  string $extra_clause     SQL exclude cluase. Something like "WHERE girls != 'buckteeth'"
    303303 */
    304 function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='')
     304function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s')
    305305{
    306306    $db =& DB::getInstance();
     
    326326        }
    327327    }
    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);
    329330    while ($row = mysql_fetch_assoc($qid)) {
    330331        $selected = in_array($row[$val_column], $preselected) ? ' selected="selected"' : '';
Note: See TracChangeset for help on using the changeset viewer.