Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/include/txp_tag.php - 2925 lines - 80435 bytes - Summary - Text - Print

Description: Tag builder.

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * http://textpattern.com
   6   *
   7   * Copyright (C) 2005 Dean Allen
   8   * Copyright (C) 2016 The Textpattern Development Team
   9   *
  10   * This file is part of Textpattern.
  11   *
  12   * Textpattern is free software; you can redistribute it and/or
  13   * modify it under the terms of the GNU General Public License
  14   * as published by the Free Software Foundation, version 2.
  15   *
  16   * Textpattern is distributed in the hope that it will be useful,
  17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19   * GNU General Public License for more details.
  20   *
  21   * You should have received a copy of the GNU General Public License
  22   * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
  23   */
  24  
  25  /**
  26   * Tag builder.
  27   *
  28   * @package Admin\Tag
  29   */
  30  
  31  namespace Textpattern\Tag;
  32  
  33  if (!defined('txpinterface')) {
  34      die('txpinterface is undefined.');
  35  }
  36  
  37  header('X-Frame-Options: '.X_FRAME_OPTIONS);
  38  header('X-UA-Compatible: '.X_UA_COMPATIBLE);
  39  
  40  ?><div id="tag-event">
  41  <?php echo \Txp::get('\Textpattern\Tag\BuilderTags')->renderTagHelp(gps('tag_name'), gps('panel')); ?>
  42  </div>
  43  <?php
  44  
  45  /**
  46   * Collection of tag builder functions.
  47   *
  48   * @package Admin\Tag
  49   */
  50  class BuilderTags
  51  {
  52      /**
  53       * HTML block for the header portion of the form tag.
  54       *
  55       * @var string
  56       */
  57  
  58      private $startblock;
  59  
  60      /**
  61       * HTML block for the end of the form tag.
  62       *
  63       * Includes submit button and hidden form elements.
  64       *
  65       * @var string
  66       */
  67  
  68      private $endform;
  69  
  70      /**
  71       * The name of the tagbuilder tag that is currently being displayed.
  72       *
  73       * @var string
  74       */
  75  
  76      private $tagname;
  77  
  78      /**
  79       * Returns a single tag handler instance.
  80       *
  81       * @param  string $name  The tag
  82       * @param  string $panel The panel from which the tag was invoked
  83       * @return string|bool HTML or FALSE on error
  84       */
  85  
  86      public function renderTagHelp($name, $panel)
  87      {
  88          $this->tagname = (string)$name;
  89          $method = 'tag_'.$this->tagname;
  90  
  91          if (method_exists($this, $method)) {
  92              $backLink = '';
  93  
  94              if ($panel) {
  95                  $backLink = graf(
  96                          href(gTxt('go_back'), '?event='.$panel.'&step=tagbuild', array('class' => 'txp-tagbuilder-link')),
  97                          array('class' => 'txp-actions')
  98                      );
  99              }
 100  
 101              $this->startblock = $backLink.
 102                  hed(gTxt('tag_'.$this->tagname), 2).
 103                  href(gTxt('documentation').sp.span(gTxt('opens_external_link'), array('class' => 'ui-icon ui-icon-extlink')),
 104                      'http://docs.textpattern.io/tags/'.$this->tagname,
 105                      array(
 106                          'class'  => 'txp-tagbuilder-docs-link',
 107                          'rel'    => 'external',
 108                          'target' => '_blank',
 109                      )
 110                  );
 111  
 112              $this->endform = graf(
 113                      fInput('submit', '', gTxt('build'))
 114                  ).
 115                  eInput('tag').
 116                  sInput('build').
 117                  hInput('tag_name', $this->tagname).
 118                  hInput('panel', $panel);
 119  
 120              return $this->$method($this->tagname);
 121          }
 122  
 123          return false;
 124      }
 125  
 126      /**
 127       * Renders a form tag with the given content.
 128       *
 129       * @param  string $content The HTML form contents
 130       * @return string HTML
 131       */
 132  
 133      private function tagbuildForm($content)
 134      {
 135          return form($content, '', '', 'post', 'asynchtml txp-tagbuilder', 'txp-tagbuilder-output');
 136      }
 137  
 138      /**
 139       * Renders an input widget.
 140       *
 141       * @param  string $label The label reference to use (will be subject to l10n)
 142       * @param  string $thing Content
 143       * @return string HTML
 144       */
 145  
 146      private function widget($label, $thing)
 147      {
 148          // TODO: Link to attribute help?
 149          return inputLabel(
 150              $label,
 151              $thing,
 152              $label
 153          );
 154      }
 155  
 156      /**
 157       * Renders a set of input widgets.
 158       *
 159       * @param  array $widgets List of label => content pairs
 160       * @return string HTML
 161       */
 162  
 163      private function widgets($widgets)
 164      {
 165          $out = '';
 166  
 167          // TODO: Link to attribute help?
 168          foreach ($widgets as $label => $thing) {
 169              $out .= $this->widget($label, $thing);
 170          }
 171  
 172          return $out;
 173      }
 174  
 175      /**
 176       * Generates a parameter-less Textpattern tag.
 177       *
 178       * @return string &lt;txp:tag /&gt;
 179       */
 180  
 181      private function tbNoAtts()
 182      {
 183          return $this->tagbuildForm($this->startblock).$this->tdb($this->tb($this->tagname));
 184      }
 185  
 186      /**
 187       * Generates a Textpattern tag from the given attributes and content.
 188       *
 189       * @param  string $tag Tag name
 190       * @param  string $atts_list List of attribute => value pairs
 191       * @param  string $thing Tag container content
 192       * @return string &lt;txp:tag ...&gt;
 193       */
 194  
 195      private function tb($tag, $atts_list = array(), $thing = '')
 196      {
 197          $atts = array();
 198  
 199          foreach ($atts_list as $att => $val) {
 200              if ($val or $val === '0' or $val === '{att_empty}') {
 201                  $val = str_replace('{att_empty}', '', $val);
 202                  $atts[] = ' '.$att.'="'.$val.'"';
 203              }
 204          }
 205  
 206          $atts = ($atts) ? join('', $atts) : '';
 207  
 208          return !empty($thing) ?
 209              '<txp:'.$tag.$atts.'>'.$thing.'</txp:'.$tag.'>' :
 210              '<txp:'.$tag.$atts.' />';
 211      }
 212  
 213      /**
 214       * Renders a textarea to hold the built content.
 215       *
 216       * @param  string $thing Content
 217       * @return string HTML
 218       */
 219  
 220      private function tdb($thing)
 221      {
 222          return graf(text_area(
 223              'txp-tagbuilder-output',
 224              '',
 225              '',
 226              $thing,
 227              'txp-tagbuilder-output',
 228              TEXTAREA_HEIGHT_SMALL,
 229              INPUT_LARGE
 230          ));
 231      }
 232  
 233      /**
 234       * Assembles the tag output container.
 235       *
 236       * @param  array $atts Attribute key => value pairs
 237       * @param  string $thing Tag container content
 238       * @return string HTML
 239       */
 240  
 241      private function build($atts, $thing = '')
 242      {
 243          global $step;
 244  
 245          $out = '';
 246  
 247          if ($step === 'build') {
 248              $out = $this->tdb($this->tb($this->tagname, $atts, $thing));
 249          }
 250  
 251          return $out;
 252      }
 253  
 254      /**
 255       * Renders a HTML &lt;select&gt; list of time ranges.
 256       *
 257       * @param  string $time Currently selected value
 258       * @return string HTML
 259       */
 260  
 261      private function tbTimePop($time)
 262      {
 263          $vals = array(
 264              'past'   => gTxt('time_past'),
 265              'future' => gTxt('time_future'),
 266              'any'    => gTxt('time_any'),
 267          );
 268  
 269          return ' '.selectInput('time', $vals, $time, true, '', 'time');
 270      }
 271  
 272      /**
 273       * Renders HTML boolean &lt;select&gt; options.
 274       *
 275       * @param  string $name Input name/ID
 276       * @param  string $value Currently selected value
 277       * @return string HTML
 278       */
 279  
 280      private function tbYesNoPop($select_name, $value)
 281      {
 282          $vals = array(
 283              1 => gTxt('yes'),
 284              0 => gTxt('no'),
 285          );
 286  
 287          if (is_numeric($value)) {
 288              $value = (int)$value;
 289          }
 290  
 291          return ' '.selectInput($select_name, $vals, $value, true, '', $select_name, true);
 292      }
 293  
 294      /**
 295       * Renders a HTML &lt;select&gt; list of article status options.
 296       *
 297       * @param  string $value Currently selected value
 298       * @return string HTML
 299       */
 300  
 301      private function tbStatusPop($value)
 302      {
 303          $vals = array(
 304              STATUS_LIVE    => gTxt('live'),
 305              STATUS_STICKY  => gTxt('sticky'),
 306              STATUS_PENDING => gTxt('pending'),
 307              STATUS_DRAFT   => gTxt('draft'),
 308              STATUS_HIDDEN  => gTxt('hidden'),
 309          );
 310  
 311          return ' '.selectInput('status', $vals, $value, true, '', 'status');
 312      }
 313  
 314      /**
 315       * Renders a HTML &lt;select&gt; list of sort options.
 316       *
 317       * @param  string $value Currently selected value
 318       * @return string HTML
 319       */
 320  
 321      private function tbSortPop($value)
 322      {
 323          $asc = ' ('.gTxt('ascending').')';
 324          $desc = ' ('.gTxt('descending').')';
 325  
 326          $vals = array(
 327              'Title asc'      => gTxt('tag_title').$asc,
 328              'Title desc'     => gTxt('tag_title').$desc,
 329              'Posted asc'     => gTxt('tag_posted').$asc,
 330              'Posted desc'    => gTxt('tag_posted').$desc,
 331              'LastMod asc'    => gTxt('last_modification').$asc,
 332              'LastMod desc'   => gTxt('last_modification').$desc,
 333              'Section asc'    => gTxt('section').$asc,
 334              'Section desc'   => gTxt('section').$desc,
 335              'Category1 asc'  => gTxt('category1').$asc,
 336              'Category1 desc' => gTxt('category1').$desc,
 337              'Category2 asc'  => gTxt('category2').$asc,
 338              'Category2 desc' => gTxt('category2').$desc,
 339              'rand()'         => gTxt('random'),
 340          );
 341  
 342          return ' '.selectInput('sort', $vals, $value, true, '', 'sort');
 343      }
 344  
 345      /**
 346       * Renders a HTML &lt;select&gt; list of comment sort options.
 347       *
 348       * @param  string $value Currently selected value
 349       * @return string HTML
 350       */
 351  
 352      private function tbDiscussSortPop($value)
 353      {
 354          $asc = ' ('.gTxt('ascending').')';
 355          $desc = ' ('.gTxt('descending').')';
 356  
 357          $vals = array(
 358              'posted asc'  => gTxt('posted').$asc,
 359              'posted desc' => gTxt('posted').$desc,
 360          );
 361  
 362          return ' '.selectInput('sort', $vals, $value, true, '', 'sort');
 363      }
 364  
 365      /**
 366       * Renders a HTML &lt;select&gt; list of article sort options.
 367       *
 368       * @param  string $value Currently selected value
 369       * @return string HTML
 370       */
 371  
 372      private function tbListSortPop($value)
 373      {
 374          $asc = ' ('.gTxt('ascending').')';
 375          $desc = ' ('.gTxt('descending').')';
 376  
 377          $vals = array(
 378              'title asc'  => gTxt('tag_title').$asc,
 379              'title desc' => gTxt('tag_title').$desc,
 380              'name asc'   => gTxt('name').$asc,
 381              'name desc'  => gTxt('name').$desc,
 382          );
 383  
 384          return ' '.selectInput('sort', $vals, $value, true, '', 'sort');
 385      }
 386  
 387      /**
 388       * Renders a HTML &lt;select&gt; list of authors/users.
 389       *
 390       * @param  string $value Currently selected value
 391       * @return string HTML
 392       */
 393  
 394      private function tbAuthorPop($value)
 395      {
 396          $vals = array();
 397  
 398          $rs = safe_rows_start("name", 'txp_users', "1 = 1 ORDER BY name");
 399  
 400          if ($rs) {
 401              while ($a = nextRow($rs)) {
 402                  extract($a);
 403  
 404                  $vals[$name] = $name;
 405              }
 406  
 407              return ' '.selectInput('author', $vals, $value, true, '', 'author');
 408          }
 409      }
 410  
 411      /**
 412       * Renders a HTML &lt;select&gt; list of Sections.
 413       *
 414       * @param  string $select_name Input name/ID
 415       * @param  string $value Currently selected value
 416       * @return string HTML
 417       */
 418  
 419      private function tbSectionPop($select_name, $value)
 420      {
 421          $vals = array();
 422  
 423          $rs = safe_rows_start("name, title", 'txp_section', "name != 'default' ORDER BY name");
 424  
 425          if ($rs && numRows($rs) > 0) {
 426              while ($a = nextRow($rs)) {
 427                  extract($a);
 428  
 429                  $vals[$name] = $title;
 430              }
 431  
 432              return ' '.selectInput($select_name, $vals, $value, true, '', $select_name);
 433          }
 434  
 435          return gTxt('no_sections_available');
 436      }
 437  
 438      /**
 439       * Renders a HTML &lt;select&gt; list of Categories.
 440       *
 441       * @param  string $value Currently selected value
 442       * @param  string $type Context to which the category applies
 443       * @return string HTML
 444       */
 445  
 446      private function tbCategoryPop($value, $type = 'article')
 447      {
 448          $vals = getTree('root', $type);
 449  
 450          if ($vals) {
 451              return ' '.treeSelectInput('category', $vals, $value, 'category');
 452          }
 453  
 454          return gTxt('no_categories_available');
 455      }
 456  
 457      /**
 458       * Renders a HTML &lt;select&gt; list of category match options.
 459       *
 460       * @param  string $value Currently selected value
 461       * @return string HTML
 462       */
 463  
 464      private function tbMatchCatPop($value)
 465      {
 466          $vals = array(
 467              'Category1,Category2' => gTxt('category1').' '.gTxt('and').' '.gTxt('category2'),
 468              'Category1'           => gTxt('category1'),
 469              'Category2'           => gTxt('category2'),
 470          );
 471  
 472          return ' '.selectInput('match', $vals, $value, true, '', 'match');
 473      }
 474  
 475      /**
 476       * Renders a HTML &lt;select&gt; list of pattern match types.
 477       *
 478       * @param  string $value Currently selected value
 479       * @return string HTML
 480       */
 481  
 482      private function tbPatternPop($value)
 483      {
 484          $vals = array(
 485              'exact' => gTxt('exact'),
 486              'any'   => gTxt('any'),
 487              'all'   => gTxt('all'),
 488          );
 489  
 490          return ' '.selectInput('match', $vals, $value, false, '', 'match');
 491      }
 492  
 493      /**
 494       * Renders a HTML &lt;select&gt; list of context types.
 495       *
 496       * @param  string $value Currently selected value
 497       * @return string HTML
 498       */
 499  
 500      private function tbTypePop($value)
 501      {
 502          $vals = array(
 503              'article' => gTxt('article'),
 504              'image'   => gTxt('image'),
 505              'file'    => gTxt('file'),
 506              'link'    => gTxt('link'),
 507          );
 508  
 509          return ' '.selectInput('type', $vals, $value, true, '', 'type');
 510      }
 511  
 512      /**
 513       * Renders a HTML &lt;select&gt; list of forms.
 514       *
 515       * @param  string $select_name Input name/ID
 516       * @param  string $type Form type
 517       * @param  string $value Currently selected value
 518       * @return string HTML
 519       */
 520  
 521      private function tbFormPop($select_name, $type = '', $value)
 522      {
 523          $vals = array();
 524  
 525          $type = ($type) ? "type = '".doSlash($type)."'" : "1 = 1";
 526  
 527          $rs = safe_rows_start("name", 'txp_form', "$type ORDER BY name");
 528  
 529          if ($rs and numRows($rs) > 0) {
 530              while ($a = nextRow($rs)) {
 531                  extract($a);
 532  
 533                  $vals[$name] = $name;
 534              }
 535  
 536              return ' '.selectInput($select_name, $vals, $value, true, '', $select_name);
 537          }
 538  
 539          return gTxt('no_forms_available');
 540      }
 541  
 542      /**
 543       * Renders a HTML &lt;select&gt; list of Stylesheets.
 544       *
 545       * @param  string $value Currently selected value
 546       * @return string | bool HTML | false on error
 547       */
 548  
 549      private function tbCssPop($value)
 550      {
 551          $vals = array();
 552  
 553          $rs = safe_rows_start("name", 'txp_css', "1 = 1 ORDER BY name");
 554  
 555          if ($rs) {
 556              while ($a = nextRow($rs)) {
 557                  extract($a);
 558  
 559                  $vals[$name] = $name;
 560              }
 561  
 562              return ' '.selectInput('name', $vals, $value, true, '', 'name');
 563          }
 564  
 565          return false;
 566      }
 567  
 568      /**
 569       * Renders a HTML &lt;select&gt; list of CSS formats.
 570       *
 571       * @param  string $value Currently selected value
 572       * @return string HTML
 573       */
 574  
 575      private function tbCssFormatPop($value)
 576      {
 577          $vals = array(
 578              'link' => '<link rel...',
 579              'url'  => 'css.php?...',
 580          );
 581  
 582          return ' '.selectInput('format', $vals, $value, true, '', 'format');
 583      }
 584  
 585      /**
 586       * Renders a HTML &lt;select&gt; list of escape options.
 587       *
 588       * @param  string $value Currently selected value
 589       * @return string HTML
 590       */
 591  
 592      private function tbEscapePop($value)
 593      {
 594          $vals = array(
 595              '{att_empty}' => '',
 596              'html'        => 'html',
 597          );
 598  
 599          return ' '.selectInput('escape', $vals, $value, false, '', 'escape');
 600      }
 601  
 602      /**
 603       * Renders a HTML &lt;select&gt; list of feed flavours.
 604       *
 605       * @param  string $value Currently selected value
 606       * @return string HTML
 607       */
 608  
 609      private function tbFeedFlavorPop($value)
 610      {
 611          $vals = array(
 612              'atom' => 'Atom 1.0',
 613              'rss'  => 'RSS 2.0',
 614          );
 615  
 616          return ' '.selectInput('flavor', $vals, $value, true, '', 'flavor');
 617      }
 618  
 619      /**
 620       * Renders a HTML &lt;select&gt; list of feed formats.
 621       *
 622       * @param  string $value Currently selected value
 623       * @return string HTML
 624       */
 625  
 626      private function tbFeedFormatPop($value)
 627      {
 628          $vals = array(
 629              'a'    => '<a href...',
 630              'link' => '<link rel...',
 631          );
 632  
 633          return ' '.selectInput('format', $vals, $value, true, '', 'format');
 634      }
 635  
 636      /**
 637       * Renders a HTML &lt;select&gt; list of author formats.
 638       *
 639       * @param  string $value Currently selected value
 640       * @return string HTML
 641       */
 642  
 643      private function tbAuthorFormatPop($value)
 644      {
 645          $vals = array(
 646              'link' => '<a href...',
 647              'url'  => gTxt('url'),
 648          );
 649  
 650          return ' '.selectInput('format', $vals, $value, true, '', 'format');
 651      }
 652  
 653      /**
 654       * Renders a HTML &lt;input&gt; tag.
 655       *
 656       * @param  string $name Input name
 657       * @param  string $value Input value
 658       * @param  string $size Input size in characters
 659       * @param  string $id Input HTML ID. Uses $name if omitted
 660       * @return string HTML
 661       */
 662  
 663      private function tbInput($name, $value, $size = INPUT_SMALL, $id = null)
 664      {
 665          return fInput('text', $name, $value, '', '', '', $size, '', (($id === null) ? $name : $id));
 666      }
 667  
 668      /**
 669       * Tag builder &lt;txp:article&gt; tag.
 670       */
 671  
 672      function tag_article()
 673      {
 674          $atts = gpsa(array(
 675              'allowoverride',
 676              'form',
 677              'limit',
 678              'listform',
 679              'offset',
 680              'pageby',
 681              'pgonly',
 682              'searchall',
 683              'searchsticky',
 684              'sort',
 685              'status',
 686              'time',
 687          ));
 688  
 689          extract($atts);
 690  
 691          $out = $this->tagbuildForm(
 692                  $this->startblock.
 693                  $this->widgets(array(
 694                      'status'        => $this->tbStatusPop($status),
 695                      'time'          => $this->tbTimePop($time),
 696                      'searchall'     => $this->tbYesNoPop('searchall', $searchall),
 697                      'searchsticky'  => $this->tbYesNoPop('searchsticky', $searchsticky),
 698                      'limit'         => $this->tbInput('limit', $limit, INPUT_TINY),
 699                      'offset'        => $this->tbInput('offset', $offset, INPUT_TINY),
 700                      'pageby'        => $this->tbInput('pageby', $pageby, INPUT_TINY),
 701                      'sort'          => $this->tbSortPop($sort),
 702                      'pgonly'        => $this->tbYesNoPop('pgonly', $pgonly),
 703                      'allowoverride' => $this->tbYesNoPop('allowoverride', $allowoverride),
 704                      'form'          => $this->tbFormPop('form', 'article', $form),
 705                      'listform'      => $this->tbFormPop('listform', 'article', $listform),
 706                  )).
 707                  $this->endform
 708              ).
 709              $this->build($atts);
 710  
 711          return $out;
 712      }
 713  
 714      /**
 715       * Tag builder &lt;txp:article_custom&gt; tag.
 716       */
 717  
 718      function tag_article_custom()
 719      {
 720          $atts = gpsa(array(
 721              'allowoverride',
 722              'author',
 723              'break',
 724              'category',
 725              'class',
 726              'excerpted',
 727              'expired',
 728              'form',
 729              'id',
 730              'keywords',
 731              'label',
 732              'labeltag',
 733              'limit',
 734              'month',
 735              'offset',
 736              'pageby',
 737              'pgonly',
 738              'section',
 739              'sort',
 740              'status',
 741              'time',
 742              'wraptag',
 743          ));
 744  
 745          extract($atts);
 746  
 747          $out = $this->tagbuildForm(
 748                  $this->startblock.
 749                  $this->widgets(array(
 750                      'id'            => $this->tbInput('id', $id),
 751                      'status'        => $this->tbStatusPop($status),
 752                      'section'       => $this->tbSectionPop('section', $section),
 753                      'category'      => $this->tbCategoryPop($category),
 754                      'time'          => $this->tbTimePop($time),
 755                      'month'         => fInput(
 756                              'text',
 757                              'month',
 758                              $month,
 759                              '',
 760                              '',
 761                              '',
 762                              7,
 763                              '',
 764                              'month'
 765                          ).' ('.gTxt('yyyy-mm').')',
 766                      'keywords'      => '<textarea name="keywords" id="keywords">'.$keywords.'</textarea>',
 767                      'has_excerpt'   => $this->tbYesNoPop('excerpted', $excerpted),
 768                      'expired'       => $this->tbYesNoPop('expired', $expired),
 769                      'author'        => $this->tbAuthorPop($author),
 770                      'sort'          => $this->tbSortPop($sort),
 771                      'limit'         => $this->tbInput('limit', $limit, INPUT_TINY),
 772                      'offset'        => $this->tbInput('offset', $offset, INPUT_TINY),
 773                      'pgonly'        => $this->tbYesNoPop('pgonly', $pgonly),
 774                      'allowoverride' => $this->tbYesNoPop('allowoverride', $allowoverride),
 775                      'label'         => $this->tbInput('label', $label, INPUT_REGULAR),
 776                      'labeltag'      => $this->tbInput('labeltag', $labeltag),
 777                      'wraptag'       => $this->tbInput('wraptag', $wraptag),
 778                      'class'         => $this->tbInput('class', $class, INPUT_REGULAR),
 779                      'break'         => $this->tbInput('break', $break),
 780                      'form'          => $this->tbFormPop('form', 'article', $form),
 781                  )).
 782                  $this->endform
 783              ).
 784              $this->build($atts);
 785  
 786          return $out;
 787      }
 788  
 789      /**
 790       * Tag builder &lt;txp:article_image&gt; tag.
 791       */
 792  
 793      function tag_article_image()
 794      {
 795          $atts = gpsa(array(
 796              'class',
 797              'escape',
 798              'height',
 799              'html_id',
 800              'style',
 801              'thumbnail',
 802              'width',
 803              'wraptag',
 804          ));
 805  
 806          extract($atts);
 807  
 808          $out = $this->tagbuildForm(
 809                  $this->startblock.
 810                  $this->widgets(array(
 811                      'use_thumbnail' => $this->tbYesNoPop('thumbnail', $thumbnail),
 812                      'escape'        => $this->tbEscapePop($escape),
 813                      'html_id'       => $this->tbInput('html_id', $html_id, INPUT_REGULAR),
 814                      'class'         => $this->tbInput('class', $class, INPUT_REGULAR),
 815                      'inline_style'  => $this->tbInput('style', $style, INPUT_REGULAR, 'inline_style'),
 816                      'wraptag'       => $this->tbInput('wraptag', $wraptag),
 817                  )).
 818                  $this->endform
 819              ).
 820              $this->build($atts);
 821  
 822          return $out;
 823      }
 824  
 825      /**
 826       * Tag builder &lt;txp:author&gt; tag.
 827       */
 828  
 829      function tag_author()
 830      {
 831          $atts = gpsa(array(
 832              'escape',
 833              'format',
 834              'link',
 835              'section',
 836              'this_section',
 837              'title',
 838          ));
 839  
 840          extract($atts);
 841  
 842          $out = $this->tagbuildForm(
 843                  $this->startblock.
 844                  $this->widgets(array(
 845                      'escape'              => $this->tbEscapePop($escape),
 846                      'format'              => $this->tbAuthorFormatPop($format),
 847                      'link_to_this_author' => $this->tbYesNoPop('link', $link),
 848                      'section'             => $this->tbSectionPop('section', $section),
 849                      'this_section'        => $this->tbYesNoPop('this_section', $this_section),
 850                      'title'               => $this->tbYesNoPop('title', $title),
 851                  )).
 852                  $this->endform
 853              ).
 854              $this->build($atts);
 855  
 856          return $out;
 857      }
 858  
 859      /**
 860       * Tag builder &lt;txp:body&gt; tag.
 861       */
 862  
 863      function tag_body()
 864      {
 865          return $this->tbNoAtts();
 866      }
 867  
 868      /**
 869       * Tag builder &lt;txp:breadcrumb&gt; tag.
 870       */
 871  
 872      function tag_breadcrumb()
 873      {
 874          $atts = gpsa(array(
 875              'class',
 876              'label',
 877              'link',
 878              'linkclass',
 879              'separator',
 880              'title',
 881              'wraptag',
 882          ));
 883  
 884          extract($atts);
 885  
 886          $out = $this->tagbuildForm(
 887                  $this->startblock.
 888                  $this->widgets(array(
 889                      'breadcrumb_separator' => $this->tbInput('separator', $separator, INPUT_XSMALL, 'breadcrumb_separator'),
 890                      'breadcrumb_linked'    => $this->tbYesNoPop('link', $link),
 891                      'linkclass'            => $this->tbInput('linkclass', $linkclass, INPUT_REGULAR),
 892                      'label'                => $this->tbInput('label', $label, INPUT_REGULAR),
 893                      'title'                => $this->tbInput('title', $title, INPUT_REGULAR),
 894                      'wraptag'              => $this->tbInput('wraptag', $wraptag),
 895                      'class'                => $this->tbInput('class', $class, INPUT_REGULAR),
 896                  )).
 897                  $this->endform
 898              ).
 899              $this->build($atts);
 900  
 901          return $out;
 902      }
 903  
 904      /**
 905       * Tag builder &lt;txp:category&gt; tag.
 906       */
 907  
 908      function tag_category()
 909      {
 910          $atts = gpsa(array(
 911              'class',
 912              'link',
 913              'name',
 914              'this_section',
 915              'title',
 916              'type',
 917              'url',
 918              'wraptag',
 919          ));
 920  
 921          extract($atts);
 922  
 923          $out = $this->tagbuildForm(
 924                  $this->startblock.
 925                  $this->widgets(array(
 926                      'name'                  => $this->tbInput('name', $name, INPUT_REGULAR),
 927                      'link_to_this_category' => $this->tbYesNoPop('link', $link),
 928                      'title'                 => $this->tbYesNoPop('title', $title),
 929                      'type'                  => $this->tbTypePop($type),
 930                      'url'                   => $this->tbYesNoPop('url', $url),
 931                      'wraptag'               => $this->tbInput('wraptag', $wraptag),
 932                      'class'                 => $this->tbInput('class', $class, INPUT_REGULAR),
 933                  )).
 934                  $this->endform
 935              ).
 936              $this->build($atts);
 937  
 938          return $out;
 939      }
 940  
 941      /**
 942       * Tag builder &lt;txp:category_list&gt; tag.
 943       */
 944  
 945      function tag_category_list()
 946      {
 947          $atts = gpsa(array(
 948              'active_class',
 949              'break',
 950              'categories',
 951              'class',
 952              'exclude',
 953              'label',
 954              'labeltag',
 955              'parent',
 956              'section',
 957              'sort',
 958              'this_section',
 959              'type',
 960              'wraptag',
 961          ));
 962  
 963          if (!isset($_POST['label'])) {
 964              $atts['label'] = gTxt('categories');
 965          }
 966  
 967          extract($atts);
 968  
 969          $out = $this->tagbuildForm(
 970                  $this->startblock.
 971                  $this->widgets(array(
 972                      'type'                  => $this->tbTypePop($type),
 973                      'parent'                => $this->tbInput('parent', $parent, INPUT_REGULAR),
 974                      'categories'            => $this->tbInput('categories', $categories, INPUT_REGULAR),
 975                      'exclude'               => $this->tbInput('exclude', $exclude, INPUT_REGULAR),
 976                      'this_section'          => $this->tbYesNoPop('this_section', $this_section),
 977                      'category_list_section' => $this->tbSectionPop('section', $section),
 978                      'sort'                  => $this->tbListSortPop($sort),
 979                      'label'                 => $this->tbInput('label', $label, INPUT_REGULAR),
 980                      'labeltag'              => $this->tbInput('labeltag', $labeltag),
 981                      'wraptag'               => $this->tbInput('wraptag', $wraptag),
 982                      'class'                 => $this->tbInput('class', $class, INPUT_REGULAR),
 983                      'active_class'          => $this->tbInput('active_class', $active_class, INPUT_REGULAR),
 984                      'break'                 => $this->tbInput('break', $break),
 985                  )).
 986                  $this->endform
 987              ).
 988              $this->build($atts);
 989  
 990          return $out;
 991      }
 992  
 993      /**
 994       * Tag builder &lt;txp:category1&gt; tag.
 995       */
 996  
 997      function tag_category1()
 998      {
 999          $atts = gpsa(array(
1000              'class',
1001              'link',
1002              'title',
1003              'section',
1004              'this_section',
1005              'wraptag',
1006          ));
1007  
1008          extract($atts);
1009  
1010          $out = $this->tagbuildForm(
1011                  $this->startblock.
1012                  $this->widgets(array(
1013                      'title'                 => $this->tbYesNoPop('title', $title),
1014                      'link_to_this_category' => $this->tbYesNoPop('link', $link),
1015                      'section'               => $this->tbSectionPop('section', $section),
1016                      'this_section'          => $this->tbYesNoPop('this_section', $this_section),
1017                      'wraptag'               => $this->tbInput('wraptag', $wraptag),
1018                      'class'                 => $this->tbInput('class', $class, INPUT_REGULAR),
1019                  )).
1020                  $this->endform
1021              ).
1022              $this->build($atts);
1023  
1024          return $out;
1025      }
1026  
1027      /**
1028       * Tag builder &lt;txp:category2&gt; tag.
1029       */
1030  
1031      function tag_category2()
1032      {
1033          $atts = gpsa(array(
1034              'class',
1035              'link',
1036              'title',
1037              'section',
1038              'this_section',
1039              'wraptag',
1040          ));
1041  
1042          extract($atts);
1043  
1044          $out = $this->tagbuildForm(
1045                  $this->startblock.
1046                  $this->widgets(array(
1047                      'title'                 => $this->tbYesNoPop('title', $title),
1048                      'link_to_this_category' => $this->tbYesNoPop('link', $link),
1049                      'section'               => $this->tbSectionPop('section', $section),
1050                      'this_section'          => $this->tbYesNoPop('this_section', $this_section),
1051                      'wraptag'               => $this->tbInput('wraptag', $wraptag),
1052                      'class'                 => $this->tbInput('class', $class, INPUT_REGULAR),
1053                  )).
1054                  $this->endform
1055              ).
1056              $this->build($atts);
1057  
1058          return $out;
1059      }
1060  
1061      /**
1062       * Tag builder &lt;txp:comment_email&gt; tag.
1063       */
1064  
1065      function tag_comment_email()
1066      {
1067          return $this->tbNoAtts();
1068      }
1069  
1070      /**
1071       * Tag builder &lt;txp:comment_email_input&gt; tag.
1072       */
1073  
1074      function tag_comment_email_input()
1075      {
1076          $atts = gpsa(array(
1077              'size',
1078          ));
1079  
1080          extract($atts);
1081  
1082          $out = $this->tagbuildForm(
1083                  $this->startblock.
1084                  $this->widgets(array(
1085                      'input_size' => $this->tbInput('size', $size, INPUT_TINY),
1086                  )).
1087                  $this->endform
1088              ).
1089              $this->build($atts);
1090  
1091          return $out;
1092      }
1093  
1094      /**
1095       * Tag builder &lt;txp:comment_message&gt; tag.
1096       */
1097  
1098      function tag_comment_message()
1099      {
1100          return $this->tbNoAtts();
1101      }
1102  
1103      /**
1104       * Tag builder &lt;txp:comment_message_input&gt; tag.
1105       */
1106  
1107      function tag_comment_message_input()
1108      {
1109          $atts = gpsa(array(
1110              'cols',
1111              'rows',
1112          ));
1113  
1114          extract($atts);
1115  
1116          $out = $this->tagbuildForm(
1117                  $this->startblock.
1118                  $this->widgets(array(
1119                      'msgcols' => $this->tbInput('cols', $cols, INPUT_TINY),
1120                      'msgrows' => $this->tbInput('rows', $rows, INPUT_TINY),
1121                  )).
1122                  $this->endform
1123              ).
1124              $this->build($atts);
1125  
1126          return $out;
1127      }
1128  
1129      /**
1130       * Tag builder &lt;txp:comment_name&gt; tag.
1131       */
1132  
1133      function tag_comment_name()
1134      {
1135          $atts = gpsa(array(
1136              'link',
1137          ));
1138  
1139          extract($atts);
1140  
1141          $out = $this->tagbuildForm(
1142                  $this->startblock.
1143                  $this->widget('comment_name_link', $this->tbYesNoPop('link', $link)).
1144                  $this->endform
1145              ).
1146              $this->build($atts);
1147  
1148          return $out;
1149      }
1150  
1151      /**
1152       * Tag builder &lt;txp:comment_name_input&gt; tag.
1153       */
1154  
1155      function tag_comment_name_input()
1156      {
1157          $atts = gpsa(array(
1158              'size',
1159          ));
1160  
1161          extract($atts);
1162  
1163          $out = $this->tagbuildForm(
1164                  $this->startblock.
1165                  $this->widgets(array(
1166                      'input_size' => $this->tbInput('size', $size, INPUT_TINY),
1167                  )).
1168                  $this->endform
1169              ).
1170              $this->build($atts);
1171  
1172          return $out;
1173      }
1174  
1175      /**
1176       * Tag builder &lt;txp:comment_permlink&gt; tag.
1177       */
1178  
1179      function tag_comment_permlink()
1180      {
1181          return $this->tbNoAtts();
1182      }
1183  
1184      /**
1185       * Tag builder &lt;txp:comment_preview&gt; tag.
1186       */
1187  
1188      function tag_comment_preview()
1189      {
1190          return $this->tbNoAtts();
1191      }
1192  
1193      /**
1194       * Tag builder &lt;txp:comment_remember&gt; tag.
1195       */
1196  
1197      function tag_comment_remember()
1198      {
1199          return $this->tbNoAtts();
1200      }
1201  
1202      /**
1203       * Tag builder &lt;txp:comment_submit&gt; tag.
1204       */
1205  
1206      function tag_comment_submit()
1207      {
1208          return $this->tbNoAtts();
1209      }
1210  
1211      /**
1212       * Tag builder &lt;txp:comment_time&gt; tag.
1213       */
1214  
1215      function tag_comment_time()
1216      {
1217          $atts = gpsa(array(
1218              'format',
1219              'gmt',
1220              'lang',
1221          ));
1222  
1223          extract($atts);
1224  
1225          $out = $this->tagbuildForm(
1226                  $this->startblock.
1227                  $this->widgets(array(
1228                      'time_format' => $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format'),
1229                      'gmt'         => $this->tbYesNoPop('gmt', $gmt),
1230                      'locale'      => $this->tbInput('lang', $lang, INPUT_MEDIUM, 'locale'),
1231                  )).
1232                  $this->endform
1233              ).
1234              $this->build($atts);
1235  
1236          return $out;
1237      }
1238  
1239      /**
1240       * Tag builder &lt;txp:comment_web&gt; tag.
1241       */
1242  
1243      function tag_comment_web()
1244      {
1245          return $this->tbNoAtts();
1246      }
1247  
1248      /**
1249       * Tag builder &lt;txp:comment_web_input&gt; tag.
1250       */
1251  
1252      function tag_comment_web_input()
1253      {
1254          $atts = gpsa(array(
1255              'size',
1256          ));
1257  
1258          extract($atts);
1259  
1260          $out = $this->tagbuildForm(
1261                  $this->startblock.
1262                  $this->widgets(array(
1263                      'input_size' => $this->tbInput('size', $size, INPUT_TINY),
1264                  )).
1265                  $this->endform
1266              ).
1267              $this->build($atts);
1268  
1269          return $out;
1270      }
1271  
1272      /**
1273       * Tag builder &lt;txp:comments&gt; tag.
1274       */
1275  
1276      function tag_comments()
1277      {
1278          $atts = gpsa(array(
1279              'break',
1280              'class',
1281              'form',
1282              'limit',
1283              'offset',
1284              'sort',
1285              'wraptag',
1286          ));
1287  
1288          extract($atts);
1289  
1290          $out = $this->tagbuildForm(
1291                  $this->startblock.
1292                  $this->widgets(array(
1293                      'form'    => $this->tbFormPop('form', 'comment', $form),
1294                      'sort'    => $this->tbDiscussSortPop($sort),
1295                      'limit'   => $this->tbInput('limit', $limit, INPUT_TINY),
1296                      'offset'  => $this->tbInput('offset', $offset, INPUT_TINY),
1297                      'wraptag' => $this->tbInput('wraptag', $wraptag),
1298                      'class'   => $this->tbInput('class', $class, INPUT_REGULAR),
1299                      'break'   => $this->tbInput('break', $break),
1300                  )).
1301                  $this->endform
1302              ).
1303              $this->build($atts);
1304  
1305          return $out;
1306      }
1307  
1308      /**
1309       * Tag builder &lt;txp:comments_form&gt; tag.
1310       */
1311  
1312      function tag_comments_form()
1313      {
1314          $atts = gpsa(array(
1315              'id',
1316              'form',
1317              'wraptag',
1318          ));
1319  
1320          extract($atts);
1321  
1322          $out = $this->tagbuildForm(
1323                  $this->startblock.
1324                  $this->widgets(array(
1325                      'id'      => $this->tbInput('id', $id),
1326                      'form'    => $this->tbFormPop('form', 'comment', $form),
1327                      'wraptag' => $this->tbInput('wraptag', $wraptag),
1328                  )).
1329                  $this->endform
1330              ).
1331              $this->build($atts);
1332  
1333          return $out;
1334      }
1335  
1336      /**
1337       * Tag builder &lt;txp:comments_invite&gt; tag.
1338       */
1339  
1340      function tag_comments_invite()
1341      {
1342          $atts = gpsa(array(
1343              'class',
1344              'showcount',
1345              'textonly',
1346              'wraptag',
1347          ));
1348  
1349          extract($atts);
1350  
1351          $out = $this->tagbuildForm(
1352                  $this->startblock.
1353                  $this->widgets(array(
1354                      'textonly'  => $this->tbYesNoPop('textonly', $textonly),
1355                      'showcount' => $this->tbYesNoPop('showcount', $showcount),
1356                      'wraptag'   => $this->tbInput('wraptag', $wraptag),
1357                      'class'     => $this->tbInput('class', $class, INPUT_REGULAR),
1358                  )).
1359                  $this->endform
1360              ).
1361              $this->build($atts);
1362  
1363          return $out;
1364      }
1365  
1366      /**
1367       * Tag builder &lt;txp:comments_preview&gt; tag.
1368       */
1369  
1370      function tag_comments_preview()
1371      {
1372          $atts = gpsa(array(
1373              'class',
1374              'id',
1375              'form',
1376              'wraptag',
1377          ));
1378  
1379          extract($atts);
1380  
1381          $out = $this->tagbuildForm(
1382                  $this->startblock.
1383                  $this->widgets(array(
1384                      'id'      => $this->tbInput('id', $id),
1385                      'form'    => $this->tbFormPop('form', 'comment', $form),
1386                      'wraptag' => $this->tbInput('wraptag', $wraptag),
1387                      'class'   => $this->tbInput('class', $class, INPUT_REGULAR),
1388                  )).
1389                  $this->endform
1390              ).
1391              $this->build($atts);
1392  
1393          return $out;
1394      }
1395  
1396      /**
1397       * Tag builder &lt;txp:css&gt; tag.
1398       */
1399  
1400      function tag_css()
1401      {
1402          $atts = gpsa(array(
1403              'format',
1404              'media',
1405              'name',
1406              'rel',
1407              'title',
1408          ));
1409  
1410          extract($atts);
1411  
1412          $out = $this->tagbuildForm(
1413                  $this->startblock.
1414                  $this->widgets(array(
1415                      'name'   => $this->tbCssPop($name),
1416                      'format' => $this->tbCssFormatPop($format),
1417                      'media'  => $this->tbInput('media', $media, INPUT_REGULAR),
1418                      'rel'    => $this->tbInput('rel', $rel, INPUT_REGULAR),
1419                      'title'  => $this->tbInput('title', $title, INPUT_REGULAR),
1420                  )).
1421                  $this->endform
1422              ).
1423              $this->build($atts);
1424  
1425          return $out;
1426      }
1427  
1428      /**
1429       * Tag builder &lt;txp:email&gt; tag.
1430       */
1431  
1432      function tag_email()
1433      {
1434          $atts = gpsa(array(
1435              'email',
1436              'linktext',
1437              'title',
1438          ));
1439  
1440          extract($atts);
1441  
1442          $out = $this->tagbuildForm(
1443                  $this->startblock.
1444                  $this->widgets(array(
1445                      'email_address' => $this->tbInput('email', $email, INPUT_REGULAR, 'email_address'),
1446                      'tooltip'       => $this->tbInput('title', $title, INPUT_REGULAR, 'tooltip'),
1447                      'link_text'     => $this->tbInput('linktext', $linktext, INPUT_REGULAR, 'link_text'),
1448                  )).
1449                  $this->endform
1450              ).
1451              $this->build($atts);
1452  
1453          return $out;
1454      }
1455  
1456      /**
1457       * Tag builder &lt;txp:excerpt&gt; tag.
1458       */
1459  
1460      function tag_excerpt()
1461      {
1462          return $this->tbNoAtts();
1463      }
1464  
1465      /**
1466       * Tag builder &lt;txp:feed_link&gt; tag.
1467       */
1468  
1469      function tag_feed_link()
1470      {
1471          $atts = gpsa(array(
1472              'category',
1473              'class',
1474              'flavor',
1475              'format',
1476              'label',
1477              'limit',
1478              'section',
1479              'title',
1480              'wraptag',
1481          ));
1482  
1483          extract($atts);
1484  
1485          $label = $label ? $label : 'XML';
1486  
1487          $out = $this->tagbuildForm(
1488                  $this->startblock.
1489                  $this->widgets(array(
1490                      'flavor'   => $this->tbFeedFlavorPop($flavor),
1491                      'format'   => $this->tbFeedFormatPop($format),
1492                      'section'  => $this->tbSectionPop('section', $section),
1493                      'category' => $this->tbCategoryPop($section),
1494                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
1495                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
1496                      'title'    => $this->tbInput('title', $title, INPUT_REGULAR),
1497                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
1498                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
1499                  )).
1500                  $this->endform
1501              ).
1502              $this->build($atts);
1503  
1504          return $out;
1505      }
1506  
1507      /**
1508       * Tag builder &lt;txp:file_download&gt; tag.
1509       */
1510  
1511      function tag_file_download()
1512      {
1513          $atts = gpsa(array(
1514              'form',
1515              'id',
1516          ));
1517  
1518          extract($atts);
1519  
1520          $out = $this->tagbuildForm(
1521                  $this->startblock.
1522                  $this->widgets(array(
1523                      'id'   => $this->tbInput('id', $id),
1524                      'form' => $this->tbFormPop('form', 'file', $form),
1525                  )).
1526                  $this->endform
1527              ).
1528              $this->build($atts);
1529  
1530          return $out;
1531      }
1532  
1533      /**
1534       * Tag builder &lt;txp:file_download_category&gt; tag.
1535       */
1536  
1537      function tag_file_download_category()
1538      {
1539          $atts = gpsa(array(
1540              'class',
1541              'escape',
1542              'wraptag',
1543          ));
1544  
1545          extract($atts);
1546  
1547          $out = $this->tagbuildForm(
1548                  $this->startblock.
1549                  $this->widgets(array(
1550                      'escape'  => $this->tbEscapePop($escape),
1551                      'wraptag' => $this->tbInput('wraptag', $wraptag),
1552                      'class'   => $this->tbInput('class', $class, INPUT_REGULAR),
1553                  )).
1554                  $this->endform
1555              ).
1556              $this->build($atts);
1557  
1558          return $out;
1559      }
1560  
1561      /**
1562       * Tag builder &lt;txp:file_download_created&gt; tag.
1563       */
1564  
1565      function tag_file_download_created()
1566      {
1567          $atts = gpsa(array(
1568              'format',
1569          ));
1570  
1571          extract($atts);
1572  
1573          $out = $this->tagbuildForm(
1574                  $this->startblock.
1575                  $this->widget('time_format', $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format')).
1576                  $this->endform
1577              ).
1578              $this->build($atts);
1579  
1580          return $out;
1581      }
1582  
1583      /**
1584       * Tag builder &lt;txp:file_download_description&gt; tag.
1585       */
1586  
1587      function tag_file_download_description()
1588      {
1589          $atts = gpsa(array(
1590              'class',
1591              'escape',
1592              'wraptag',
1593          ));
1594  
1595          extract($atts);
1596  
1597          $out = $this->tagbuildForm(
1598                  $this->startblock.
1599                  $this->widgets(array(
1600                      'escape'  => $this->tbEscapePop($escape),
1601                      'wraptag' => $this->tbInput('wraptag', $wraptag),
1602                      'class'   => $this->tbInput('class', $class, INPUT_REGULAR),
1603                  )).
1604                  $this->endform
1605              ).
1606              $this->build($atts);
1607  
1608          return $out;
1609      }
1610  
1611      /**
1612       * Tag builder &lt;txp:file_download_downloads&gt; tag.
1613       */
1614  
1615      function tag_file_download_downloads()
1616      {
1617          return $this->tbNoAtts();
1618      }
1619  
1620      /**
1621       * Tag builder &lt;txp:file_download_link&gt; tag.
1622       */
1623  
1624      function tag_file_download_link()
1625      {
1626          global $step, $permlink_mode;
1627  
1628          $atts = gpsa(array(
1629              'filename',
1630              'id',
1631              'linktext',
1632              'type',
1633              'description',
1634          ));
1635  
1636          if (!isset($_POST['type'])) {
1637              $atts['type'] = 'textpattern';
1638          }
1639  
1640          extract($atts);
1641  
1642          $types = array(
1643              'textile'     => 'Textile',
1644              'textpattern' => 'Textpattern',
1645              'html'        => 'HTML',
1646          );
1647  
1648          $out = $this->tagbuildForm(
1649              $this->startblock.
1650              $this->widgets(array(
1651                  'type'        => ''.selectInput('type', $types, $type, false, '', 'type'),
1652                  'id'          => $this->tbInput('id', $id),
1653                  'filename'    => $this->tbInput('filename', $filename, INPUT_REGULAR),
1654                  'link_text'   => $this->tbInput('linktext', ($linktext ? $linktext : ''), INPUT_REGULAR, 'link_text'),
1655                  'description' => '<textarea id="description" name="description" cols="'.INPUT_REGULAR.'" rows="'.TEXTAREA_HEIGHT_SMALL.'">'.$description.'</textarea>',
1656              )).
1657              $this->endform
1658          );
1659  
1660          if ($step === 'build') {
1661              $desc = str_replace('&', '&#38;', txpspecialchars($description));
1662              $urlinfo = parse_url(hu);
1663              $url = ($permlink_mode === 'messy')
1664                  ? $urlinfo['path'].'index.php?s=file_download'.($type === 'textile' ? '&' : a).'id='.$id
1665                  : $urlinfo['path'].gTxt('file_download').'/'.$id.($filename ? '/'.urlencode($filename) : '');
1666  
1667              switch ($type) {
1668                  case 'textile':
1669                      $link = ($linktext) ? $linktext : $filename;
1670                      $desc = ($desc) ? ' ('.$desc.')' : '';
1671                      $out .= $this->tdb('"'.$link.$desc.'":'.$url);
1672                      break;
1673                  case 'html':
1674                      $link = ($linktext) ? $linktext : $filename;
1675                      $desc = ($desc) ? ' title="'.$desc.'"' : '';
1676                      $out .= $this->tdb(href($link, $url, $desc));
1677                      break;
1678                  case 'textpattern':
1679                  default:
1680                      $atts = array('id' => $id);
1681                      $link = ($linktext) ? $linktext : '<txp:file_download_name />';
1682                      $out .= $this->build($atts, $link);
1683                      break;
1684              }
1685          }
1686  
1687          return $out;
1688      }
1689  
1690      /**
1691       * Tag builder &lt;txp:file_download_list&gt; tag.
1692       */
1693  
1694      function tag_file_download_list()
1695      {
1696          $atts = gpsa(array(
1697              'break',
1698              'category',
1699              'form',
1700              'label',
1701              'labeltag',
1702              'limit',
1703              'sort',
1704              'wraptag',
1705          ));
1706  
1707          $asc = ' ('.gTxt('ascending').')';
1708          $desc = ' ('.gTxt('descending').')';
1709  
1710          $sorts = array(
1711              'filename asc'   => gTxt('file_name').$asc,
1712              'filename desc'  => gTxt('file_name').$desc,
1713              'downloads asc'  => gTxt('downloads').$asc,
1714              'downloads desc' => gTxt('downloads').$desc,
1715              'rand()'         => 'Random',
1716          );
1717  
1718          extract($atts);
1719  
1720          $out = $this->tagbuildForm(
1721                  $this->startblock.
1722                  $this->widgets(array(
1723                      'category' => $this->tbCategoryPop($category, 'file'),
1724                      'sort'     => ' '.selectInput('sort', $sorts, $sort, true),
1725                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
1726                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
1727                      'labeltag' => $this->tbInput('labeltag', $labeltag),
1728                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
1729                      'break'    => $this->tbInput('break', $break),
1730                      'form'     => $this->tbFormPop('form', 'file', $form),
1731                  )).
1732                  $this->endform
1733              ).
1734              $this->build($atts);
1735  
1736          return $out;
1737      }
1738  
1739      /**
1740       * Tag builder &lt;txp:file_download_modified&gt; tag.
1741       */
1742  
1743      function tag_file_download_modified()
1744      {
1745          $atts = gpsa(array(
1746              'format',
1747          ));
1748  
1749          extract($atts);
1750  
1751          $out = $this->tagbuildForm(
1752                  $this->startblock.
1753                  $this->widget('time_format',
1754                      $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format')).
1755                  $this->endform
1756              ).
1757              $this->build($atts);
1758  
1759          return $out;
1760      }
1761  
1762      /**
1763       * Tag builder &lt;txp:file_download_name&gt; tag.
1764       */
1765  
1766      function tag_file_download_name()
1767      {
1768          return $this->tbNoAtts();
1769      }
1770  
1771      /**
1772       * Tag builder &lt;txp:file_download_size&gt; tag.
1773       */
1774  
1775      function tag_file_download_size()
1776      {
1777          $atts = gpsa(array(
1778              'decimals',
1779              'format',
1780          ));
1781  
1782          $formats = array(
1783              'b' => 'Bytes',
1784              'k' => 'Kilobytes',
1785              'm' => 'Megabytes',
1786              'g' => 'Gigabytes',
1787              't' => 'Terabytes',
1788              'p' => 'Petabytes',
1789              'e' => 'Exabytes',
1790              'z' => 'Zettabytes',
1791              'y' => 'Yottabytes',
1792          );
1793  
1794          extract($atts);
1795  
1796          $out = $this->tagbuildForm(
1797                  $this->startblock.
1798                  $this->widgets(array(
1799                      'size_format' => ' '.selectInput('format', $formats, $format, true, '', 'size_format'),
1800                      'decimals'    => $this->tbInput('decimals', $decimals, INPUT_XSMALL),
1801                  )).
1802                  $this->endform
1803              ).
1804              $this->build($atts);
1805  
1806          return $out;
1807      }
1808  
1809      /**
1810       * Tag builder &lt;txp:if_category&gt; tag.
1811       */
1812  
1813      function tag_if_category()
1814      {
1815          $atts = gpsa(array(
1816              'name',
1817              'type',
1818          ));
1819  
1820          extract($atts);
1821  
1822          $out = $this->tagbuildForm(
1823                  $this->startblock.
1824                  $this->widgets(array(
1825                      'name' => $this->tbInput('name', $name, INPUT_REGULAR),
1826                      'type' => $this->tbTypePop($type),
1827                  )).
1828                  $this->endform
1829              ).
1830              $this->build($atts, gTxt('...'));
1831  
1832          return $out;
1833      }
1834  
1835      /**
1836       * Tag builder &lt;txp:if_section&gt; tag.
1837       */
1838  
1839      function tag_if_section()
1840      {
1841          $atts = gpsa(array(
1842              'name',
1843          ));
1844  
1845          extract($atts);
1846  
1847          $out = $this->tagbuildForm(
1848                  $this->startblock.
1849                  $this->widget('name', $this->tbSectionPop('name', $this->tagname)).
1850                  $this->endform
1851              ).
1852              $this->build($atts, gTxt('...'));
1853  
1854          return $out;
1855      }
1856  
1857      /**
1858       * Tag builder &lt;txp:image&gt; tag.
1859       */
1860  
1861      function tag_image()
1862      {
1863          global $step;
1864  
1865          $atts = gpsa(array(
1866              'class',
1867              'html_id',
1868              'style',
1869              'wraptag',
1870              'alt',
1871              'caption',
1872              'h',
1873              'id',
1874              'w',
1875              'ext',
1876              'type',
1877          ));
1878  
1879          if (!isset($_POST['type'])) {
1880              $atts['type'] = 'textpattern';
1881          }
1882  
1883          extract($atts);
1884  
1885          $types = array(
1886              'textile'     => 'Textile',
1887              'textpattern' => 'Textpattern',
1888              'html'        => 'HTML',
1889          );
1890  
1891          $out = $this->tagbuildForm(
1892              $this->startblock.
1893              $this->widgets(array(
1894                  'type'         => ''.selectInput(
1895                          'type',
1896                          $types,
1897                          $type,
1898                          false,
1899                          '',
1900                          'type'
1901                      ),
1902                  'html_id'      => $this->tbInput('html_id', $html_id, INPUT_REGULAR),
1903                  'class'        => $this->tbInput('class', $class, INPUT_REGULAR),
1904                  'inline_style' => $this->tbInput('style', $style, INPUT_REGULAR, 'inline_style'),
1905                  'wraptag'      => $this->tbInput('wraptag', $wraptag),
1906              )).
1907              hInput('id', $id).
1908              hInput('ext', $ext).
1909              hInput('w', $w).
1910              hInput('h', $h).
1911              hInput('alt', $alt).
1912              hInput('caption', $caption).
1913              $this->endform
1914          );
1915  
1916          if ($step === 'build') {
1917              $url = imagesrcurl($id, $ext);
1918  
1919              switch ($type) {
1920                  case 'textile':
1921                      $alternate = ($alt) ? ' ('.$alt.')' : '';
1922                      $modifiers = '';
1923  
1924                      if ($class) {
1925                          $modifiers .= '('.$class;
1926  
1927                          if ($html_id) {
1928                              $modifiers .= '#'.$html_id;
1929                          }
1930  
1931                          $modifiers .= ')';
1932                      } elseif ($html_id) {
1933                          $modifiers .= "(#$html_id)";
1934                      }
1935  
1936                      if ($style) {
1937                          $modifiers .= '{'.$style.'}';
1938                      }
1939  
1940                      $wrap = ($wraptag) ? $wraptag.$modifiers.'. ' : '';
1941  
1942                      $out .= $this->tdb(
1943                          (($wrap) ? $wrap : '').'!'.(($wrap) ? '' : $modifiers).$url.$alternate.'!'
1944                      );
1945                      break;
1946                  case 'html':
1947                      $alternate = ' alt="'.txpspecialchars($alt).'"';
1948                      $cap = ($caption) ? ' title="'.txpspecialchars($caption).'"' : '';
1949                      $cls = ($class) ? ' class="'.$class.'"' : '';
1950                      $htmlid = ($html_id) ? ' id="'.$html_id.'"' : '';
1951                      $inlinestyle = ($style) ? ' style="'.$style.'"' : '';
1952  
1953                      $out .= $this->tdb(
1954                          ($wraptag ? "<$wraptag>" : '').
1955                          '<img src="'.$url.'" width="'.$w.'" height="'.$h.'"'.$alternate.$cap.$htmlid.$cls.$inlinestyle.' />'.
1956                          ($wraptag ? "</$wraptag>" : '')
1957                      );
1958                      break;
1959                  case 'textpattern':
1960                  default:
1961                      $atts = array(
1962                          'class'   => $class,
1963                          'html_id' => $html_id,
1964                          'id'      => $id,
1965                          'style'   => $style,
1966                          'wraptag' => $wraptag,
1967                      );
1968                      $out .= $this->build($atts);
1969                      break;
1970              }
1971          }
1972  
1973          return $out;
1974      }
1975  
1976      /**
1977       * Tag builder &lt;txp:lang&gt; tag.
1978       */
1979  
1980      function tag_lang()
1981      {
1982          return $this->tbNoAtts();
1983      }
1984  
1985      /**
1986       * Tag builder &lt;txp:link&gt; tag.
1987       */
1988  
1989      function tag_link()
1990      {
1991          $atts = gpsa(array(
1992              'id',
1993              'name',
1994              'rel',
1995          ));
1996  
1997          extract($atts);
1998  
1999          $out = $this->tagbuildForm(
2000                  $this->startblock.
2001                  $this->widgets(array(
2002                      'id'   => $this->tbInput('id', $id),
2003                      'name' => $this->tbInput('name', $name, INPUT_REGULAR),
2004                      'rel'  => $this->tbInput('rel', $rel, INPUT_REGULAR),
2005                  )).
2006                  $this->endform
2007              ).
2008              $this->build($atts);
2009  
2010          return $out;
2011      }
2012  
2013      /**
2014       * Tag builder &lt;txp:link_category&gt; tag.
2015       */
2016  
2017      function tag_link_category()
2018      {
2019          $atts = gpsa(array(
2020              'class',
2021              'label',
2022              'labeltag',
2023              'title',
2024              'wraptag',
2025          ));
2026  
2027          extract($atts);
2028  
2029          $out = $this->tagbuildForm(
2030                  $this->startblock.
2031                  $this->widgets(array(
2032                      'title'    => $this->tbYesNoPop('title', $title),
2033                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2034                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2035                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2036                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
2037                  )).
2038                  $this->endform
2039              ).
2040              $this->build($atts);
2041  
2042          return $out;
2043      }
2044  
2045      /**
2046       * Tag builder &lt;txp:link_date&gt; tag.
2047       */
2048  
2049      function tag_link_date()
2050      {
2051          $atts = gpsa(array(
2052              'format',
2053              'gmt',
2054              'lang',
2055          ));
2056  
2057          extract($atts);
2058  
2059          $out = $this->tagbuildForm(
2060                  $this->startblock.
2061                  $this->widgets(array(
2062                      'time_format' => $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format'),
2063                      'gmt'         => $this->tbYesNoPop('gmt', $gmt),
2064                      'locale'      => $this->tbInput('lang', $lang, INPUT_MEDIUM, 'locale'),
2065                  )).
2066                  $this->endform
2067              ).
2068              $this->build($atts);
2069  
2070          return $out;
2071      }
2072  
2073      /**
2074       * Tag builder &lt;txp:link_description&gt; tag.
2075       */
2076  
2077      function tag_link_description()
2078      {
2079          $atts = gpsa(array(
2080              'class',
2081              'escape',
2082              'label',
2083              'labeltag',
2084              'wraptag',
2085          ));
2086  
2087          extract($atts);
2088  
2089          $out = $this->tagbuildForm(
2090                  $this->startblock.
2091                  $this->widgets(array(
2092                      'escape'   => $this->tbEscapePop($escape),
2093                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2094                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2095                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2096                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
2097                  )).
2098                  $this->endform
2099              ).
2100              $this->build($atts);
2101  
2102          return $out;
2103      }
2104  
2105      /**
2106       * Tag builder &lt;txp:link_feed_link&gt; tag.
2107       */
2108  
2109      function tag_link_feed_link()
2110      {
2111          $atts = gpsa(array(
2112              'category',
2113              'class',
2114              'flavor',
2115              'format',
2116              'label',
2117              'limit',
2118              'title',
2119              'wraptag',
2120          ));
2121  
2122          extract($atts);
2123  
2124          $label = (!$label) ? 'XML' : $label;
2125  
2126          $out = $this->tagbuildForm(
2127                  $this->startblock.
2128                  $this->widgets(array(
2129                      'flavor'   => $this->tbFeedFlavorPop($flavor),
2130                      'format'   => $this->tbFeedFormatPop($format),
2131                      'category' => $this->tbCategoryPop($category, 'link'),
2132                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
2133                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2134                      'title'    => $this->tbInput('title', $title, INPUT_REGULAR),
2135                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2136                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
2137                  )).
2138                  $this->endform
2139              ).
2140              $this->build($atts);
2141  
2142          return $out;
2143      }
2144  
2145      /**
2146       * Tag builder &lt;txp:link_name&gt; tag.
2147       */
2148  
2149      function tag_link_name()
2150      {
2151          $atts = gpsa(array(
2152              'escape',
2153          ));
2154  
2155          extract($atts);
2156  
2157          $out = $this->tagbuildForm(
2158                  $this->startblock.
2159                  $this->widget('escape', $this->tbEscapePop($escape)).
2160                  $this->endform
2161              ).
2162              $this->build($atts);
2163  
2164          return $out;
2165      }
2166  
2167      /**
2168       * Tag builder &lt;txp:link_to_home&gt; tag.
2169       */
2170  
2171      function tag_link_to_home()
2172      {
2173          $atts = gpsa(array(
2174              'class',
2175          ));
2176  
2177          extract($atts);
2178  
2179          $linktext = isset($_POST['linktext']) ? ps('linktext') : gTxt('tag_home');
2180  
2181          $out = $this->tagbuildForm(
2182                  $this->startblock.
2183                  $this->widgets(array(
2184                      'link_text' => $this->tbInput(
2185                          'linktext',
2186                          $linktext,
2187                          INPUT_REGULAR,
2188                          'link_text'
2189                      ),
2190                      'class'     => $this->tbInput('class', $class, INPUT_REGULAR),
2191                  )).
2192                  $this->endform
2193              ).
2194              $this->build($atts, $linktext);
2195  
2196          return $out;
2197      }
2198  
2199      /**
2200       * Tag builder &lt;txp:link_to_next&gt; tag.
2201       */
2202  
2203      function tag_link_to_next()
2204      {
2205          $atts = gpsa(array(
2206              'showalways',
2207          ));
2208  
2209          extract($atts);
2210  
2211          $linktext = isset($_POST['linktext']) ? ps('linktext') : '<txp:next_title />';
2212  
2213          $out = $this->tagbuildForm(
2214                  $this->startblock.
2215                  $this->widgets(array(
2216                      'link_text'  => $this->tbInput(
2217                          'linktext',
2218                          $linktext,
2219                          INPUT_REGULAR,
2220                          'link_text'
2221                      ),
2222                      'showalways' => $this->tbYesNoPop('showalways', $showalways),
2223                  )).
2224                  $this->endform
2225              ).
2226              $this->build($atts, $linktext);
2227  
2228          return $out;
2229      }
2230  
2231      /**
2232       * Tag builder &lt;txp:link_to_prev&gt; tag.
2233       */
2234  
2235      function tag_link_to_prev()
2236      {
2237          $atts = gpsa(array(
2238              'showalways',
2239          ));
2240  
2241          extract($atts);
2242  
2243          $linktext = isset($_POST['linktext']) ? ps('linktext') : '<txp:prev_title />';
2244  
2245          $out = $this->tagbuildForm(
2246                  $this->startblock.
2247                  $this->widgets(array(
2248                      'link_text'  => $this->tbInput(
2249                          'linktext',
2250                          $linktext,
2251                          INPUT_REGULAR,
2252                          'link_text'
2253                      ),
2254                      'showalways' => $this->tbYesNoPop('showalways', $showalways),
2255                  )).
2256                  $this->endform
2257              ).
2258              $this->build($atts, $linktext);
2259  
2260          return $out;
2261      }
2262  
2263      /**
2264       * Tag builder &lt;txp:linkdesctitle&gt; tag.
2265       */
2266  
2267      function tag_linkdesctitle()
2268      {
2269          $atts = gpsa(array(
2270              'rel',
2271          ));
2272  
2273          extract($atts);
2274  
2275          $out = $this->tagbuildForm(
2276                  $this->startblock.
2277                  $this->widget('rel', $this->tbInput('rel', $rel, INPUT_REGULAR)).
2278                  $this->endform
2279              ).
2280              $this->build($atts);
2281  
2282          return $out;
2283      }
2284  
2285      /**
2286       * Tag builder &lt;txp:linklist&gt; tag.
2287       */
2288  
2289      function tag_linklist()
2290      {
2291          $atts = gpsa(array(
2292              'break',
2293              'category',
2294              'form',
2295              'label',
2296              'labeltag',
2297              'limit',
2298              'sort',
2299              'wraptag',
2300          ));
2301  
2302          $asc = ' ('.gTxt('ascending').')';
2303          $desc = ' ('.gTxt('descending').')';
2304  
2305          $sorts = array(
2306              'linksort asc'  => gTxt('name').$asc,
2307              'linksort desc' => gTxt('name').$desc,
2308              'category asc'  => gTxt('category').$asc,
2309              'category desc' => gTxt('category').$desc,
2310              'date asc'      => gTxt('date').$asc,
2311              'date desc'     => gTxt('date').$desc,
2312              'rand()'        => gTxt('random'),
2313          );
2314  
2315          extract($atts);
2316  
2317          $out = $this->tagbuildForm(
2318                  $this->startblock.
2319                  $this->widgets(array(
2320                      'category' => $this->tbCategoryPop($category, 'link'),
2321                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
2322                      'sort'     => ' '.selectInput('sort', $sorts, $sort, false, '', 'sort'),
2323                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2324                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2325                      'form'     => $this->tbFormPop('form', 'link', $form),
2326                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2327                      'break'    => $this->tbInput('break', $break),
2328                  )).
2329                  $this->endform
2330              ).
2331              $this->build($atts);
2332  
2333          return $out;
2334      }
2335  
2336      /**
2337       * Tag builder &lt;txp:newer&gt; tag.
2338       */
2339  
2340      function tag_newer()
2341      {
2342          $linktext = isset($_POST['linktext']) ? ps('linktext') : '<txp:text item="newer" />';
2343  
2344          $out = $this->tagbuildForm(
2345                  $this->startblock.
2346                  $this->widget('link_text',
2347                      $this->tbInput(
2348                          'linktext',
2349                          $linktext,
2350                          INPUT_REGULAR,
2351                          'link_text'
2352                      )).
2353                  $this->endform
2354              ).
2355              $this->build(array(), $linktext);
2356  
2357          return $out;
2358      }
2359  
2360      /**
2361       * Tag builder &lt;txp:next_title&gt; tag.
2362       */
2363  
2364      function tag_next_title()
2365      {
2366          return $this->tbNoAtts();
2367      }
2368  
2369      /**
2370       * Tag builder &lt;txp:older&gt; tag.
2371       */
2372  
2373      function tag_older()
2374      {
2375          $linktext = isset($_POST['linktext']) ? ps('linktext') : '<txp:text item="older" />';
2376  
2377          $out = $this->tagbuildForm(
2378                  $this->startblock.
2379                  $this->widget('link_text',
2380                      $this->tbInput(
2381                          'linktext',
2382                          $linktext,
2383                          INPUT_REGULAR,
2384                          'link_text'
2385                      )).
2386                  $this->endform
2387              ).
2388              $this->build(array(), $linktext);
2389  
2390          return $out;
2391      }
2392  
2393      /**
2394       * Tag builder &lt;txp:output_form&gt; tag.
2395       */
2396  
2397      function tag_output_form()
2398      {
2399          $atts = gpsa(array(
2400              'form',
2401          ));
2402  
2403          extract($atts);
2404  
2405          $out = $this->tagbuildForm(
2406                  $this->startblock.
2407                  $this->widget('form', $this->tbFormPop('form', 'misc', $form)).
2408                  $this->endform
2409              ).
2410              $this->build($atts);
2411  
2412          return $out;
2413      }
2414  
2415      /**
2416       * Tag builder &lt;txp:page_title&gt; tag.
2417       */
2418  
2419      function tag_page_title()
2420      {
2421          $atts = gpsa(array(
2422              'separator',
2423          ));
2424  
2425          extract($atts);
2426  
2427          $out = $this->tagbuildForm(
2428                  $this->startblock.
2429                  $this->widget('title_separator',
2430                      $this->tbInput('separator', $separator, INPUT_XSMALL, 'title_separator')).
2431                  $this->endform
2432              ).
2433              $this->build($atts);
2434  
2435          return $out;
2436      }
2437  
2438      /**
2439       * Tag builder &lt;txp:password_protect&gt; tag.
2440       */
2441  
2442      function tag_password_protect()
2443      {
2444          $atts = gpsa(array(
2445              'login',
2446              'pass',
2447          ));
2448  
2449          extract($atts);
2450  
2451          $out = $this->tagbuildForm(
2452                  $this->startblock.
2453                  $this->widgets(array(
2454                      'login'    => $this->tbInput('login', $login, INPUT_REGULAR),
2455                      'password' => $this->tbInput('pass', $pass, INPUT_REGULAR, 'password'),
2456                  )).
2457                  $this->endform
2458              ).
2459              $this->build($atts);
2460  
2461          return $out;
2462      }
2463  
2464      /**
2465       * Tag builder &lt;txp:permlink&gt; tag.
2466       */
2467  
2468      function tag_permlink()
2469      {
2470          $atts = gpsa(array(
2471              'class',
2472              'id',
2473              'style',
2474              'title',
2475          ));
2476  
2477          extract($atts);
2478  
2479          $linktext = isset($_POST['linktext']) ? ps('linktext') : '<txp:title />';
2480  
2481          $out = $this->tagbuildForm(
2482                  $this->startblock.
2483                  $this->widgets(array(
2484                      'id'           => $this->tbInput('id', $id),
2485                      'link_text'    => $this->tbInput(
2486                          'linktext',
2487                          $linktext,
2488                          INPUT_REGULAR,
2489                          'link_text'
2490                      ),
2491                      'title'        => $this->tbInput('title', $title, INPUT_REGULAR),
2492                      'class'        => $this->tbInput('class', $class, INPUT_REGULAR),
2493                      'inline_style' => $this->tbInput('style', $style, INPUT_REGULAR, 'inline_style'),
2494                  )).
2495                  $this->endform
2496              ).
2497              $this->build($atts, $linktext);
2498  
2499          return $out;
2500      }
2501  
2502      /**
2503       * Tag builder &lt;txp:popup&gt; tag.
2504       */
2505  
2506      function tag_popup()
2507      {
2508          $atts = gpsa(array(
2509              'class',
2510              'label',
2511              'section',
2512              'this_section',
2513              'type',
2514              'wraptag',
2515          ));
2516          
2517          if (!isset($_POST['label'])) {
2518              $atts['label'] = gTxt('browse');
2519          }
2520  
2521          extract($atts);
2522  
2523          $types = array(
2524              'c' => gTxt('Category'),
2525              's' => gTxt('Section'),
2526          );
2527  
2528          $out = $this->tagbuildForm(
2529                  $this->startblock.
2530                  $this->widgets(array(
2531                      'type'         => ' '.selectInput('type', $types, $type, true, '', 'type'),
2532                      'section'      => $this->tbSectionPop('section', $section),
2533                      'this_section' => $this->tbYesNoPop('this_section', $this_section),
2534                      'label'        => $this->tbInput('label', $label, INPUT_REGULAR),
2535                      'wraptag'      => $this->tbInput('wraptag', $wraptag),
2536                      'class'        => $this->tbInput('class', $class, INPUT_REGULAR),
2537                  )).
2538                  $this->endform
2539              ).
2540              $this->build($atts);
2541  
2542          return $out;
2543      }
2544  
2545      /**
2546       * Tag builder &lt;txp:posted&gt; tag.
2547       */
2548  
2549      function tag_posted()
2550      {
2551          $atts = gpsa(array(
2552              'format',
2553              'gmt',
2554              'lang',
2555          ));
2556  
2557          extract($atts);
2558  
2559          $out = $this->tagbuildForm(
2560                  $this->startblock.
2561                  $this->widgets(array(
2562                      'time_format' => $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format'),
2563                      'gmt'         => $this->tbYesNoPop('gmt', $gmt),
2564                      'locale'      => $this->tbInput('lang', $lang, INPUT_MEDIUM, 'locale'),
2565                  )).
2566                  $this->endform
2567              ).
2568              $this->build($atts);
2569  
2570          return $out;
2571      }
2572  
2573      /**
2574       * Tag builder &lt;txp:prev_title&gt; tag.
2575       */
2576  
2577      function tag_prev_title()
2578      {
2579          return $this->tbNoAtts();
2580      }
2581  
2582      /**
2583       * Tag builder &lt;txp:recent_articles&gt; tag.
2584       */
2585  
2586      function tag_recent_articles()
2587      {
2588          $atts = gpsa(array(
2589              'break',
2590              'category',
2591              'label',
2592              'labeltag',
2593              'limit',
2594              'section',
2595              'sort',
2596              'wraptag',
2597          ));
2598  
2599          if (!isset($_POST['label'])) {
2600              $atts['label'] = gTxt('recent_articles');
2601          }
2602  
2603          extract($atts);
2604  
2605          $out = $this->tagbuildForm(
2606                  $this->startblock.
2607                  $this->widgets(array(
2608                      'section'  => $this->tbSectionPop('section', $section),
2609                      'category' => $this->tbCategoryPop($category),
2610                      'sort'     => $this->tbSortPop($sort),
2611                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
2612                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2613                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2614                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2615                      'break'    => $this->tbInput('break', $break),
2616                  )).
2617                  $this->endform
2618              ).
2619              $this->build($atts);
2620  
2621          return $out;
2622      }
2623  
2624      /**
2625       * Tag builder &lt;txp:recent_comments&gt; tag.
2626       */
2627  
2628      function tag_recent_comments()
2629      {
2630          $atts = gpsa(array(
2631              'break',
2632              'class',
2633              'label',
2634              'labeltag',
2635              'limit',
2636              'sort',
2637              'wraptag',
2638          ));
2639  
2640          if (!isset($_POST['label'])) {
2641              $atts['label'] = gTxt('recent_comments');
2642          }
2643  
2644          extract($atts);
2645  
2646          $out = $this->tagbuildForm(
2647                  $this->startblock.
2648                  $this->widgets(array(
2649                      'sort'     => $this->tbDiscussSortPop($sort),
2650                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
2651                      'label'    => $this->tbInput('label', ($label ? $label : gTxt('recent_comments')), INPUT_REGULAR),
2652                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2653                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2654                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
2655                      'break'    => $this->tbInput('break', $break),
2656                  )).
2657                  $this->endform
2658              ).
2659              $this->build($atts);
2660  
2661          return $out;
2662      }
2663  
2664      /**
2665       * Tag builder &lt;txp:related_articles&gt; tag.
2666       */
2667  
2668      function tag_related_articles()
2669      {
2670          $atts = gpsa(array(
2671              'break',
2672              'class',
2673              'label',
2674              'labeltag',
2675              'limit',
2676              'match',
2677              'section',
2678              'sort',
2679              'wraptag',
2680          ));
2681  
2682          if (!isset($_POST['label'])) {
2683              $atts['label'] = gTxt('tag_related_articles');
2684          }
2685  
2686          extract($atts);
2687  
2688          $out = $this->tagbuildForm(
2689                  $this->startblock.
2690                  $this->widgets(array(
2691                      'section'  => $this->tbSectionPop('section', $section),
2692                      'match'    => $this->tbMatchCatPop($match),
2693                      'sort'     => $this->tbSortPop($sort),
2694                      'limit'    => $this->tbInput('limit', $limit, INPUT_TINY),
2695                      'label'    => $this->tbInput('label', $label, INPUT_REGULAR),
2696                      'labeltag' => $this->tbInput('labeltag', $labeltag),
2697                      'wraptag'  => $this->tbInput('wraptag', $wraptag),
2698                      'class'    => $this->tbInput('class', $class, INPUT_REGULAR),
2699                      'break'    => $this->tbInput('break', $break),
2700                  )).
2701                  $this->endform
2702              ).
2703              $this->build($atts);
2704  
2705          return $out;
2706      }
2707  
2708      /**
2709       * Tag builder &lt;txp:search_input&gt; tag.
2710       */
2711  
2712      function tag_search_input()
2713      {
2714          $atts = gpsa(array(
2715              'button',
2716              'class',
2717              'form',
2718              'label',
2719              'match',
2720              'section',
2721              'size',
2722              'wraptag',
2723          ));
2724  
2725          if (!isset($_POST['label'])) {
2726              $atts['label'] = gTxt('search');
2727          }
2728  
2729          extract($atts);
2730  
2731          $out = $this->tagbuildForm(
2732                  $this->startblock.
2733                  $this->widgets(array(
2734                      'match_type'  => $this->tbPatternPop($match),
2735                      'section'     => $this->tbSectionPop('section', $section),
2736                      'button_text' => $this->tbInput('button', $button, INPUT_REGULAR, 'button_text'),
2737                      'input_size'  => $this->tbInput('size', $size, INPUT_TINY, 'input_size'),
2738                      'label'       => $this->tbInput('label', $label, INPUT_REGULAR),
2739                      'wraptag'     => $this->tbInput('wraptag', $wraptag),
2740                      'class'       => $this->tbInput('class', $class, INPUT_REGULAR),
2741                      'form'        => $this->tbFormPop('form', 'misc', $form),
2742                  )).
2743                  $this->endform
2744              ).
2745              $this->build($atts);
2746  
2747          return $out;
2748      }
2749  
2750      /**
2751       * Tag builder &lt;txp:search_result_date&gt; tag.
2752       */
2753  
2754      function tag_search_result_date()
2755      {
2756          $atts = gpsa(array(
2757              'format',
2758              'gmt',
2759              'lang',
2760          ));
2761  
2762          extract($atts);
2763  
2764          $out = $this->tagbuildForm(
2765                  $this->startblock.
2766                  $this->widgets(array(
2767                      'time_format' => $this->tbInput('format', $format, INPUT_MEDIUM, 'time_format'),
2768                      'gmt'         => $this->tbYesNoPop('gmt', $gmt),
2769                      'locale'      => $this->tbInput('lang', $lang, INPUT_MEDIUM, 'locale'),
2770                  )).
2771                  $this->endform
2772              ).
2773              $this->build($atts);
2774  
2775          return $out;
2776      }
2777  
2778      /**
2779       * Tag builder &lt;txp:search_result_excerpt&gt; tag.
2780       */
2781  
2782      function tag_search_result_excerpt()
2783      {
2784          $atts = gpsa(array(
2785              'hilight',
2786              'limit',
2787          ));
2788  
2789          extract($atts);
2790  
2791          $out = $this->tagbuildForm(
2792                  $this->startblock.
2793                  $this->widgets(array(
2794                      'hilight'       => $this->tbInput('hilight', $hilight),
2795                      'hilight_limit' => $this->tbInput('limit', $limit, INPUT_TINY, 'hilight_limit'),
2796                  )).
2797                  $this->endform
2798              ).
2799              $this->build($atts);
2800  
2801          return $out;
2802      }
2803  
2804      /**
2805       * Tag builder &lt;txp:search_result_title&gt; tag.
2806       */
2807  
2808      function tag_search_result_title()
2809      {
2810          return $this->tbNoAtts();
2811      }
2812  
2813      /**
2814       * Tag builder &lt;txp:search_result_url&gt; tag.
2815       */
2816  
2817      function tag_search_result_url()
2818      {
2819          return $this->tbNoAtts();
2820      }
2821  
2822      /**
2823       * Tag builder &lt;txp:section&gt; tag.
2824       */
2825  
2826      function tag_section()
2827      {
2828          $atts = gpsa(array(
2829              'class',
2830              'link',
2831              'name',
2832              'title',
2833              'url',
2834              'wraptag',
2835          ));
2836  
2837          extract($atts);
2838  
2839          $out = $this->tagbuildForm(
2840                  $this->startblock.
2841                  $this->widgets(array(
2842                      'name'                 => $this->tbSectionPop('name', $this->tagname),
2843                      'link_to_this_section' => $this->tbYesNoPop('link', $link),
2844                      'url_only'             => $this->tbYesNoPop('url', $url),
2845                      'wraptag'              => $this->tbInput('wraptag', $wraptag),
2846                      'class'                => $this->tbInput('class', $class, INPUT_REGULAR),
2847                  )).
2848                  $this->endform
2849              ).
2850              $this->build($atts);
2851  
2852          return $out;
2853      }
2854  
2855      /**
2856       * Tag builder &lt;txp:section_list&gt; tag.
2857       */
2858  
2859      function tag_section_list()
2860      {
2861          $atts = gpsa(array(
2862              'active_class',
2863              'break',
2864              'class',
2865              'default_title',
2866              'exclude',
2867              'include_default',
2868              'label',
2869              'labeltag',
2870              'sections',
2871              'sort',
2872              'wraptag',
2873          ));
2874  
2875          extract($atts);
2876  
2877          $out = $this->tagbuildForm(
2878                  $this->startblock.
2879                  $this->widgets(array(
2880                      'include_default' => $this->tbYesNoPop('include_default', $include_default),
2881                      'sort'            => $this->tbListSortPop($sort),
2882                      'default_title'   => $this->tbInput('default_title', $default_title, INPUT_REGULAR),
2883                      'sections'        => $this->tbInput('sections', $sections, INPUT_REGULAR),
2884                      'exclude'         => $this->tbInput('exclude', $exclude, INPUT_REGULAR),
2885                      'label'           => $this->tbInput('label', $label, INPUT_REGULAR),
2886                      'labeltag'        => $this->tbInput('labeltag', $labeltag),
2887                      'wraptag'         => $this->tbInput('wraptag', $wraptag),
2888                      'class'           => $this->tbInput('class', $class, INPUT_REGULAR),
2889                      'active_class'    => $this->tbInput('active_class', $active_class, INPUT_REGULAR),
2890                      'break'           => $this->tbInput('break', $break),
2891                  )).
2892                  $this->endform
2893              ).
2894              $this->build($atts);
2895  
2896          return $out;
2897      }
2898  
2899      /**
2900       * Tag builder &lt;txp:site_name&gt; tag.
2901       */
2902  
2903      function tag_site_name()
2904      {
2905          return $this->tbNoAtts();
2906      }
2907  
2908      /**
2909       * Tag builder &lt;txp:site_slogan&gt; tag.
2910       */
2911  
2912      function tag_site_slogan()
2913      {
2914          return $this->tbNoAtts();
2915      }
2916  
2917      /**
2918       * Tag builder &lt;txp:title&gt; tag.
2919       */
2920  
2921      function tag_title()
2922      {
2923          return $this->tbNoAtts();
2924      }
2925  }

title

Description

title

Description

title

Description

title

title

Body