[ Index ] [ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]

PHP Cross Reference of TXP stable 4.0.6

title

Body

[close]

/textpattern/include/ -> txp_tag.php (source)

   1  <?php
   2  
   3  /*
   4      This is Textpattern
   5  
   6      Copyright 2005 by Dean Allen
   7      www.textpattern.com
   8      All rights reserved
   9  
  10      Use of this software indicates acceptance of the Textpattern license agreement
  11  
  12  $HeadURL: http://svn.textpattern.com/releases/4.0.6/source/textpattern/include/txp_tag.php $
  13  $LastChangedRevision: 2774 $
  14  
  15  */
  16  
  17  if (!defined('txpinterface'))
  18  {
  19      die('txpinterface is undefined.');
  20  }
  21  
  22  // -------------------------------------------------------------
  23  
  24  ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  26  <head>
  27      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28      <title>Txp &#8250; <?php echo gTxt('build'); ?></title>
  29      <link rel="stylesheet" type="text/css" href="textpattern.css" />
  30  </head>
  31  <body id="tag-event">
  32  <?php
  33  
  34      $tag_name = gps('tag_name');
  35  
  36      $functname = 'tag_'.$tag_name;
  37  
  38      if (function_exists($functname))
  39      {
  40          $endform = n.tr(
  41              td().
  42              td(
  43                  fInput('submit', '', gTxt('build'), 'smallerbox')
  44              )
  45          ).
  46          n.endTable().
  47          n.eInput('tag').
  48          n.sInput('build').
  49          n.hInput('tag_name', $tag_name);
  50  
  51          echo $functname($tag_name);
  52      }
  53  
  54  ?>
  55  
  56  </body>
  57  </html>
  58  <?php
  59  
  60  /*
  61  
  62  begin generic functions
  63  
  64  */
  65  
  66  // -------------------------------------------------------------
  67  
  68  	function tagRow($label, $thing)
  69      {
  70          return n.n.tr(
  71              n.fLabelCell($label).
  72              n.td($thing)
  73          );
  74      }
  75  
  76  // -------------------------------------------------------------
  77  
  78      function tb($tag, $atts_list = array(), $thing = '')
  79      {
  80          $atts = array();
  81  
  82          foreach ($atts_list as $att => $val)
  83          {
  84              if ($val or $val === '0')
  85              {
  86                  $atts[] = ' '.$att.'="'.$val.'"';
  87              }
  88          }
  89  
  90          $atts = ($atts) ? join('', $atts) : '';
  91  
  92          return !empty($thing) ?
  93              '<txp:'.$tag.$atts.'>'.$thing.'</txp:'.$tag.'>' :
  94              '<txp:'.$tag.$atts.' />';
  95      }
  96  
  97  // -------------------------------------------------------------
  98  
  99  	function tbd($tag, $thing)
 100      {
 101          return '<txp:'.$tag.'>'.$thing.'</txp:'.$tag.'>';
 102      }
 103  
 104  // -------------------------------------------------------------
 105  
 106  	function tdb($thing)
 107      {
 108          return n.graf(text_area('tag', '100', '300', $thing), ' id="tagbuilder-output"');
 109      }
 110  
 111  //--------------------------------------------------------------
 112  
 113  	function key_input($name, $var)
 114      {
 115          return '<textarea name="'.$name.'" style="width: 120px; height: 50px;">'.$var.'</textarea>';
 116      }
 117  
 118  //--------------------------------------------------------------
 119  
 120  	function input_id($id)
 121      {
 122          return fInput('text', 'id', $id, 'edit', '', '', 6);
 123      }
 124  
 125  //--------------------------------------------------------------
 126  
 127  	function time_pop($time)
 128      {
 129          $vals = array(
 130              'past'   => gTxt('time_past'),
 131              'future' => gTxt('time_future'),
 132              'any'    => gTxt('time_any')
 133          );
 134  
 135          return ' '.selectInput('time', $vals, $time, true);
 136      }
 137  
 138  //--------------------------------------------------------------
 139  
 140  	function input_limit($limit)
 141      {
 142          return fInput('text', 'limit', $limit, 'edit', '', '', 2);
 143      }
 144  
 145  //--------------------------------------------------------------
 146  
 147  	function input_offset($offset)
 148      {
 149          return fInput('text', 'offset', $offset, 'edit', '', '', 2);
 150      }
 151  
 152  //--------------------------------------------------------------
 153  
 154  	function input_tag($name, $val)
 155      {
 156          return fInput('text', $name, $val, 'edit', '', '', 6);
 157      }
 158  
 159  //--------------------------------------------------------------
 160  
 161  	function yesno_pop($select_name, $val) {
 162          $vals = array(
 163              1 => gTxt('yes'),
 164              0 => gTxt('no'),
 165          );
 166  
 167          if (is_numeric($val)) {
 168              $val = (int) $val;
 169          }
 170  
 171          return ' '.selectInput($select_name, $vals, $val, true, '', '', true);
 172      }
 173  
 174  //--------------------------------------------------------------
 175  
 176  	function status_pop($val)
 177      {
 178          $vals = array(
 179              4 => gTxt('live'),
 180              5 => gTxt('sticky'),
 181              3 => gTxt('pending'),
 182              1 => gTxt('draft'),
 183              2 => gTxt('hidden'),
 184          );
 185  
 186          return ' '.selectInput('status', $vals, $val, true);
 187      }
 188  
 189  //--------------------------------------------------------------
 190  
 191  	function section_pop($select_name, $val)
 192      {
 193          $vals = array();
 194  
 195          $rs = safe_rows_start('name, title', 'txp_section', "name != 'default' order by name");
 196  
 197          if ($rs and numRows($rs) > 0)
 198          {
 199              while ($a = nextRow($rs))
 200              {
 201                  extract($a);
 202  
 203                  $vals[$name] = $title;
 204              }
 205  
 206              return ' '.selectInput($select_name, $vals, $val, true);
 207          }
 208  
 209          return gTxt('no_sections_available');
 210      }
 211  
 212  //--------------------------------------------------------------
 213  
 214  	function type_pop($val)
 215      {
 216          $vals = array(
 217              'article' => gTxt('article'),
 218              'link'        => gTxt('link'),
 219              'image'        => gTxt('image'),
 220              'file'        => gTxt('file'),
 221          );
 222  
 223          return ' '.selectInput('type', $vals, $val, true);
 224      }
 225  
 226  //--------------------------------------------------------------
 227  
 228  	function feed_flavor_pop($val)
 229      {
 230          $vals = array(
 231              'atom' => 'Atom 1.0',
 232              'rss'     => 'RSS 2.0'
 233          );
 234  
 235          return ' '.selectInput('flavor', $vals, $val, true);
 236      }
 237  
 238  //--------------------------------------------------------------
 239  
 240  	function feed_format_pop($val)
 241      {
 242          $vals = array(
 243              'a'         => '<a href...',
 244              'link' => '<link rel...',
 245          );
 246  
 247          return ' '.selectInput('format', $vals, $val, true);
 248      }
 249  
 250  //--------------------------------------------------------------
 251  
 252  	function article_category_pop($val)
 253      {
 254          $vals = getTree('root','article');
 255  
 256          if ($vals)
 257          {
 258              return ' '.treeSelectInput('category', $vals, $val);
 259          }
 260  
 261          return gTxt('no_categories_available');
 262      }
 263  
 264  //--------------------------------------------------------------
 265  
 266  	function link_category_pop($val)
 267      {
 268          $vals = getTree('root','link');
 269  
 270          if ($vals)
 271          {
 272              return ' '.treeSelectInput('category', $vals, $val);
 273          }
 274  
 275          return gTxt('no_categories_available');
 276      }
 277  
 278  //--------------------------------------------------------------
 279  
 280  	function file_category_pop($val)
 281      {
 282          $vals = getTree('root','file');
 283  
 284          if ($vals)
 285          {
 286              return ' '.treeSelectInput('category', $vals, $val);
 287          }
 288  
 289          return gTxt('no_categories_available');
 290      }
 291  
 292  //--------------------------------------------------------------
 293  
 294  	function match_pop($val)
 295      {
 296          $vals = array(
 297              'Category1,Category2'    => gTxt('category1').' '.gTxt('and').' '.gTxt('category2'),
 298              'Category1'                        => gTxt('category1'),
 299              'Category2'                        => gTxt('category2')
 300          );
 301  
 302          return ' '.selectInput('match', $vals, $val, true);
 303      }
 304  
 305  //--------------------------------------------------------------
 306  
 307  	function author_pop($val)
 308      {
 309          $vals = array();
 310  
 311          $rs = safe_rows_start('name', 'txp_users', '1 = 1 order by name');
 312  
 313          if ($rs)
 314          {
 315              while ($a = nextRow($rs))
 316              {
 317                  extract($a);
 318  
 319                  $vals[$name] = $name;
 320              }
 321  
 322              return ' '.selectInput('author', $vals, $val, true);
 323          }
 324      }
 325  
 326  //--------------------------------------------------------------
 327  
 328  	function sort_pop($val)
 329      {
 330          $asc = ' ('.gTxt('ascending').')';
 331          $desc = ' ('.gTxt('descending').')';
 332  
 333          $vals = array(
 334              'Title asc'             => gTxt('tag_title').$asc,
 335              'Title desc'         => gTxt('tag_title').$desc,
 336              'Posted asc'         => gTxt('tag_posted').$asc,
 337              'Posted desc'         => gTxt('tag_posted').$desc,
 338              'LastMod asc'         => gTxt('last_modification').$asc,
 339              'LastMod desc'     => gTxt('last_modification').$desc,
 340              'Section asc'         => gTxt('section').$asc,
 341              'Section desc'     => gTxt('section').$desc,
 342              'Category1 asc'     => gTxt('category1').$asc,
 343              'Category1 desc' => gTxt('category1').$desc,
 344              'Category2 asc'     => gTxt('category2').$asc,
 345              'Category2 desc' => gTxt('category2').$desc,
 346              'rand()'                 => gTxt('random')
 347          );
 348  
 349          return ' '.selectInput('sort', $vals, $val, true);
 350      }
 351  
 352  //--------------------------------------------------------------
 353  
 354  	function discuss_sort_pop($val)
 355      {
 356          $asc = ' ('.gTxt('ascending').')';
 357          $desc = ' ('.gTxt('descending').')';
 358  
 359          $vals = array(
 360              'posted asc'    => gTxt('posted').$asc,
 361              'posted desc'    => gTxt('posted').$desc,
 362          );
 363  
 364          return ' '.selectInput('sort', $vals, $val, true);
 365      }
 366  
 367  	function list_sort_pop($val)
 368      {
 369          $asc = ' ('.gTxt('ascending').')';
 370          $desc = ' ('.gTxt('descending').')';
 371  
 372          $vals = array(
 373              'title asc'        => gTxt('tag_title').$asc,
 374              'title desc'    => gTxt('tag_title').$desc,
 375              'name asc'        => gTxt('name').$asc,
 376              'name desc'        => gTxt('name').$desc,
 377          );
 378  
 379          return ' '.selectInput('sort', $vals, $val, true);
 380      }
 381  
 382  //--------------------------------------------------------------
 383  
 384  	function pgonly_pop($val)
 385      {
 386          $vals = array(
 387              '1' => gTxt('yes'),
 388              '0' => gTxt('no')
 389          );
 390  
 391          return ' '.selectInput('pgonly', $vals, $val, true);
 392      }
 393  
 394  //--------------------------------------------------------------
 395  
 396  	function form_pop($select_name, $type = '', $val)
 397      {
 398          $vals = array();
 399  
 400          $type = ($type) ? "type = '".doSlash($type)."'" : '1 = 1';
 401  
 402          $rs = safe_rows_start('name', 'txp_form', "$type order by name");
 403  
 404          if ($rs and numRows($rs) > 0)
 405          {
 406              while ($a = nextRow($rs))
 407              {
 408                  extract($a);
 409  
 410                  $vals[$name] = $name;
 411              }
 412  
 413              return ' '.selectInput($select_name, $vals, $val, true);
 414          }
 415  
 416          return gTxt('no_forms_available');
 417      }
 418  
 419  //--------------------------------------------------------------
 420  
 421  	function css_pop($val)
 422      {
 423          $vals = array();
 424  
 425          $rs = safe_rows_start('name', 'txp_css', "1 = 1 order by name");
 426  
 427          if ($rs)
 428          {
 429              while ($a = nextRow($rs))
 430              {
 431                  extract($a);
 432  
 433                  $vals[$name] = $name;
 434              }
 435  
 436              return ' '.selectInput('n', $vals, $val, true);
 437          }
 438  
 439          return false;
 440      }
 441  
 442  //--------------------------------------------------------------
 443  
 444  	function css_format_pop($val)
 445      {
 446          $vals = array(
 447              'link' => '<link rel...',
 448              'url'     => 'css.php?...'
 449          );
 450  
 451          return ' '.selectInput('format', $vals, $val, true);
 452      }
 453  
 454  //--------------------------------------------------------------
 455  
 456  	function escape_pop($val)
 457      {
 458          $vals = array(
 459              'html' => 'html',
 460          );
 461  
 462          return ' '.selectInput('escape', $vals, $val, true);
 463      }
 464  
 465  //--------------------------------------------------------------
 466  
 467  /*
 468  
 469  begin tag builder functions
 470  
 471  */
 472  
 473  // -------------------------------------------------------------
 474  
 475  	function tag_article()
 476      {
 477          global $step, $endform, $tag_name;
 478  
 479          $atts = gpsa(array(
 480              'allowoverride',
 481              'form',
 482              'limit',
 483              'listform',
 484              'offset',
 485              'pageby',
 486              'pgonly',
 487              'searchall',
 488              'searchsticky',
 489              'sort',
 490              'status',
 491              'time'
 492          ));
 493  
 494          extract($atts);
 495  
 496          $out = form(
 497              startTable('tagbuilder').
 498  
 499              tr(
 500                  tdcs(
 501                      hed(gTxt('tag_'.$tag_name), 3)
 502                  , 2)
 503              ).
 504  
 505              tagRow('status',
 506                  status_pop($status)).
 507  
 508              tagRow('time',
 509                  time_pop($time)).
 510  
 511              tagRow('searchall',
 512                  yesno_pop('searchall', $searchall)).
 513  
 514              tagRow('searchsticky',
 515                  yesno_pop('searchsticky', $searchsticky)).
 516  
 517              tagRow('limit',
 518                  input_limit($limit)).
 519  
 520              tagRow('offset',
 521                  input_offset($offset)).
 522  
 523              tagRow('pageby',
 524                  fInput('text', 'pageby', $pageby, 'edit', '', '', 2)).
 525  
 526              tagRow('sort',
 527                  sort_pop($sort)).
 528  
 529              tagRow('pgonly',
 530                  pgonly_pop($pgonly)).
 531  
 532              tagRow('allowoverride',
 533                  yesno_pop('allowoverride', $allowoverride)).
 534  
 535              tagRow('form',
 536                  form_pop('form', 'article', $form)).
 537  
 538              tagRow('listform',
 539                  form_pop('listform', 'article', $listform)).
 540  
 541              $endform
 542          );
 543  
 544          if ($step == 'build')
 545          {
 546              $out .= tdb(tb($tag_name, $atts));
 547          }
 548  
 549          return $out;
 550      }
 551  
 552  // -------------------------------------------------------------
 553  
 554  	function tag_article_custom()
 555      {
 556          global $step, $endform, $tag_name;
 557  
 558          $atts = gpsa(array(
 559              'allowoverride',
 560              'author',
 561              'category',
 562              'excerpted',
 563              'form',
 564              'id',
 565              'keywords',
 566              'limit',
 567              'listform',
 568              'month',
 569              'offset',
 570              'pgonly',
 571              'section',
 572              'sort',
 573              'status',
 574              'time'
 575          ));
 576  
 577          extract($atts);
 578  
 579          $out = form(
 580              startTable('tagbuilder').
 581  
 582              tr(
 583                  tdcs(
 584                      hed(gTxt('tag_'.$tag_name), 3)
 585                  , 2)
 586              ).
 587  
 588              tagRow('id',
 589                  input_id($id)).
 590  
 591              tagRow('status',
 592                  status_pop($status)).
 593  
 594              tagRow('section',
 595                  section_pop('section', $section)).
 596  
 597              tagRow('category',
 598                  article_category_pop($category)).
 599  
 600              tagRow('time',
 601                  time_pop($time)).
 602  
 603              tagRow('month',
 604                  fInput('text', 'month', $month, 'edit', '', '', 7). ' ('.gTxt('yyyy-mm').')') .
 605  
 606              tagRow('keywords',
 607                  key_input('keywords', $keywords)).
 608  
 609              tagRow('has_excerpt',
 610                  yesno_pop('excerpted', $excerpted)).
 611  
 612              tagRow('author',
 613                  author_pop($author)).
 614  
 615              tagRow('sort',
 616                  sort_pop($sort)).
 617  
 618              tagRow('limit',
 619                  input_limit($limit)).
 620  
 621              tagRow('offset',
 622                  input_offset($offset)).
 623  
 624              tagRow('pgonly',
 625                  pgonly_pop($pgonly)).
 626  
 627              tagRow('allowoverride',
 628                  yesno_pop('allowoverride', $allowoverride)).
 629  
 630              tagRow('form',
 631                  form_pop('form', 'article', $form)).
 632              $endform
 633          );
 634  
 635          if ($step == 'build')
 636          {
 637              $out .= tdb(tb($tag_name, $atts));
 638          }
 639  
 640          return $out;
 641      }
 642  
 643  // -------------------------------------------------------------
 644  
 645  	function tag_email()
 646      {
 647          global $step, $endform, $tag_name;
 648  
 649          $atts = gpsa(array(
 650              'email',
 651              'linktext',
 652              'title'
 653          ));
 654  
 655          extract($atts);
 656  
 657          $out = form(
 658              startTable('tagbuilder').
 659  
 660              tr(
 661                  tdcs(
 662                      hed(gTxt('tag_'.$tag_name), 3)
 663                  , 2)
 664              ).
 665  
 666              tagRow('email_address',
 667                  fInput('text', 'email', $email, 'edit', '', '', 20)).
 668  
 669              tagRow('tooltip',
 670                  fInput('text', 'title', $title, 'edit', '', '', 20)).
 671  
 672              tagRow('link_text',
 673                  fInput('text', 'linktext', $linktext, 'edit', '', '', 20)).
 674  
 675              $endform
 676          );
 677  
 678          if ($step == 'build')
 679          {
 680              $out .= tdb(tb($tag_name, $atts));
 681          }
 682  
 683          return $out;
 684      }
 685  
 686  // -------------------------------------------------------------
 687  
 688  	function tag_page_title()
 689      {
 690          global $step, $endform, $tag_name;
 691  
 692          $atts = gpsa(array('separator'));
 693  
 694          extract($atts);
 695  
 696          $out = form(
 697              startTable('tagbuilder').
 698  
 699              tr(
 700                  tdcs(
 701                      hed(gTxt('tag_'.$tag_name), 3)
 702                  , 2)
 703              ).
 704  
 705              tagRow('title_separator',
 706                  fInput('text', 'separator', $separator, 'edit', '', '', 4)).
 707  
 708              $endform
 709          );
 710  
 711          if ($step == 'build')
 712          {
 713              $out .= tdb(tb($tag_name, $atts));
 714          }
 715  
 716          return $out;
 717      }
 718  
 719  // -------------------------------------------------------------
 720  
 721  	function tag_linklist()
 722      {
 723          global $step, $endform, $tag_name;
 724  
 725          $atts = gpsa(array(
 726              'break',
 727              'category',
 728              'form',
 729              'label',
 730              'labeltag',
 731              'limit',
 732              'sort',
 733              'wraptag',
 734          ));
 735  
 736          $asc = ' ('.gTxt('ascending').')';
 737          $desc = ' ('.gTxt('descending').')';
 738  
 739          $sorts = array(
 740              'linksort asc'    => gTxt('name').$asc,
 741              'linksort desc' => gTxt('name').$desc,
 742              'category asc'    => gTxt('category').$asc,
 743              'category desc' => gTxt('category').$desc,
 744              'date asc'            => gTxt('date').$asc,
 745              'date desc'            => gTxt('date').$desc,
 746              'rand()'                => gTxt('random')
 747          );
 748  
 749          extract($atts);
 750  
 751          $out = form(
 752              startTable('tagbuilder').
 753  
 754              tr(
 755                  tdcs(
 756                      hed(gTxt('tag_'.$tag_name), 3)
 757                  , 2)
 758              ).
 759  
 760              tagRow('category',
 761                  link_category_pop($category)).
 762  
 763              tagRow('limit',
 764                  input_limit($limit)).
 765  
 766              tagRow('sort',
 767                  ' '.selectInput('sort', $sorts, $sort)).
 768  
 769              tagRow('label',
 770                  fInput('text', 'label', $label, 'edit', '', '', 20)).
 771  
 772              tagRow('labeltag',
 773                  input_tag('labeltag', $labeltag)).
 774  
 775              tagRow('form',
 776                  form_pop('form', 'link', $form)).
 777  
 778              tagRow('wraptag',
 779                  input_tag('wraptag', $wraptag)).
 780  
 781              tagRow('break',
 782                  input_tag('break', $break)).
 783  
 784              $endform
 785          );
 786  
 787          if ($step == 'build')
 788          {
 789              $out .= tdb(tb($tag_name, $atts));
 790          }
 791  
 792          echo $out;
 793      }
 794  
 795  // -------------------------------------------------------------
 796  
 797  	function tag_section_list()
 798      {
 799          global $step, $endform, $tag_name;
 800  
 801          $atts = gpsa(array(
 802              'active_class',
 803              'break',
 804              'class',
 805              'default_title',
 806              'exclude',
 807              'include_default',
 808              'label',
 809              'labeltag',
 810              'sections',
 811              'sort',
 812              'wraptag'
 813          ));
 814  
 815          extract($atts);
 816  
 817          $out = form(
 818              startTable('tagbuilder').
 819  
 820              tr(
 821                  tdcs(
 822                      hed(gTxt('tag_'.$tag_name), 3)
 823                  , 2)
 824              ).
 825  
 826              tagRow('include_default',
 827                  yesno_pop('include_default', $include_default)).
 828  
 829              tagRow('sort',
 830                  list_sort_pop($sort)).
 831  
 832              tagRow('default_title',
 833                  fInput('text', 'default_title', $default_title, 'edit', '', '', 20)).
 834  
 835              tagRow('sections',
 836                  fInput('text', 'sections', $sections, 'edit', '', '', 20)).
 837  
 838              tagRow('exclude',
 839                  fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
 840  
 841              tagRow('label',
 842                  fInput('text', 'label', $label, 'edit', '', '', 20)).
 843  
 844              tagRow('labeltag',
 845                  input_tag('labeltag', $labeltag)).
 846  
 847              tagRow('wraptag',
 848                  input_tag('wraptag', $wraptag)).
 849  
 850              tagRow('class',
 851                  fInput('text', 'class', $class, 'edit', '', '', 14)).
 852  
 853              tagRow('active_class',
 854                  fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
 855  
 856              tagRow('break',
 857                  input_tag('break', $break)).
 858  
 859              $endform
 860          );
 861  
 862          if ($step == 'build')
 863          {
 864              $out .= tdb(tb($tag_name, $atts));
 865          }
 866  
 867          echo $out;
 868  
 869      }
 870  
 871  // -------------------------------------------------------------
 872  
 873  	function tag_category_list()
 874      {
 875          global $step, $endform, $tag_name;
 876  
 877          $atts = gpsa(array(
 878              'active_class',
 879              'break',
 880              'categories',
 881              'class',
 882              'exclude',
 883              'label',
 884              'labeltag',
 885              'parent',
 886              'section',
 887              'sort',
 888              'this_section',
 889              'type',
 890              'wraptag',
 891          ));
 892  
 893          extract($atts);
 894  
 895          $out = form(
 896              startTable('tagbuilder').
 897  
 898              tr(
 899                  tdcs(
 900                      hed(gTxt('tag_'.$tag_name), 3)
 901                  , 2)
 902              ).
 903  
 904              tagRow('type',
 905                  type_pop($type)).
 906  
 907              tagRow('parent',
 908                  fInput('text', 'parent', $parent, 'edit', '', '', 20)).
 909  
 910              tagRow('categories',
 911                  fInput('text', 'categories', $categories, 'edit', '', '', 20)).
 912  
 913              tagRow('exclude',
 914                  fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
 915  
 916              tagRow('this_section',
 917                  yesno_pop('this_section', $this_section)).
 918  
 919              tagRow('category_list_section',
 920                  section_pop('section', $section)).
 921  
 922              tagRow('sort',
 923                  list_sort_pop($sort)).
 924  
 925              tagRow('label',
 926                  fInput('text', 'label', ($label ? $label : gTxt('categories')), 'edit', '', '', 20)).
 927  
 928              tagRow('labeltag',
 929                  input_tag('labeltag', $labeltag)).
 930  
 931              tagRow('wraptag',
 932                  input_tag('wraptag', $wraptag)).
 933  
 934              tagRow('class',
 935                  fInput('text', 'class', $class, 'edit', '', '', 14)).
 936  
 937              tagRow('active_class',
 938                  fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
 939  
 940              tagRow('break',
 941                  input_tag('break', $break)).
 942  
 943              $endform
 944          );
 945  
 946          if ($step == 'build')
 947          {
 948              $out .= tdb(tb($tag_name, $atts));
 949          }
 950  
 951          echo $out;
 952      }
 953  
 954  // -------------------------------------------------------------
 955  
 956  	function tag_recent_articles()
 957      {
 958          global $step, $endform, $tag_name;
 959  
 960          $atts = gpsa(array(
 961              'break',
 962              'category',
 963              'label',
 964              'labeltag',
 965              'limit',
 966              'section',
 967              'sort',
 968              'wraptag',
 969          ));
 970  
 971          extract($atts);
 972  
 973          $out = form(
 974              startTable('tagbuilder').
 975  
 976              tr(
 977                  tdcs(
 978                      hed(gTxt('tag_'.$tag_name), 3)
 979                  , 2)
 980              ).
 981  
 982              tagRow('section',
 983                  section_pop('section', $section)).
 984  
 985              tagRow('category',
 986                  article_category_pop($category)).
 987  
 988              tagRow('sort',
 989                  sort_pop($sort)).
 990  
 991              tagRow('limit',
 992                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
 993  
 994              tagRow('label',
 995                  fInput('text', 'label', ($label ? $label : gTxt('recent_articles')), 'edit', '', '', 20)).
 996  
 997              tagRow('labeltag',
 998                  input_tag('labeltag', $labeltag)).
 999  
1000              tagRow('wraptag',
1001                  input_tag('wraptag', $wraptag)).
1002  
1003              tagRow('break',
1004                  input_tag('break', $break)).
1005  
1006              $endform
1007          );
1008  
1009          if ($step == 'build')
1010          {
1011              $out .= tdb(tb($tag_name, $atts));
1012          }
1013  
1014          return $out;
1015      }
1016  
1017  // -------------------------------------------------------------
1018  
1019  	function tag_related_articles()
1020      {
1021          global $step, $endform, $tag_name;
1022  
1023          $atts = gpsa(array(
1024              'break',
1025              'class',
1026              'label',
1027              'labeltag',
1028              'limit',
1029              'match',
1030              'section',
1031              'sort',
1032              'wraptag',
1033          ));
1034  
1035          extract($atts);
1036  
1037          $label = (!$label) ? 'Related Articles' : $label;
1038  
1039          $out = form(
1040              startTable('tagbuilder').
1041  
1042              tr(
1043                  tdcs(
1044                      hed(gTxt('tag_'.$tag_name), 3)
1045                  , 2)
1046              ).
1047  
1048              tagRow('section',
1049                  section_pop('section', $section)).
1050  
1051              tagRow('match',
1052                  match_pop($match)).
1053  
1054              tagRow('sort',
1055                  sort_pop($sort)).
1056  
1057              tagRow('limit',
1058                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1059  
1060              tagRow('label',
1061                  fInput('text', 'label', $label, 'edit', '', '', 20)).
1062  
1063              tagRow('labeltag',
1064                  input_tag('labeltag', $labeltag)).
1065  
1066              tagRow('wraptag',
1067                  input_tag('wraptag', $wraptag)).
1068  
1069              tagRow('class',
1070                  fInput('text', 'class', $class, 'edit', '', '', 20)).
1071  
1072              tagRow('break',
1073                  input_tag('break', $break)).
1074  
1075              $endform
1076          );
1077  
1078          if ($step == 'build')
1079          {
1080              $out .= tdb(tb($tag_name, $atts));
1081          }
1082  
1083          return $out;
1084      }
1085  
1086  // -------------------------------------------------------------
1087  
1088  	function tag_recent_comments()
1089      {
1090          global $step, $endform, $tag_name;
1091  
1092          $atts = gpsa(array(
1093              'break',
1094              'class',
1095              'label',
1096              'labeltag',
1097              'limit',
1098              'sort',
1099              'wraptag',
1100          ));
1101  
1102          extract($atts);
1103  
1104          $out = form(
1105              startTable('tagbuilder').
1106  
1107              tr(
1108                  tdcs(
1109                      hed(gTxt('tag_'.$tag_name), 3)
1110                  , 2)
1111              ).
1112  
1113              tagRow('sort',
1114                  discuss_sort_pop($sort)).
1115  
1116              tagRow('limit',
1117                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1118  
1119              tagRow('label',
1120                  fInput('text', 'label', ($label ? $label : gTxt('recent_comments')), 'edit', '', '', 20)).
1121  
1122              tagRow('labeltag',
1123                  input_tag('labeltag', $labeltag)).
1124  
1125              tagRow('wraptag',
1126                  input_tag('wraptag', $wraptag)).
1127  
1128              tagRow('class',
1129                  fInput('text', 'class', $class, 'edit', '', '', 5)).
1130  
1131              tagRow('break',
1132                  input_tag('break', $break)).
1133  
1134          $endform
1135          );
1136  
1137          if ($step == 'build')
1138          {
1139              $out .= tdb(tb($tag_name, $atts));
1140          }
1141  
1142          return $out;
1143      }
1144  
1145  // -------------------------------------------------------------
1146  
1147  	function tag_output_form()
1148      {
1149          global $step, $endform, $tag_name;
1150  
1151          $atts = gpsa(array(
1152              'form'
1153          ));
1154  
1155          extract($atts);
1156  
1157          $out = form(
1158              startTable('tagbuilder').
1159  
1160              tr(
1161                  tdcs(
1162                      hed(gTxt('tag_'.$tag_name), 3)
1163                  , 2)
1164              ).
1165  
1166              tagRow('form',
1167                  form_pop('form', 'misc', $form)).
1168  
1169              $endform
1170          );
1171  
1172          if ($step == 'build')
1173          {
1174              $out .= tdb(tb($tag_name, $atts));
1175          }
1176  
1177          return $out;
1178      }
1179  
1180  // -------------------------------------------------------------
1181  
1182  	function tag_popup()
1183      {
1184          global $step, $endform, $tag_name;
1185  
1186          $atts = gpsa(array(
1187              'label',
1188              'section',
1189              'this_section',
1190              'type',
1191              'wraptag'
1192          ));
1193  
1194          extract($atts);
1195  
1196          $types = array(
1197              'c' => gTxt('Category'),
1198              's' => gTxt('Section')
1199          );
1200  
1201          $out = form(
1202              startTable('tagbuilder').
1203  
1204              tr(
1205                  tdcs(
1206                      hed(gTxt('tag_'.$tag_name), 3)
1207                  , 2)
1208              ).
1209  
1210              tagRow('type',
1211                  ' '.selectInput('type', $types, $type, true)).
1212  
1213              tagRow('section',
1214                  section_pop('section', $section)).
1215  
1216              tagRow('this_section',
1217                  yesno_pop('this_section', $this_section)).
1218  
1219              tagRow('label',
1220                  fInput('text', 'label', ($label ? $label : gTxt('browse')), 'edit', '', '', 25)).
1221  
1222              tagRow('wraptag',
1223                  input_tag('wraptag', $wraptag)).
1224  
1225              $endform
1226          );
1227  
1228          if ($step == 'build')
1229          {
1230              $out .= tdb(tb($tag_name, $atts));
1231          }
1232  
1233          return $out;
1234      }
1235  
1236  // -------------------------------------------------------------
1237  
1238  	function tag_password_protect()
1239      {
1240          global $step, $endform, $tag_name;
1241  
1242          $atts = gpsa(array(
1243              'login',
1244              'pass'
1245          ));
1246  
1247          extract($atts);
1248  
1249          $out = form(
1250              startTable('tagbuilder').
1251  
1252              tr(
1253                  tdcs(
1254                      hed(gTxt('tag_'.$tag_name), 3)
1255                  , 2)
1256              ).
1257  
1258              tagRow('login',
1259                  fInput('text', 'login', $login, 'edit', '', '', 25)).
1260  
1261              tagRow('password',
1262                  fInput('text', 'pass', $pass, 'edit', '', '', 25)).
1263  
1264              $endform
1265          );
1266  
1267          if ($step == 'build')
1268          {
1269              $out .= tdb(tb($tag_name, $atts));
1270          }
1271  
1272          return $out;
1273      }
1274  
1275  // -------------------------------------------------------------
1276  
1277  	function tag_search_input()
1278      {
1279          global $step, $endform, $tag_name;
1280  
1281          $atts = gpsa(array(
1282              'button',
1283              'form',
1284              'label',
1285              'section',
1286              'size',
1287              'wraptag'
1288          ));
1289  
1290          extract($atts);
1291  
1292          $out = form(
1293              startTable('tagbuilder').
1294  
1295              tr(
1296                  tdcs(
1297                      hed(gTxt('tag_'.$tag_name), 3)
1298                  , 2)
1299              ).
1300  
1301              tagRow('section',
1302                  section_pop('section', $section)).
1303  
1304              tagRow('button_text',
1305                  fInput('text', 'button', $button, 'edit', '', '', 25)).
1306  
1307              tagRow('input_size',
1308                  fInput('text', 'size', $size, 'edit', '', '', 2)).
1309  
1310              tagRow('label',
1311                  fInput('text', 'label', ($label ? $label : gTxt('search')), 'edit', '', '', 25)).
1312  
1313              tagRow('wraptag',
1314                  input_tag('wraptag', $wraptag)).
1315  
1316              tagRow('form',
1317                  form_pop('form', 'misc', $form)).
1318  
1319              $endform
1320          );
1321  
1322          if ($step == 'build')
1323          {
1324              $out .= tdb(tb($tag_name, $atts));
1325          }
1326  
1327          return $out;
1328      }
1329  
1330  // -------------------------------------------------------------
1331  
1332  	function tag_category1()
1333      {
1334          global $step, $endform, $tag_name;
1335  
1336          $atts = gpsa(array(
1337              'class',
1338              'link',
1339              'title',
1340              'section',
1341              'this_section',
1342              'wraptag'
1343          ));
1344  
1345          extract($atts);
1346  
1347          $out = form(
1348              startTable('tagbuilder').
1349              tr(
1350                  tdcs(
1351                      hed(gTxt('tag_'.$tag_name), 3)
1352                  , 2)
1353              ).
1354  
1355              tagRow('title',
1356                  yesno_pop('title', $title)).
1357  
1358              tagRow('link_to_this_category',
1359                  yesno_pop('link', $link)).
1360  
1361              tagRow('section',
1362                  section_pop('section', $section)).
1363  
1364              tagRow('this_section',
1365                  yesno_pop('this_section', $this_section)).
1366  
1367              tagRow('wraptag',
1368                  input_tag('wraptag', $wraptag)).
1369  
1370              tagRow('class',
1371                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1372  
1373              $endform
1374          );
1375  
1376          if ($step == 'build')
1377          {
1378              $out .= tdb(tb($tag_name, $atts));
1379          }
1380  
1381          return $out;
1382      }
1383  
1384  // -------------------------------------------------------------
1385  
1386  	function tag_category2()
1387      {
1388          global $step, $endform, $tag_name;
1389  
1390          $atts = gpsa(array(
1391              'class',
1392              'link',
1393              'title',
1394              'section',
1395              'this_section',
1396              'wraptag'
1397          ));
1398  
1399          extract($atts);
1400  
1401          $out = form(
1402              startTable('tagbuilder').
1403              tr(
1404                  tdcs(
1405                      hed(gTxt('tag_'.$tag_name), 3)
1406                  , 2)
1407              ).
1408  
1409              tagRow('title',
1410                  yesno_pop('title', $title)).
1411  
1412              tagRow('link_to_this_category',
1413                  yesno_pop('link', $link)).
1414  
1415              tagRow('section',
1416                  section_pop('section', $section)).
1417  
1418              tagRow('this_section',
1419                  yesno_pop('this_section', $this_section)).
1420  
1421              tagRow('wraptag',
1422                  input_tag('wraptag', $wraptag)).
1423  
1424              tagRow('class',
1425                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1426  
1427              $endform
1428          );
1429  
1430          if ($step == 'build')
1431          {
1432              $out .= tdb(tb($tag_name, $atts));
1433          }
1434  
1435          return $out;
1436      }
1437  
1438  
1439  // -------------------------------------------------------------
1440  
1441  	function tag_section()
1442      {
1443          global $step, $endform, $tag_name;
1444  
1445          $atts = gpsa(array(
1446              'class',
1447              'link',
1448              'name',
1449              'title',
1450              'wraptag'
1451          ));
1452  
1453          extract($atts);
1454  
1455          $out = form(
1456              startTable('tagbuilder').
1457  
1458              tr(
1459                  tdcs(
1460                      hed(gTxt('tag_'.$tag_name), 3)
1461                  , 2)
1462              ).
1463  
1464              tagRow('name',
1465                  section_pop('name', $tag_name)).
1466  
1467              tagRow('link_to_this_section',
1468                  yesno_pop('link', $link)).
1469  
1470              tagRow('wraptag',
1471                  input_tag('wraptag', $wraptag)).
1472  
1473              tagRow('class',
1474                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1475  
1476              $endform
1477          );
1478  
1479          if ($step == 'build')
1480          {
1481              $out .= tdb(tb($tag_name, $atts));
1482          }
1483  
1484          return $out;
1485      }
1486  
1487  // -------------------------------------------------------------
1488  
1489  	function tag_author()
1490      {
1491          global $step, $endform, $tag_name;
1492  
1493          $atts = gpsa(array(
1494              'link',
1495              'section',
1496              'this_section'
1497          ));
1498  
1499          extract($atts);
1500  
1501          $out = form(
1502              startTable('tagbuilder').
1503  
1504              tr(
1505                  tdcs(
1506                      hed(gTxt('tag_'.$tag_name), 3)
1507                  , 2)
1508              ).
1509  
1510              tagRow('link_to_this_author',
1511                  yesno_pop('link', $link)).
1512  
1513              tagRow('section',
1514                  section_pop('section', $section)).
1515  
1516              tagRow('this_section',
1517                  yesno_pop('this_section', $this_section)).
1518  
1519              $endform
1520          );
1521  
1522          if ($step == 'build')
1523          {
1524              $out .= tdb(tb($tag_name, $atts));
1525          }
1526  
1527          return $out;
1528      }
1529  
1530  // -------------------------------------------------------------
1531  
1532  	function tag_link_to_home()
1533      {
1534          global $step, $endform, $tag_name;
1535  
1536          $atts = gpsa(array(
1537              'class',
1538          ));
1539  
1540          extract($atts);
1541  
1542          $thing = gps('thing');
1543  
1544          $out = form(
1545              startTable('tagbuilder').
1546  
1547              tr(
1548                  tdcs(
1549                      hed(gTxt('tag_'.$tag_name), 3)
1550                  , 2)
1551              ).
1552  
1553              tagRow('link_text',
1554                  fInput('text', 'thing', ($thing ? $thing : gTxt('tag_home')), 'edit', '', '', 25)).
1555  
1556              tagRow('class',
1557                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1558  
1559              $endform
1560          );
1561  
1562          if ($step == 'build')
1563          {
1564              $out .= tdb(tb($tag_name, $atts));
1565          }
1566  
1567          return $out;
1568      }
1569  
1570  // -------------------------------------------------------------
1571  
1572  	function tag_link_to_prev()
1573      {
1574          global $step, $endform, $tag_name;
1575  
1576          $atts = gpsa(array(
1577              'showalways',
1578          ));
1579  
1580          extract($atts);
1581  
1582          $thing = gps('thing');
1583  
1584          $out = form(
1585              startTable('tagbuilder').
1586  
1587              tr(
1588                  tdcs(
1589                      hed(gTxt('tag_'.$tag_name), 3)
1590                  , 2)
1591              ).
1592  
1593              tagRow('link_text',
1594                  fInput('text', 'thing', ($thing ? $thing : '<txp:prev_title />'), 'edit', '', '', 25)).
1595  
1596              tagRow('showalways',
1597                  yesno_pop('showalways', $showalways)).
1598  
1599              $endform
1600          );
1601  
1602          if ($step == 'build')
1603          {
1604              $out .= tdb(tb($tag_name, $atts, $thing));
1605          }
1606  
1607          return $out;
1608      }
1609  
1610  // -------------------------------------------------------------
1611  
1612  	function tag_link_to_next()
1613      {
1614          global $step, $endform, $tag_name;
1615  
1616          $atts = gpsa(array(
1617              'showalways',
1618          ));
1619  
1620          extract($atts);
1621  
1622          $thing = gps('thing');
1623  
1624          $out = form(
1625              startTable('tagbuilder').
1626  
1627              tr(
1628                  tdcs(
1629                      hed(gTxt('tag_'.$tag_name), 3)
1630                  , 2)
1631              ).
1632  
1633              tagRow('link_text',
1634                  fInput('text', 'thing', ($thing ? $thing : '<txp:next_title />'), 'edit', '', '', 25)).
1635  
1636              tagRow('showalways',
1637                  yesno_pop('showalways', $showalways)).
1638  
1639              $endform
1640          );
1641  
1642          if ($step == 'build')
1643          {
1644              $out .= tdb(tb($tag_name, $atts, $thing));
1645          }
1646  
1647          return $out;
1648      }
1649  
1650  // -------------------------------------------------------------
1651  
1652  	function tag_feed_link()
1653      {
1654          global $step, $endform, $tag_name;
1655  
1656          $atts = gpsa(array(
1657              'category',
1658              'flavor',
1659              'format',
1660              'label',
1661              'limit',
1662              'section',
1663              'title',
1664              'wraptag',
1665          ));
1666  
1667          extract($atts);
1668  
1669          $label = $label ? $label : 'XML';
1670  
1671          $out = form(
1672              startTable('tagbuilder').
1673  
1674              tr(
1675                  tdcs(
1676                      hed(gTxt('tag_'.$tag_name), 3)
1677                  , 2)
1678              ).
1679  
1680              tagRow('flavor',
1681                  feed_flavor_pop($flavor)).
1682  
1683              tagRow('format',
1684                  feed_format_pop($format)).
1685  
1686              tagRow('section',
1687                  section_pop('section', $section)).
1688  
1689              tagRow('category',
1690                  article_category_pop($section)).
1691  
1692              tagRow('limit',
1693                  input_limit($limit)).
1694  
1695              tagRow('label',
1696                  fInput('text', 'label', $label, 'edit', '', '', 25)).
1697  
1698              tagRow('title',
1699                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1700  
1701              tagRow('wraptag',
1702                  input_tag('wraptag', $wraptag)).
1703  
1704              $endform
1705          );
1706  
1707          if ($step == 'build')
1708          {
1709              $out .= tdb(tb($tag_name, $atts));
1710          }
1711  
1712          return $out;
1713      }
1714  
1715  // -------------------------------------------------------------
1716  
1717  	function tag_link_feed_link()
1718      {
1719          global $step, $endform, $tag_name;
1720  
1721          $atts = gpsa(array(
1722              'category',
1723              'flavor',
1724              'format',
1725              'label',
1726              'limit',
1727              'title',
1728              'wraptag'
1729          ));
1730  
1731          extract($atts);
1732  
1733          $label = (!$label) ? 'XML' : $label;
1734  
1735          $out = form(
1736              startTable('tagbuilder').
1737  
1738              tr(
1739                  tdcs(
1740                      hed(gTxt('tag_'.$tag_name), 3)
1741                  , 2)
1742              ).
1743  
1744              tagRow('flavor',
1745                  feed_flavor_pop($flavor)).
1746  
1747              tagRow('format',
1748                  feed_format_pop($format)).
1749  
1750              tagRow('category',
1751                  link_category_pop($category)).
1752  
1753              tagRow('limit',
1754                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1755  
1756              tagRow('label',
1757                  fInput('text', 'label', $label, 'edit', '', '', 25)).
1758  
1759              tagRow('title',
1760                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1761  
1762              tagRow('wraptag',
1763                  input_tag('wraptag', $wraptag)).
1764  
1765              $endform
1766          );
1767  
1768          if ($step == 'build')
1769          {
1770              $out .= tdb(tb($tag_name, $atts));
1771          }
1772  
1773          return $out;
1774      }
1775  
1776  // -------------------------------------------------------------
1777  
1778  	function tag_permlink()
1779      {
1780          global $step, $endform, $tag_name;
1781  
1782          $atts = gpsa(array(
1783              'class',
1784              'id',
1785              'style',
1786              'title'
1787          ));
1788  
1789          extract($atts);
1790  
1791          $thing = gps('thing');
1792  
1793          $out = form(
1794              startTable('tagbuilder').
1795  
1796              tr(
1797                  tdcs(
1798                      hed(gTxt('tag_'.$tag_name), 3)
1799                  , 2)
1800              ).
1801  
1802              tagRow('id',
1803                  input_id($id)).
1804  
1805              tagRow('link_text',
1806                  fInput('text', 'thing', ($thing ? $thing : '<txp:title />'), 'edit', '', '', 25)).
1807  
1808              tagRow('title',
1809                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1810  
1811              tagRow('class',
1812                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1813  
1814              tagRow('inline_style',
1815                  fInput('text', 'style', $style, 'edit', '', '', 25)).
1816  
1817              $endform
1818          );
1819  
1820          if ($step == 'build')
1821          {
1822              $out .= tdb(tb($tag_name, $atts, $thing));
1823          }
1824  
1825          return $out;
1826      }
1827  
1828  // -------------------------------------------------------------
1829  
1830  	function tag_newer()
1831      {
1832          global $step, $endform, $tag_name;
1833  
1834          $thing = gps('thing');
1835  
1836          $out = form(
1837              startTable('tagbuilder').
1838  
1839              tr(
1840                  tdcs(
1841                      hed(gTxt('tag_'.$tag_name), 3)
1842                  , 2)
1843              ).
1844  
1845              tagRow('link_text',
1846                  fInput('text', 'thing', ($thing ? $thing : '<txp:text item="newer" />'), 'edit', '', '', 25)).
1847  
1848              $endform
1849          );
1850  
1851          if ($step == 'build')
1852          {
1853              $out .= tdb(tb($tag_name, array(), $thing));
1854          }
1855  
1856          return $out;
1857      }
1858  
1859  // -------------------------------------------------------------
1860  
1861  	function tag_older()
1862      {
1863          global $step, $endform, $tag_name;
1864  
1865          $thing = gps('thing');
1866  
1867          $out = form(
1868              startTable('tagbuilder').
1869  
1870              tr(
1871                  tdcs(
1872                      hed(gTxt('tag_'.$tag_name), 3)
1873                  , 2)
1874              ).
1875  
1876              tagRow('link_text',
1877                  fInput('text', 'thing', ($thing ? $thing : '<txp:text item="older" />'), 'edit', '', '', 25)).
1878  
1879              $endform
1880          );
1881  
1882          if ($step == 'build')
1883          {
1884              $out .= tdb(tb($tag_name, array(), $thing));
1885          }
1886  
1887          return $out;
1888      }
1889  
1890  // -------------------------------------------------------------
1891  
1892  	function tag_next_title()
1893      {
1894          global $step, $endform, $tag_name;
1895  
1896          return form(
1897              startTable('tagbuilder').
1898  
1899              tr(
1900                  tdcs(
1901                      hed(gTxt('tag_'.$tag_name), 3)
1902                  , 2)
1903              ).
1904  
1905              n.endTable()
1906          ).
1907  
1908          tdb(tb($tag_name));
1909      }
1910  
1911  // -------------------------------------------------------------
1912  
1913  	function tag_site_name()
1914      {
1915          global $step, $endform, $tag_name;
1916  
1917          return form(
1918              startTable('tagbuilder').
1919  
1920              tr(
1921                  tdcs(
1922                      hed(gTxt('tag_'.$tag_name), 3)
1923                  , 2)
1924              ).
1925  
1926              n.endTable()
1927          ).
1928  
1929          tdb(tb($tag_name));
1930      }
1931  
1932  // -------------------------------------------------------------
1933  
1934  	function tag_site_slogan()
1935      {
1936          global $step, $endform, $tag_name;
1937  
1938          return form(
1939              startTable('tagbuilder').
1940  
1941              tr(
1942                  tdcs(
1943                      hed(gTxt('tag_'.$tag_name), 3)
1944                  , 2)
1945              ).
1946  
1947              n.endTable()
1948          ).
1949  
1950          tdb(tb($tag_name));
1951      }
1952  
1953  // -------------------------------------------------------------
1954  
1955  	function tag_prev_title()
1956      {
1957          global $step, $endform, $tag_name;
1958  
1959          return form(
1960              startTable('tagbuilder').
1961  
1962              tr(
1963                  tdcs(
1964                      hed(gTxt('tag_'.$tag_name), 3)
1965                  , 2)
1966              ).
1967  
1968              n.endTable()
1969          ).
1970  
1971          tdb(tb($tag_name));
1972      }
1973  
1974  // -------------------------------------------------------------
1975  
1976  	function tag_article_image()
1977      {
1978          global $step, $endform, $tag_name;
1979  
1980          $atts = gpsa(array(
1981              'align',
1982              'class',
1983              'escape',
1984              'html_id',
1985              'style',
1986              'thumbnail',
1987              'wraptag',
1988          ));
1989  
1990          extract($atts);
1991  
1992          $out = form(
1993              startTable('tagbuilder').
1994  
1995              tr(
1996                  tdcs(
1997                      hed(gTxt('tag_'.$tag_name), 3)
1998                  , 2)
1999              ).
2000  
2001              tagRow('use_thumbnail',
2002                  yesno_pop('thumbnail', $thumbnail)).
2003  
2004              tagRow('escape',
2005                  escape_pop($escape)).
2006  
2007              tagRow('html_id',
2008                  fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
2009  
2010              tagRow('class',
2011                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2012  
2013              tagRow('inline_style',
2014                  fInput('text', 'style', $style, 'edit', '', '', 25)).
2015  
2016              tagRow('align',
2017                  fInput('text', 'align', $align, 'edit', '', '', 25)).
2018  
2019              tagRow('wraptag',
2020                  fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
2021  
2022              $endform
2023          );
2024  
2025          if ($step == 'build')
2026          {
2027              $out .= tdb(tb($tag_name, $atts));
2028          }
2029  
2030          return $out;
2031      }
2032  
2033  // -------------------------------------------------------------
2034  
2035  	function tag_css()
2036      {
2037          global $step, $endform, $tag_name;
2038  
2039          $atts = gpsa(array(
2040              'format',
2041              'media',
2042              'n',
2043              'rel',
2044              'title'
2045          ));
2046  
2047          extract($atts);
2048  
2049          $out = form(
2050              startTable('tagbuilder').
2051  
2052              tr(
2053                  tdcs(
2054                      hed(gTxt('tag_'.$tag_name), 3)
2055                  , 2)
2056              ).
2057  
2058              tagRow('n',
2059                  css_pop($n)).
2060  
2061              tagRow('format',
2062                  css_format_pop($format)).
2063  
2064              tagRow('media',
2065                  fInput('text', 'media', $media, 'edit', '', '', 25)).
2066  
2067              tagRow('rel',
2068                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2069  
2070              tagRow('title',
2071                  fInput('text', 'title', $title, 'edit', '', '', 25)).
2072  
2073              $endform
2074          );
2075  
2076          if ($step == 'build')
2077          {
2078              $out .= tdb(tb($tag_name, $atts));
2079          }
2080  
2081          return $out;
2082      }
2083  
2084  // -------------------------------------------------------------
2085  
2086  	function tag_body()
2087      {
2088          global $step, $endform, $tag_name;
2089  
2090          return form(
2091              startTable('tagbuilder').
2092  
2093              tr(
2094                  tdcs(
2095                      hed(gTxt('tag_'.$tag_name), 3)
2096                  , 2)
2097              ).
2098  
2099              n.endTable()
2100          ).
2101  
2102          tdb(tb($tag_name));
2103      }
2104  
2105  // -------------------------------------------------------------
2106  
2107  	function tag_excerpt()
2108      {
2109          global $step, $endform, $tag_name;
2110  
2111          return form(
2112              startTable('tagbuilder').
2113  
2114              tr(
2115                  tdcs(
2116                      hed(gTxt('tag_'.$tag_name), 3)
2117                  , 2)
2118              ).
2119  
2120              n.endTable()
2121          ).
2122  
2123          tdb(tb($tag_name));
2124      }
2125  
2126  // -------------------------------------------------------------
2127  
2128  	function tag_title()
2129      {
2130          global $step, $endform, $tag_name;
2131  
2132          return form(
2133              startTable('tagbuilder').
2134  
2135              tr(
2136                  tdcs(
2137                      hed(gTxt('tag_'.$tag_name), 3)
2138                  , 2)
2139              ).
2140  
2141              n.endTable()
2142          ).
2143  
2144          tdb(tb($tag_name));
2145      }
2146  
2147  // -------------------------------------------------------------
2148  
2149  	function tag_link()
2150      {
2151          global $step, $endform, $tag_name;
2152  
2153          $atts = gpsa(array(
2154              'rel'
2155          ));
2156  
2157          extract($atts);
2158  
2159          $out = form(
2160              startTable('tagbuilder').
2161  
2162              tr(
2163                  tdcs(
2164                      hed(gTxt('tag_'.$tag_name), 3)
2165                  , 2)
2166              ).
2167  
2168              tagRow('rel',
2169                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2170  
2171              $endform
2172          );
2173  
2174          if ($step == 'build')
2175          {
2176              $out .= tdb(tb($tag_name, $atts));
2177          }
2178  
2179          return $out;
2180      }
2181  
2182  // -------------------------------------------------------------
2183  
2184  	function tag_linkdesctitle()
2185      {
2186          global $step, $endform, $tag_name;
2187  
2188          $atts = gpsa(array(
2189              'rel'
2190          ));
2191  
2192          extract($atts);
2193  
2194          $out = form(
2195              startTable('tagbuilder').
2196  
2197              tr(
2198                  tdcs(
2199                      hed(gTxt('tag_'.$tag_name), 3)
2200                  , 2)
2201              ).
2202  
2203              tagRow('rel',
2204                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2205  
2206              $endform
2207          );
2208  
2209          if ($step == 'build')
2210          {
2211              $out .= tdb(tb($tag_name, $atts));
2212          }
2213  
2214          return $out;
2215      }
2216  
2217  // -------------------------------------------------------------
2218  
2219  	function tag_link_description()
2220      {
2221          global $step, $endform, $tag_name;
2222  
2223          $atts = gpsa(array(
2224              'class',
2225              'escape',
2226              'label',
2227              'labeltag',
2228              'wraptag'
2229          ));
2230  
2231          extract($atts);
2232  
2233          $out = form(
2234              startTable('tagbuilder').
2235  
2236              tr(
2237                  tdcs(
2238                      hed(gTxt('tag_'.$tag_name), 3)
2239                  , 2)
2240              ).
2241  
2242              tagRow('escape',
2243                  escape_pop($escape)).
2244  
2245              tagRow('label',
2246                  fInput('text', 'label', $label, 'edit', '', '', 25)).
2247  
2248              tagRow('labeltag',
2249                  input_tag('labeltag', $labeltag)).
2250  
2251              tagRow('wraptag',
2252                  input_tag('wraptag', $wraptag)).
2253  
2254              tagRow('class',
2255                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2256  
2257              $endform
2258          );
2259  
2260          if ($step == 'build')
2261          {
2262              $out .= tdb(tb($tag_name, $atts));
2263          }
2264  
2265          return $out;
2266      }
2267  
2268  // -------------------------------------------------------------
2269  
2270  	function tag_link_name()
2271      {
2272          global $step, $endform, $tag_name;
2273  
2274          $atts = gpsa(array(
2275              'escape',
2276          ));
2277  
2278          extract($atts);
2279  
2280          $out = form(
2281              startTable('tagbuilder').
2282  
2283              tr(
2284                  tdcs(
2285                      hed(gTxt('tag_'.$tag_name), 3)
2286                  , 2)
2287              ).
2288  
2289              tagRow('escape',
2290                  escape_pop($escape)).
2291  
2292              $endform
2293          );
2294  
2295          if ($step == 'build')
2296          {
2297              $out .= tdb(tb($tag_name, $atts));
2298          }
2299  
2300          return $out;
2301      }
2302  
2303  // -------------------------------------------------------------
2304  
2305  	function tag_link_category()
2306      {
2307          global $step, $endform, $tag_name;
2308  
2309          $atts = gpsa(array(
2310              'class',
2311              'label',
2312              'labeltag',
2313              'title',
2314              'wraptag'
2315          ));
2316  
2317          extract($atts);
2318  
2319          $out = form(
2320              startTable('tagbuilder').
2321  
2322              tr(
2323                  tdcs(
2324                      hed(gTxt('tag_'.$tag_name), 3)
2325                  , 2)
2326              ).
2327  
2328              tagRow('title',
2329                  yesno_pop('title', $title)).
2330  
2331              tagRow('label',
2332                  fInput('text', 'label', $label, 'edit', '', '', 25)).
2333  
2334              tagRow('labeltag',
2335                  input_tag('labeltag', $labeltag)).
2336  
2337              tagRow('wraptag',
2338                  input_tag('wraptag', $wraptag)).
2339  
2340              tagRow('class',
2341                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2342  
2343              $endform
2344          );
2345  
2346          if ($step == 'build')
2347          {
2348              $out .= tdb(tb($tag_name, $atts));
2349          }
2350  
2351          return $out;
2352      }
2353  
2354  // -------------------------------------------------------------
2355  
2356  	function tag_link_date()
2357      {
2358          global $step, $endform, $tag_name;
2359  
2360          $atts = gpsa(array(
2361              'format',
2362              'gmt',
2363              'lang'
2364          ));
2365  
2366          extract($atts);
2367  
2368          $out = form(
2369              startTable('tagbuilder').
2370  
2371              tr(
2372                  tdcs(
2373                      hed(gTxt('tag_'.$tag_name), 3)
2374                  , 2)
2375              ).
2376  
2377              tagRow('time_format',
2378                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2379  
2380              tagRow('gmt',
2381                  yesno_pop('gmt', $gmt)).
2382  
2383              tagRow('locale',
2384                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2385  
2386              $endform
2387          );
2388  
2389          if ($step == 'build')
2390          {
2391              $out .= tdb(tb($tag_name, $atts));
2392          }
2393  
2394          return $out;
2395      }
2396  
2397  // -------------------------------------------------------------
2398  
2399  	function tag_posted()
2400      {
2401          global $step, $endform, $tag_name;
2402  
2403          $atts = gpsa(array(
2404              'format',
2405              'gmt',
2406              'lang'
2407          ));
2408  
2409          extract($atts);
2410  
2411          $out = form(
2412              startTable('tagbuilder').
2413  
2414              tr(
2415                  tdcs(
2416                      hed(gTxt('tag_'.$tag_name), 3)
2417                  , 2)
2418              ).
2419  
2420              tagRow('time_format',
2421                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2422  
2423              tagRow('gmt',
2424                  yesno_pop('gmt', $gmt)).
2425  
2426              tagRow('locale',
2427                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2428  
2429              $endform
2430          );
2431  
2432          if ($step == 'build')
2433          {
2434              $out .= tdb(tb($tag_name, $atts));
2435          }
2436  
2437          return $out;
2438      }
2439  
2440  // -------------------------------------------------------------
2441  
2442  	function tag_comments_invite()
2443      {
2444          global $step, $endform, $tag_name;
2445  
2446          $atts = gpsa(array(
2447              'class',
2448              'showcount',
2449              'textonly',
2450              'wraptag'
2451          ));
2452  
2453          extract($atts);
2454  
2455          $out = form(
2456              startTable('tagbuilder').
2457  
2458              tr(
2459                  tdcs(
2460                      hed(gTxt('tag_'.$tag_name), 3)
2461                  , 2)
2462              ).
2463  
2464              tagRow('textonly',
2465                  yesno_pop('textonly', $textonly)).
2466  
2467              tagRow('showcount',
2468                  yesno_pop('showcount', $showcount)).
2469  
2470              tagRow('wraptag',
2471                  input_tag('wraptag', $wraptag)).
2472  
2473              tagRow('class',
2474                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2475  
2476              $endform
2477          );
2478  
2479          if ($step == 'build')
2480          {
2481              $out .= tdb(tb($tag_name, $atts));
2482          }
2483  
2484          return $out;
2485      }
2486  
2487  // -------------------------------------------------------------
2488  
2489  	function tag_comment_permlink()
2490      {
2491          global $step, $endform, $tag_name;
2492  
2493          return form(
2494              startTable('tagbuilder').
2495  
2496              tr(
2497                  tdcs(
2498                      hed(gTxt('tag_'.$tag_name), 3)
2499                  , 2)
2500              ).
2501  
2502              n.endTable()
2503          ).
2504  
2505          tdb(tb($tag_name));
2506      }
2507  
2508  // -------------------------------------------------------------
2509  
2510  	function tag_comment_time()
2511      {
2512          global $step, $endform, $tag_name;
2513  
2514          $atts = gpsa(array(
2515              'format',
2516              'gmt',
2517              'lang'
2518          ));
2519  
2520          extract($atts);
2521  
2522          $out = form(
2523              startTable('tagbuilder').
2524  
2525              tr(
2526                  tdcs(
2527                      hed(gTxt('tag_'.$tag_name), 3)
2528                  , 2)
2529              ).
2530  
2531              tagRow('time_format',
2532                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2533  
2534              tagRow('gmt',
2535                  yesno_pop('gmt', $gmt)).
2536  
2537              tagRow('locale',
2538                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2539  
2540              $endform
2541          );
2542  
2543          if ($step == 'build')
2544          {
2545              $out .= tdb(tb($tag_name, $atts));
2546          }
2547  
2548          return $out;
2549      }
2550  
2551  // -------------------------------------------------------------
2552  
2553  	function tag_comment_name()
2554      {
2555          global $step, $endform, $tag_name;
2556  
2557          $atts = gpsa(array(
2558              'link'
2559          ));
2560  
2561          extract($atts);
2562  
2563          $out = form(
2564              startTable('tagbuilder').
2565  
2566              tr(
2567                  tdcs(
2568                      hed(gTxt('tag_'.$tag_name), 3)
2569                  , 2)
2570              ).
2571  
2572              tagRow('comment_name_link',
2573                  yesno_pop('link', $link)).
2574  
2575              $endform
2576          );
2577  
2578          if ($step == 'build')
2579          {
2580              $out .= tdb(tb($tag_name, $atts));
2581          }
2582  
2583          return $out;
2584      }
2585  
2586  // -------------------------------------------------------------
2587  
2588  	function tag_comment_email()
2589      {
2590          global $step, $endform, $tag_name;
2591  
2592          return form(
2593              startTable('tagbuilder').
2594  
2595              tr(
2596                  tdcs(
2597                      hed(gTxt('tag_'.$tag_name), 3)
2598                  , 2)
2599              ).
2600  
2601              n.endTable()
2602          ).
2603  
2604          tdb(tb($tag_name));
2605      }
2606  
2607  // -------------------------------------------------------------
2608  
2609  	function tag_comment_web()
2610      {
2611          global $step, $endform, $tag_name;
2612  
2613          return form(
2614              startTable('tagbuilder').
2615  
2616              tr(
2617                  tdcs(
2618                      hed(gTxt('tag_'.$tag_name), 3)
2619                  , 2)
2620              ).
2621  
2622              n.endTable()
2623          ).
2624  
2625          tdb(tb($tag_name));
2626      }
2627  
2628  // -------------------------------------------------------------
2629  
2630  	function tag_comment_message()
2631      {
2632          global $step, $endform, $tag_name;
2633  
2634          return form(
2635              startTable('tagbuilder').
2636  
2637              tr(
2638                  tdcs(
2639                      hed(gTxt('tag_'.$tag_name), 3)
2640                  , 2)
2641              ).
2642  
2643              n.endTable()
2644          ).
2645  
2646          tdb(tb($tag_name));
2647      }
2648  
2649  // -------------------------------------------------------------
2650  
2651  	function tag_comment_email_input()
2652      {
2653          global $step, $endform, $tag_name;
2654  
2655          return form(
2656              startTable('tagbuilder').
2657  
2658              tr(
2659                  tdcs(
2660                      hed(gTxt('tag_'.$tag_name), 3)
2661                  , 2)
2662              ).
2663  
2664              n.endTable()
2665          ).
2666  
2667          tdb(tb($tag_name));
2668      }
2669  
2670  // -------------------------------------------------------------
2671  
2672  	function tag_comment_message_input()
2673      {
2674          global $step, $endform, $tag_name;
2675  
2676          return form(
2677              startTable('tagbuilder').
2678  
2679              tr(
2680                  tdcs(
2681                      hed(gTxt('tag_'.$tag_name), 3)
2682                  , 2)
2683              ).
2684  
2685              n.endTable()
2686          ).
2687  
2688          tdb(tb($tag_name));
2689      }
2690  
2691  // -------------------------------------------------------------
2692  
2693  	function tag_comment_name_input()
2694      {
2695          global $step, $endform, $tag_name;
2696  
2697          return form(
2698              startTable('tagbuilder').
2699  
2700              tr(
2701                  tdcs(
2702                      hed(gTxt('tag_'.$tag_name), 3)
2703                  , 2)
2704              ).
2705  
2706              n.endTable()
2707          ).
2708  
2709          tdb(tb($tag_name));
2710      }
2711  
2712  // -------------------------------------------------------------
2713  
2714  	function tag_comment_preview()
2715      {
2716          global $step, $endform, $tag_name;
2717  
2718          return form(
2719              startTable('tagbuilder').
2720  
2721              tr(
2722                  tdcs(
2723                      hed(gTxt('tag_'.$tag_name), 3)
2724                  , 2)
2725              ).
2726  
2727              n.endTable()
2728          ).
2729  
2730          tdb(tb($tag_name));
2731      }
2732  
2733  // -------------------------------------------------------------
2734  
2735  	function tag_comment_remember()
2736      {
2737          global $step, $endform, $tag_name;
2738  
2739          return form(
2740              startTable('tagbuilder').
2741  
2742              tr(
2743                  tdcs(
2744                      hed(gTxt('tag_'.$tag_name), 3)
2745                  , 2)
2746              ).
2747  
2748              n.endTable()
2749          ).
2750  
2751          tdb(tb($tag_name));
2752      }
2753  
2754  // -------------------------------------------------------------
2755  
2756  	function tag_comment_submit()
2757      {
2758          global $step, $endform, $tag_name;
2759  
2760          return form(
2761              startTable('tagbuilder').
2762  
2763              tr(
2764                  tdcs(
2765                      hed(gTxt('tag_'.$tag_name), 3)
2766                  , 2)
2767              ).
2768  
2769              n.endTable()
2770          ).
2771  
2772          tdb(tb($tag_name));
2773      }
2774  
2775  // -------------------------------------------------------------
2776  
2777  	function tag_comment_web_input()
2778      {
2779          global $step, $endform, $tag_name;
2780  
2781          return form(
2782              startTable('tagbuilder').
2783  
2784              tr(
2785                  tdcs(
2786                      hed(gTxt('tag_'.$tag_name), 3)
2787                  , 2)
2788              ).
2789  
2790              n.endTable()
2791          ).
2792  
2793          tdb(tb($tag_name));
2794      }
2795  
2796  // -------------------------------------------------------------
2797  
2798  	function tag_comments()
2799      {
2800          global $step, $endform, $tag_name;
2801  
2802          $atts = gpsa(array(
2803              'break',
2804              'breakclass',
2805              'class',
2806              'id',
2807              'form',
2808              'sort',
2809              'wraptag'
2810          ));
2811  
2812          extract($atts);
2813  
2814          $out = form(
2815              startTable('tagbuilder').
2816  
2817              tr(
2818                  tdcs(
2819                      hed(gTxt('tag_'.$tag_name), 3)
2820                  , 2)
2821              ).
2822  
2823              tagRow('id',
2824                  input_id($id)).
2825  
2826              tagRow('form',
2827                  form_pop('form', 'comment', $form)).
2828  
2829              tagRow('sort',
2830                  discuss_sort_pop($sort)).
2831  
2832              tagRow('wraptag',
2833                  input_tag('wraptag', $wraptag)).
2834  
2835              tagRow('class',
2836                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2837  
2838              tagRow('break',
2839                  input_tag('break', $break)).
2840  
2841              tagRow('breakclass',
2842                  fInput('text', 'breakclass', $breakclass, 'edit', '', '', 25)).
2843  
2844              $endform
2845          );
2846  
2847          if ($step == 'build')
2848          {
2849              $out .= tdb(tb($tag_name, $atts));
2850          }
2851  
2852          return $out;
2853      }
2854  
2855  // -------------------------------------------------------------
2856  
2857  	function tag_comments_form()
2858      {
2859          global $step, $endform, $tag_name;
2860  
2861          $atts = gpsa(array(
2862              'class',
2863              'id',
2864              'isize',
2865              'form',
2866              'msgcols',
2867              'msgrows',
2868              'wraptag'
2869          ));
2870  
2871          extract($atts);
2872  
2873          $out = form(
2874              startTable('tagbuilder').
2875  
2876              tr(
2877                  tdcs(
2878                      hed(gTxt('tag_'.$tag_name), 3)
2879                  , 2)
2880              ).
2881  
2882              tagRow('id',
2883                  input_id($id)).
2884  
2885              tagRow('isize',
2886                  fInput('text', 'isize', $isize, 'edit', '', '', 2)).
2887  
2888              tagRow('msgcols',
2889                  fInput('text', 'msgcols', $msgcols, 'edit', '', '', 2)).
2890  
2891              tagRow('msgrows',
2892                  fInput('text', 'msgrows', $msgrows, 'edit', '', '', 2)).
2893  
2894              tagRow('form',
2895                  form_pop('form', 'comment', $form)).
2896  
2897              tagRow('wraptag',
2898                  input_tag('wraptag', $wraptag)).
2899  
2900              tagRow('class',
2901                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2902  
2903              $endform
2904          );
2905  
2906          if ($step == 'build')
2907          {
2908              $out .= tdb(tb($tag_name, $atts));
2909          }
2910  
2911          return $out;
2912      }
2913  
2914  // -------------------------------------------------------------
2915  
2916  	function tag_comments_preview()
2917      {
2918          global $step, $endform, $tag_name;
2919  
2920          $atts = gpsa(array(
2921              'class',
2922              'id',
2923              'form',
2924              'wraptag'
2925          ));
2926  
2927          extract($atts);
2928  
2929          $out = form(
2930              startTable('tagbuilder').
2931  
2932              tr(
2933                  tdcs(
2934                      hed(gTxt('tag_'.$tag_name), 3)
2935                  , 2)
2936              ).
2937  
2938              tagRow('id',
2939                  input_id($id)).
2940  
2941              tagRow('form',
2942                  form_pop('form', 'comment', $form)).
2943  
2944              tagRow('wraptag',
2945                  input_tag('wraptag', $wraptag)).
2946  
2947              tagRow('class',
2948                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2949  
2950              $endform
2951          );
2952  
2953          if ($step == 'build')
2954          {
2955              $out .= tdb(tb($tag_name, $atts));
2956          }
2957  
2958          return $out;
2959      }
2960  
2961  // -------------------------------------------------------------
2962  
2963  	function tag_search_result_title()
2964      {
2965          global $step, $endform, $tag_name;
2966  
2967          return form(
2968              startTable('tagbuilder').
2969  
2970              tr(
2971                  tdcs(
2972                      hed(gTxt('tag_'.$tag_name), 3)
2973                  , 2)
2974              ).
2975  
2976              n.endTable()
2977          ).
2978  
2979          tdb(tb($tag_name));
2980      }
2981  
2982  // -------------------------------------------------------------
2983  
2984  	function tag_search_result_excerpt()
2985      {
2986          global $step, $endform, $tag_name;
2987  
2988          $atts = gpsa(array(
2989              'hilight',
2990              'limit'
2991          ));
2992  
2993          extract($atts);
2994  
2995          $out = form(
2996              startTable('tagbuilder').
2997  
2998              tr(
2999                  tdcs(
3000                      hed(gTxt('tag_'.$tag_name), 3)
3001                  , 2)
3002              ).
3003  
3004              tagRow('hilight',
3005                  input_tag('hilight', $hilight)).
3006  
3007              tagRow('hilight_limit',
3008                  input_limit($limit)).
3009  
3010              $endform
3011          );
3012  
3013          if ($step == 'build')
3014          {
3015              $out .= tdb(tb($tag_name, $atts));
3016          }
3017  
3018          return $out;
3019      }
3020  
3021  // -------------------------------------------------------------
3022  
3023  	function tag_search_result_url()
3024      {
3025          global $step, $endform, $tag_name;
3026  
3027          return form(
3028              startTable('tagbuilder').
3029  
3030              tr(
3031                  tdcs(
3032                      hed(gTxt('tag_'.$tag_name), 3)
3033                  , 2)
3034              ).
3035  
3036              n.endTable()
3037          ).
3038  
3039          tdb(tb($tag_name));
3040      }
3041  
3042  // -------------------------------------------------------------
3043  
3044  	function tag_search_result_date()
3045      {
3046          global $step, $endform, $tag_name;
3047  
3048          $atts = gpsa(array(
3049              'format',
3050              'gmt',
3051              'lang'
3052          ));
3053  
3054          extract($atts);
3055  
3056          $out = form(
3057              startTable('tagbuilder').
3058  
3059              tr(
3060                  tdcs(
3061                      hed(gTxt('tag_'.$tag_name), 3)
3062                  , 2)
3063              ).
3064  
3065              tagRow('time_format',
3066                  fInput('text', 'format', $format, 'edit', '', '', 25)).
3067  
3068              tagRow('gmt',
3069                  yesno_pop('gmt', $gmt)).
3070  
3071              tagRow('locale',
3072                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
3073  
3074              $endform
3075          );
3076  
3077          if ($step == 'build')
3078          {
3079              $out .= tdb(tb($tag_name, $atts));
3080          }
3081  
3082          return $out;
3083      }
3084  
3085  // -------------------------------------------------------------
3086  
3087  	function tag_lang()
3088      {
3089          global $step, $endform, $tag_name;
3090  
3091          return form(
3092              startTable('tagbuilder').
3093  
3094              tr(
3095                  tdcs(
3096                      hed(gTxt('tag_'.$tag_name), 3)
3097                  , 2)
3098              ).
3099  
3100              n.endTable()
3101          ).
3102  
3103          tdb(tb($tag_name));
3104      }
3105  
3106  // -------------------------------------------------------------
3107  
3108  	function tag_breadcrumb()
3109      {
3110          global $step, $endform, $tag_name;
3111  
3112          $atts = gpsa(array(
3113              'class',
3114              'label',
3115              'link',
3116              'linkclass',
3117              'sep',
3118              'title',
3119              'wraptag'
3120          ));
3121  
3122          extract($atts);
3123  
3124          $out = form(
3125              startTable('tagbuilder').
3126  
3127              tr(
3128                  tdcs(
3129                      hed(gTxt('tag_'.$tag_name), 3)
3130                  , 2)
3131              ).
3132  
3133              tagRow('breadcrumb_separator',
3134                  fInput('text', 'sep', $sep, 'edit', '', '', 4)).
3135  
3136              tagRow('breadcrumb_linked',
3137                  yesno_pop('link', $link)).
3138  
3139              tagRow('linkclass',
3140                  fInput('text', 'linkclass', $linkclass, 'edit', '', '', 25)).
3141  
3142              tagRow('label',
3143                  fInput('text', 'label', $label, 'edit', '', '', 25)).
3144  
3145              tagRow('title',
3146                  fInput('text', 'title', $title, 'edit', '', '', 25)).
3147  
3148              tagRow('wraptag',
3149                  input_tag('wraptag', $wraptag)).
3150  
3151              tagRow('class',
3152                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3153  
3154              $endform
3155          );
3156  
3157          if ($step == 'build')
3158          {
3159              $out .= tdb(tb($tag_name, $atts));
3160          }
3161  
3162          return $out;
3163      }
3164  
3165  // -------------------------------------------------------------
3166  
3167  	function tag_image()
3168      {
3169          global $step, $endform, $tag_name, $img_dir;
3170  
3171          $atts = gpsa(array(
3172              'class',
3173              'escape',
3174              'html_id',
3175              'style',
3176              'wraptag',
3177  
3178              'alt',
3179              'caption',
3180              'h',
3181              'id',
3182              'w',
3183          ));
3184  
3185          extract($atts);
3186  
3187          $ext = gps('ext');
3188          $type = gps('type');
3189  
3190          $types = array(
3191              'textile'            => 'Textile',
3192              'textpattern' => 'Textpattern',
3193              'xhtml'                => 'XHTML'
3194          );
3195  
3196          $out = form(
3197              startTable('tagbuilder').
3198  
3199              tr(
3200                  tdcs(
3201                      hed(gTxt('tag_'.$tag_name), 3)
3202                  , 2)
3203              ).
3204  
3205              tagRow('type',
3206                  ''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
3207  
3208              tagRow('escape',
3209                  escape_pop($escape)).
3210  
3211              tagRow('html_id',
3212                  fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
3213  
3214              tagRow('class',
3215                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3216  
3217              tagRow('inline_style',
3218                  fInput('text', 'style', $style, 'edit', '', '', 25)).
3219  
3220              tagRow('wraptag',
3221                  fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
3222  
3223              hInput('id', $id).
3224              hInput('ext', $ext).
3225              hInput('w', $w).
3226              hInput('h', $h).
3227              hInput('alt', $alt).
3228              hInput('caption', $caption).
3229  
3230              $endform
3231          );
3232  
3233          if ($step == 'build')
3234          {
3235              if ($escape == 'html')
3236              {
3237                  $alt = str_replace('&', '&#38;', htmlspecialchars($alt));
3238                  $caption = str_replace('&', '&#38;', htmlspecialchars($caption));
3239              }
3240  
3241              $url = hu.$img_dir.'/'.$id.$ext;
3242  
3243              switch ($type)
3244              {
3245                  case 'textile':
3246                      $alt = ($alt) ? ' ('.$alt.')' : '';
3247  
3248                      if ($wraptag)
3249                      {
3250                          if ($class)
3251                          {
3252                              $wraptag .= '('.$class;
3253  
3254                              if ($html_id)
3255                              {
3256                                  $wraptag .= '#'.$html_id;
3257                              }
3258  
3259                              $wraptag .= ')';
3260                          }
3261  
3262                          elseif ($html_id)
3263                          {
3264                              $wraptag .= "(#$html_id)";
3265                          }
3266  
3267                          if ($style)
3268                          {
3269                              $wraptag .= '{'.$style.'}';
3270                          }
3271  
3272                          $wraptag .= '. ';
3273                      }
3274  
3275                      $out .= tdb(
3276                          $wraptag.'!'.$url.$alt.'!'
3277                      );
3278                  break;
3279  
3280                  case 'xhtml':
3281                      $alt     = ($alt)     ? ' alt="'.$alt.'"' : '';
3282                      $caption = ($caption) ? ' title="'.$caption.'"' : '';
3283                      $class   = ($class)   ? ' class="'.$class.'"' : '';
3284                      $html_id = ($html_id) ? ' id="'.$html_id.'"' : '';
3285                      $style   = ($style)   ? ' style="'.$style.'"' : '';
3286  
3287                      $out .= tdb(
3288                          ($wraptag ? "<$wraptag>" : '').
3289                          '<img src="'.$url.'" width="'.$w.'" height="'.$h.'"'.$alt.$caption.$html_id.$class.$style.' />'.
3290                          ($wraptag ? "</$wraptag>" : '')
3291                      );
3292                  break;
3293  
3294                  case 'textpattern':
3295                  default:
3296  
3297                      $atts = array(
3298                          'class'   => $class, 
3299                          'html_id' => $html_id, 
3300                          'id'      => $id, 
3301                          'style'   => $style,
3302                          'wraptag' => $wraptag
3303                      );
3304  
3305                      $out .= tdb(tb($tag_name, $atts));
3306                  break;
3307              }
3308          }
3309  
3310          return $out;
3311      }
3312  
3313  // -------------------------------------------------------------
3314  
3315  	function tag_file_download()
3316      {
3317          global $step, $endform, $tag_name;
3318  
3319          $atts = gpsa(array(
3320              'form',
3321              'id'
3322          ));
3323  
3324          extract($atts);
3325  
3326          $out = form(
3327              startTable('tagbuilder').
3328  
3329              tr(
3330                  tdcs(
3331                      hed(gTxt('tag_'.$tag_name), 3)
3332                  , 2)
3333              ).
3334  
3335              tagRow('id',
3336                  input_id($id)).
3337  
3338              tagRow('form',
3339                  form_pop('form', 'file', $form)).
3340  
3341              $endform
3342          );
3343  
3344          if ($step == 'build')
3345          {
3346              $out .= tdb(tb($tag_name, $atts));
3347          }
3348  
3349          return $out;
3350      }
3351  
3352  // -------------------------------------------------------------
3353  
3354  	function tag_file_download_list()
3355      {
3356          global $step, $endform, $tag_name;
3357  
3358          $atts = gpsa(array(
3359              'break',
3360              'category',
3361              'form',
3362              'label',
3363              'labeltag',
3364              'limit',
3365              'sort',
3366              'wraptag',
3367          ));
3368  
3369          $asc = ' ('.gTxt('ascending').')';
3370          $desc = ' ('.gTxt('descending').')';
3371  
3372          $sorts = array(
3373              'filename asc'     => gTxt('file_name').$asc,
3374              'filename desc'     => gTxt('file_name').$desc,
3375              'downloads asc'     => gTxt('downloads').$asc,
3376              'downloads desc' => gTxt('downloads').$desc,
3377              'rand()'                 => 'Random'
3378          );
3379  
3380          extract($atts);
3381  
3382          $out = form(
3383              startTable('tagbuilder').
3384  
3385              tr(tdcs(hed(gTxt('tag_'.$tag_name),3),2) ).
3386  
3387              tagRow('category',
3388                  file_category_pop($category)).
3389  
3390              tagRow('sort',
3391                  ' '.selectInput('sort', $sorts, $sort, true)).
3392  
3393              tagRow('limit',
3394                  input_limit($limit)).
3395  
3396              tagRow('label',
3397                  fInput('text', 'label', $label, 'edit', '', '', 25)).
3398  
3399              tagRow('labeltag',
3400                  input_tag('labeltag', $labeltag)).
3401  
3402              tagRow('wraptag',
3403                  input_tag('wraptag',$wraptag)).
3404  
3405              tagRow('break',
3406                  input_tag('break',$break)).
3407  
3408              tagRow('form',
3409                  form_pop('form','file',$form)).
3410  
3411              $endform
3412          );
3413  
3414          if ($step == 'build')
3415          {
3416              $out .= tdb(tb($tag_name, $atts));
3417          }
3418  
3419          echo $out;
3420      }
3421  
3422  // -------------------------------------------------------------
3423  
3424  	function tag_file_download_created()
3425      {
3426          global $step, $endform, $tag_name;
3427  
3428          $atts = gpsa(array(
3429              'format'
3430          ));
3431  
3432          extract($atts);
3433  
3434          $out = form(
3435              startTable('tagbuilder').
3436  
3437              tr(
3438                  tdcs(
3439                      hed(gTxt('tag_'.$tag_name), 3)
3440                  , 2)
3441              ).
3442  
3443              tagRow('time_format',
3444                  fInput('text', 'format', $format, 'edit', '', '', 15)).
3445  
3446              $endform
3447          );
3448  
3449          if ($step == 'build')
3450          {
3451              $out .= tdb(tb($tag_name, $atts));
3452          }
3453  
3454          return $out;
3455      }
3456  
3457  // -------------------------------------------------------------
3458  
3459  	function tag_file_download_modified()
3460      {
3461          global $step, $endform, $tag_name;
3462  
3463          $atts = gpsa(array(
3464              'format'
3465          ));
3466  
3467          extract($atts);
3468  
3469          $out = form(
3470              startTable('tagbuilder').
3471  
3472              tr(
3473                  tdcs(
3474                      hed(gTxt('tag_'.$tag_name), 3)
3475                  , 2)
3476              ).
3477  
3478              tagRow('time_format',
3479                  fInput('text', 'format', $format, 'edit', '', '', 15)).
3480  
3481              $endform
3482          );
3483  
3484          if ($step == 'build')
3485          {
3486              $out .= tdb(tb($tag_name, $atts));
3487          }
3488  
3489          return $out;
3490      }
3491  
3492  // -------------------------------------------------------------
3493  
3494  	function tag_file_download_size()
3495      {
3496          global $step, $endform, $tag_name;
3497  
3498          $atts = gpsa(array(
3499              'decimals',
3500              'format'
3501          ));
3502  
3503          $formats = array(
3504              'b'     => 'Bytes',
3505              'kb' => 'Kilobytes',
3506              'mb' => 'Megabytes',
3507              'gb' => 'Gigabytes',
3508              'tb' => 'Terabytes',
3509              'pb' => 'Petabytes'
3510          );
3511  
3512          extract($atts);
3513  
3514          $out = form(
3515              startTable('tagbuilder').
3516  
3517              tr(
3518                  tdcs(hed(gTxt('tag_'.$tag_name), 3)
3519              , 2)
3520              ).
3521  
3522              tagRow('size_format',
3523                  ' '.selectInput('format', $formats, $format, true)).
3524  
3525              tagRow('decimals',
3526                  fInput('text', 'decimals', $decimals, 'edit', '', '', 4)).
3527  
3528              $endform
3529          );
3530  
3531          if ($step == 'build')
3532          {
3533              $out .= tdb(tb($tag_name, $atts));
3534          }
3535  
3536          return $out;
3537      }
3538  
3539  // -------------------------------------------------------------
3540  
3541  	function tag_file_download_link()
3542      {
3543          global $step, $endform, $tag_name, $permlink_mode;
3544  
3545          $atts = gpsa(array(
3546              'filename',
3547              'id'
3548          ));
3549  
3550          extract($atts);
3551  
3552          $thing = gps('thing');
3553  
3554          $type = gps('type');
3555          $description = gps('description');
3556  
3557          $types = array(
3558              'textile'            => 'Textile',
3559              'textpattern' => 'Textpattern',
3560              'xhtml'                => 'XHTML'
3561          );
3562  
3563          $out = form(
3564              startTable('tagbuilder').
3565  
3566              tr(
3567                  tdcs(
3568                      hed(gTxt('tag_'.$tag_name), 3)
3569                  , 2)
3570              ).
3571  
3572              tagRow('type',
3573                  ''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
3574  
3575              tagRow('id',
3576                  input_id($id)).
3577  
3578              tagRow('filename',
3579                  fInput('text', 'filename', $filename, 'edit', '', '', 25)).
3580  
3581              tagRow('link_text',
3582                  fInput('text', 'thing', ($thing ? $thing : $filename), 'edit', '', '', 25)).
3583  
3584              tagRow('description',
3585                  '<textarea name="description" cols="22" rows="3">'.$description.'</textarea>').
3586  
3587              $endform
3588          );
3589  
3590          if ($step == 'build')
3591          {
3592              $description = str_replace('&', '&#38;', htmlspecialchars($description));
3593  
3594              $url = ($permlink_mode == 'messy') ?
3595                  hu.'index.php?s=file_download'.a.'id='.$id:
3596                  hu.gTxt('file_download').'/'.$id.($filename ? '/'.$filename : '');
3597  
3598              switch ($type)
3599              {
3600                  case 'textile':
3601                      $thing = ($thing) ? $thing : $filename;
3602                      $description = ($description) ? ' ('.$description.')' : '';
3603  
3604                      $out .= tdb('"'.$thing.$description.'":'.$url);
3605                  break;
3606  
3607                  case 'xhtml':
3608                      $thing = ($thing) ? $thing : $filename;
3609                      $description = ($description) ? ' title="'.$description.'"' : '';
3610  
3611                      $out .= tdb('<a href="'.$url.'"'.$description.'>'.$thing.'</a>');
3612                  break;
3613  
3614                  case 'textpattern':
3615                  default:
3616                      $atts = array('id' => $id);
3617                      $thing = ($thing) ? $thing : '<txp:file_download_name />';
3618  
3619                      $out .= tdb(tb($tag_name, $atts, $thing));
3620                  break;
3621              }
3622          }
3623  
3624          return $out;
3625      }
3626  
3627  // -------------------------------------------------------------
3628  
3629  	function tag_file_download_name()
3630      {
3631          global $step, $endform, $tag_name;
3632  
3633          return form(
3634              startTable('tagbuilder').
3635  
3636              tr(
3637                  tdcs(
3638                      hed(gTxt('tag_'.$tag_name), 3)
3639                  , 2)
3640              ).
3641  
3642              n.endTable()
3643          ).
3644  
3645          tdb(tb($tag_name));
3646      }
3647  
3648  // -------------------------------------------------------------
3649  
3650  	function tag_file_download_downloads()
3651      {
3652          global $step, $endform, $tag_name;
3653  
3654          return form(
3655              startTable('tagbuilder').
3656  
3657              tr(
3658                  tdcs(
3659                      hed(gTxt('tag_'.$tag_name), 3)
3660                  , 2)
3661              ).
3662  
3663              n.endTable()
3664          ).
3665  
3666          tdb(tb($tag_name));
3667      }
3668  
3669  // -------------------------------------------------------------
3670  
3671  	function tag_file_download_category()
3672      {
3673          global $step, $endform, $tag_name;
3674  
3675          $atts = gpsa(array(
3676              'class',
3677              'escape',
3678              'wraptag'
3679          ));
3680  
3681          extract($atts);
3682  
3683          $out = form(
3684              startTable('tagbuilder').
3685  
3686              tr(
3687                  tdcs(
3688                      hed(gTxt('tag_'.$tag_name), 3)
3689                  , 2)
3690              ).
3691  
3692              tagRow('escape',
3693                  escape_pop($escape)).
3694  
3695              tagRow('wraptag',
3696                  input_tag('wraptag', $wraptag)).
3697  
3698              tagRow('class',
3699                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3700  
3701              $endform
3702          );
3703  
3704          if ($step == 'build')
3705          {
3706              $out .= tdb(tb($tag_name, $atts));
3707          }
3708  
3709          return $out;
3710      }
3711  
3712  // -------------------------------------------------------------
3713  
3714  	function tag_file_download_description()
3715      {
3716          global $step, $endform, $tag_name;
3717  
3718          $atts = gpsa(array(
3719              'class',
3720              'escape',
3721              'wraptag'
3722          ));
3723  
3724          extract($atts);
3725  
3726          $out = form(
3727              startTable('tagbuilder').
3728  
3729              tr(
3730                  tdcs(
3731                      hed(gTxt('tag_'.$tag_name), 3)
3732                  , 2)
3733              ).
3734  
3735              tagRow('escape',
3736                  escape_pop($escape)).
3737  
3738              tagRow('wraptag',
3739                  input_tag('wraptag', $wraptag)).
3740  
3741              tagRow('class',
3742                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3743  
3744              $endform
3745          );
3746  
3747          if ($step == 'build')
3748          {
3749              $out .= tdb(tb($tag_name, $atts));
3750          }
3751  
3752          return $out;
3753      }
3754  
3755  ?>


Generated: Mon Feb 18 03:42:45 2008 Cross-referenced by PHPXref 0.7