"); define("sp"," "); define("a","&"); // ------------------------------------------------------------- function end_page() { global $txp_user,$event; if($event!='tag') { echo '
', navPop().n, ''.n; echo graf('Textpattern · '.txp_version).n; echo($txp_user) ? graf(gTxt('logged_in_as').' '.span(htmlspecialchars($txp_user)).br. ''.gTxt('logout').'', ' id="moniker"').n.'
' : ''; callback_event('admin_side', 'body_end'); echo n.''.n.''; } } // ------------------------------------------------------------- function column_head($value, $sort = '', $event = '', $is_link = '', $dir = '', $crit = '', $method = '', $class = '') { return column_multi_head( array( array ('value' => $value, 'sort' => $sort, 'event' => $event, 'is_link' => $is_link, 'dir' => $dir, 'crit' => $crit, 'method' => $method) ), $class); } // ------------------------------------------------------------- function column_multi_head($head_items, $class='') { $o = n.t.''; $first_item = true; foreach ($head_items as $item) { if (empty($item)) continue; extract(lAtts(array( 'value' => '', 'sort' => '', 'event' => '', 'is_link' => '', 'dir' => '', 'crit' => '', 'method' => '', ),$item)); $o .= ($first_item) ? '' : ', '; $first_item = false; if ($is_link) { $o .= ''.$linktext.''; } // ------------------------------------------------------------- function eLink($event,$step='',$thing='',$value='',$linktext,$thing2='',$val2='') { return join('',array( ''.escape_title($linktext).'' )); } // ------------------------------------------------------------- function wLink($event,$step='',$thing='',$value='') { return join('',array( ''.sp.'!'.sp.'' )); } // ------------------------------------------------------------- function dLink($event, $step, $thing, $value, $verify = '', $thing2 = '', $thing2val = '', $get = '', $remember = null) { if ($remember) { list($page, $sort, $dir, $crit, $search_method) = $remember; } if ($get) { $url = '?event='.$event.a.'step='.$step.a.$thing.'='.urlencode($value); if ($thing2) { $url .= a.$thing2.'='.urlencode($thing2val); } if ($remember) { $url .= a.'page='.$page.a.'sort='.$sort.a.'dir='.$dir.a.'crit='.$crit.a.'search_method='.$search_method; } return join('', array( '×' )); } return join('', array( '
', fInput('submit', '', '×', 'smallerbox'), eInput($event). sInput($step), hInput($thing, $value), ($thing2) ? hInput($thing2, $thing2val) : '', ($remember) ? hInput('page', $page) : '', ($remember) ? hInput('sort', $sort) : '', ($remember) ? hInput('dir', $dir) : '', ($remember) ? hInput('crit', $crit) : '', ($remember) ? hInput('search_method', $search_method) : '', '
' )); } // ------------------------------------------------------------- function aLink($event,$step,$thing,$value,$thing2,$value2) { $o = ''.$name.' '; } // ------------------------------------------------------------- function PrevNextLink($event, $page, $label, $type, $sort = '', $dir = '', $crit = '', $search_method = '') { return ''. ($type == 'prev' ? '‹'.sp.$label : $label.sp.'›'). ''; } // ------------------------------------------------------------- function nav_form($event, $page, $numPages, $sort, $dir, $crit, $search_method) { if ($numPages > 1) { $option_list = array(); for ($i = 1; $i <= $numPages; $i++) { if ($i == $page) { $option_list[] = ''; } else { $option_list[] = ''; } } $nav = array(); $nav[] = ($page > 1) ? PrevNextLink($event, $page - 1, gTxt('prev'), 'prev', $sort, $dir, $crit, $search_method).sp : tag('‹ '.gTxt('prev'), 'span', ' class="navlink-disabled"').sp; $nav[] = ''; $nav[] = ''; $nav[] = ($page != $numPages) ? sp.PrevNextLink($event, $page + 1, gTxt('next'), 'next', $sort, $dir, $crit, $search_method) : sp.tag(gTxt('next').' ›', 'span', ' class="navlink-disabled"'); return '
'. n.eInput($event). ( $sort ? n.hInput('sort', $sort).n.hInput('dir', $dir) : '' ). ( $crit ? n.hInput('crit', $crit).n.hInput('search_method', $search_method) : '' ). join('', $nav). '
'; } else { return graf($page.'/'.$numPages, ' class="prev-next"'); } } // ------------------------------------------------------------- function startSkelTable() { return ''; } // ------------------------------------------------------------- function startTable($type,$align='',$class='',$p='',$w='') { if (!$p) $p = ($type=='edit') ? 3 : 0; $align = (!$align) ? 'center' : $align; $class = ($class) ? ' class="'.$class.'"' : ''; $width = ($w) ? ' width="'.$w.'"' : ''; return '
'.n; } // ------------------------------------------------------------- function endTable () { return n.'
'.n; } // ------------------------------------------------------------- function stackRows() { foreach(func_get_args() as $a) { $o[] = tr($a); } return join('',$o); } // ------------------------------------------------------------- function td($content='',$width='',$class='',$id='') { $content = (!$content) ? ' ' : $content; $atts[] = ($width) ? ' width="'.$width.'"' : ''; $atts[] = ($class) ? ' class="'.$class.'"' : ''; $atts[] = ($id) ? ' id="'.$id.'"' : ''; return t.tag($content,'td',join('',$atts)).n; } // ------------------------------------------------------------- function tda($content,$atts='') { return tag($content,'td',$atts); } // ------------------------------------------------------------- function tdtl($content,$atts='') { return tag($content,'td',' style="vertical-align:top;text-align:left;padding:8px"'.$atts); } // ------------------------------------------------------------- function tr($content,$atts='') { return tag($content,'tr',$atts); } // ------------------------------------------------------------- function tdcs($content,$span,$width="",$class='') { return join('',array( t.'$content\n" )); } // ------------------------------------------------------------- function tdrs($content,$span,$width="") { return join('',array( t.'$content".n )); } // ------------------------------------------------------------- function fLabelCell($text, $help = '', $label_id = '') { $help = ($help) ? popHelp($help) : ''; $cell = gTxt($text).' '.$help; if ($label_id) { $cell = ''; } return tda($cell,' class="noline" style="text-align: right; vertical-align: middle;"'); } // ------------------------------------------------------------- function fInputCell($name, $var = '', $tabindex = '', $size = '', $help = '', $id = '') { $pop = ($help) ? sp.popHelp($name) : ''; return tda( fInput('text', $name, $var, 'edit', '', '', $size, $tabindex, $id).$pop ,' class="noline"'); } // ------------------------------------------------------------- function tag($content,$tag,$atts='') { return ($content) ? '<'.$tag.$atts.'>'.$content.'' : ''; } // ------------------------------------------------------------- function graf ($item,$atts='') { return tag($item,'p',$atts); } // ------------------------------------------------------------- function hed($item,$level,$atts='') { return tag($item,'h'.$level,$atts); } // ------------------------------------------------------------- function href($item,$href,$atts='') { return tag($item,'a',$atts.' href="'.$href.'"'); } // ------------------------------------------------------------- function strong($item) { return tag($item,'strong'); } // ------------------------------------------------------------- function span($item) { return tag($item,'span'); } // ------------------------------------------------------------- function htmlPre($item) { return '
'.tag($item,'code').'
'; } // ------------------------------------------------------------- function comment($item) { return ''; } // ------------------------------------------------------------- function small($item) { return tag($item,'small'); } // ------------------------------------------------------------- function assRow($array, $atts ='') { foreach($array as $a => $b) $o[] = tda($a,' width="'.$b.'"'); return tr(join(n.t,$o), $atts); } // ------------------------------------------------------------- function assHead() { $array = func_get_args(); foreach($array as $a) $o[] = hCell(gTxt($a)); return tr(join('',$o)); } // ------------------------------------------------------------- function popHelp($help_var, $width = '', $height = '') { return '?'; } // ------------------------------------------------------------- function popHelpSubtle($help_var, $width = '', $height = '') { return '?'; } // ------------------------------------------------------------- function popTag($var, $text, $width = '', $height = '') { return ''.$text.''; } // ------------------------------------------------------------- function popTagLinks($type) { global $txpcfg; include txpath.'/lib/taglib.php'; $arname = $type.'_tags'; $out = array(); $out[] = n.''; return join('', $out); } //------------------------------------------------------------- function messenger($thing,$thething,$action) { return gTxt($thing).' '.strong($thething).' '.gTxt($action); } // ------------------------------------------------------------- function pageby_form($event, $val) { $vals = array( 15 => 15, 25 => 25, 50 => 50, 100 => 100 ); $select_page = selectInput('qty', $vals, $val,'', 1); // proper localisation $page = str_replace('{page}', $select_page, gTxt('view_per_page')); return form( '
'. $page. eInput($event). sInput($event.'_change_pageby'). ''. '
' ); } // ------------------------------------------------------------- function upload_form($label, $pophelp, $step, $event, $id = '', $max_file_size = '1000000', $label_id = '', $class = 'upload-form') { global $sort, $dir, $page, $search_method, $crit; $class = ($class) ? ' class="'.$class.'"' : ''; $label_id = ($label_id) ? $label_id : $event.'-upload'; return n.n.''. n.'
'. (!empty($max_file_size)? n.hInput('MAX_FILE_SIZE', $max_file_size): ''). n.eInput($event). n.sInput($step). n.hInput('id', $id). n.hInput('sort', $sort). n.hInput('dir', $dir). n.hInput('page', $page). n.hInput('search_method', $search_method). n.hInput('crit', $crit). n.graf( ''.sp.popHelp($pophelp).sp. fInput('file', 'thefile', '', 'edit', '', '', '', '', $label_id).sp. fInput('submit', '', gTxt('upload'), 'smallerbox') ). n.'
'. n.''; } //------------------------------------------------------------- function search_form($event, $step, $crit, $methods, $method, $default_method) { $method = ($method) ? $method : $default_method; return n.n.form( graf( ''.sp. selectInput('search_method', $methods, $method, '', '', $event.'-search').sp. fInput('text', 'crit', $crit, 'edit', '', '', '15'). eInput($event). sInput($step). fInput('submit', 'search', gTxt('go'), 'smallerbox') ) , '', '', 'get', 'search-form'); } //------------------------------------------------------------- function pref_text($name, $val, $id = '') { $id = ($id) ? $id : $name; $vals = array( USE_TEXTILE => gTxt('use_textile'), CONVERT_LINEBREAKS => gTxt('convert_linebreaks'), LEAVE_TEXT_UNTOUCHED => gTxt('leave_text_untouched') ); return selectInput($name, $vals, $val, '', '', $id); } //------------------------------------------------------------- function dom_attach($id, $content, $noscript='', $wraptag='div', $wraptagid='') { $c = addcslashes($content, "\r\n\"\'"); $c = preg_replace('@<(/?)script@', '\\x3c$1script', $c); $js = <<'.n. ''.n; if ($noscript) $out .= ''.n; return $out; } //------------------------------------------------------------- function toggle_box($classname, $form=0) { $name = 'cb_toggle_'.$classname; $i = ''. ' '. script_js("setClassRemember('".$classname."');addEvent(window, 'load', function(){setClassRemember('".$classname."');});"); if ($form) return n.form($i); else return n.$i; } //------------------------------------------------------------- function cookie_box($classname, $form=1) { $name = 'cb_'.$classname; $val = cs('toggle_'.$classname) ? 1 : 0; $i = ''. ' '; if ($form) { $args = empty($_SERVER['QUERY_STRING']) ? '' : '?'.htmlspecialchars($_SERVER['QUERY_STRING']); return '
'.$i.eInput(gps('event')).n.'
'; } else { return n.$i; } } //------------------------------------------------------------- function fieldset($content, $legend='', $id='') { $a_id = ($id ? ' id="'.$id.'"' : ''); return tag(trim(tag($legend, 'legend').n.$content), 'fieldset', $a_id); } ?>