Esempio n. 1
0
function mcnodearr($cnstr)
{
    global $mcnodes, $mcn_max_addno;
    load_cache('mcnodes');
    if ($cnode = read_mcnode($cnstr)) {
        $cnode['cname'] = $cnode['alias'];
        view_mcnurl($cnstr, $cnode);
    } else {
        $cnode = array('alias' => '');
        for ($i = 0; $i <= $mcn_max_addno; $i++) {
            $cnode['mcnurl' . ($i ? $i : '')] = '#';
        }
    }
    return $cnode;
}
Esempio n. 2
0
 tabfooter();
 $addstr = "&nbsp; &nbsp; <input class=\"checkbox\" type=\"checkbox\" name=\"select_all\" value=\"1\">&nbsp;" . lang('selectallpage');
 tabheader(lang('mcnode_list') . $addstr, '', '', 12);
 $cy_arr = array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" onclick=\"checkall(this.form, 'selectid', 'chkall')\">", array(lang('cnode_name'), 'txtL'), array(lang('nodetype') . '-ID', 'txtL'), array(lang('look'), 'txtL'));
 for ($i = 0; $i <= min($mcn_max_addno, 2); $i++) {
     $cy_arr[] = $i ? lang('addp') . $i . lang('template') : lang('index_tpl');
 }
 $cy_arr[] = lang('detail');
 trcategory($cy_arr);
 $pagetmp = $page;
 do {
     $query = $db->query("SELECT * {$fromsql} {$wheresql} ORDER BY cnid ASC LIMIT " . ($pagetmp - 1) * $atpp . ",{$atpp}");
     $pagetmp--;
 } while (!$db->num_rows($query) && $pagetmp);
 while ($cnode = $db->fetch_array($query)) {
     view_mcnurl($cnode['ename'], $cnode);
     $lookstr = '';
     for ($i = 0; $i <= $cnode['addnum']; $i++) {
         $lookstr .= "<a href=\"" . $cnode['mcnurl' . ($i ? $i : '')] . "\" target=\"_blank\">" . ($i ? lang('add_p') . $i : lang('index')) . "</a>&nbsp; ";
     }
     $tplsarr = explode(',', $cnode['tpls']);
     echo "<tr class=\"txt\"><td class=\"txtC\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$cnode['cnid']}]\" value=\"{$cnode['cnid']}\">\n";
     echo "<td class=\"txtL\">{$cnode['alias']}</td>\n";
     echo "<td class=\"txtL\">" . $mcnvars[$cnode['mcnvar']] . "-" . $cnode['mcnid'] . "</td>\n";
     echo "<td class=\"txtL\">{$lookstr}</td>\n";
     for ($i = 0; $i <= min($mcn_max_addno, 2); $i++) {
         echo "<td class=\"txtC\">" . (empty($tplsarr[$i]) ? '-' : (empty($mtpls[@$tplsarr[$i]]['cname']) ? $tplsarr[$i] : $mtpls[@$tplsarr[$i]]['cname'])) . "</td>\n";
     }
     echo "<td class=\"txtC\"><a href=\"?entry={$entry}&action=mcnodedetail&cnid={$cnode['cnid']}{$param_suffix}\" onclick=\"return floatwin('open_cnodedetail',this)\">" . lang('edit') . "</a></td></tr>\n";
 }
 tabfooter();