--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2013 Emanuil Rusev, erusev.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
--- /dev/null
+<?php
+
+#
+#
+# Parsedown
+# http://parsedown.org
+#
+# (c) Emanuil Rusev
+# http://erusev.com
+#
+# For the full license information, view the LICENSE file that was distributed
+# with this source code.
+#
+#
+
+class Parsedown
+{
+ # Multiton
+
+ static function instance($name = 'default')
+ {
+ if (isset(self::$instances[$name]))
+ {
+ return self::$instances[$name];
+ }
+
+ $instance = new Parsedown();
+
+ self::$instances[$name] = $instance;
+
+ return $instance;
+ }
+
+ private static $instances = array();
+
+ #
+ # Setters
+ #
+
+ # Enables GFM line breaks.
+
+ function set_breaks_enabled($breaks_enabled)
+ {
+ $this->breaks_enabled = $breaks_enabled;
+
+ return $this;
+ }
+
+ private $breaks_enabled = false;
+
+ #
+ # Synopsis
+ #
+
+ # Markdown is intended to be easy-to-read by humans - those of us who read
+ # line by line, left to right, top to bottom. In order to take advantage of
+ # this, Parsedown tries to read in a similar way. It breaks texts into
+ # lines, it iterates through them and it looks at how they start and relate
+ # to each other.
+
+ #
+ # Methods
+ #
+
+ function parse($text)
+ {
+ # standardize line breaks
+ $text = str_replace("\r\n", "\n", $text);
+ $text = str_replace("\r", "\n", $text);
+
+ # replace tabs with spaces
+ $text = str_replace("\t", ' ', $text);
+
+ # remove surrounding line breaks
+ $text = trim($text, "\n");
+
+ # split text into lines
+ $lines = explode("\n", $text);
+
+ # convert lines into html
+ $text = $this->parse_block_elements($lines);
+
+ # remove trailing line breaks
+ $text = chop($text, "\n");
+
+ return $text;
+ }
+
+ #
+ # Private
+
+ private function parse_block_elements(array $lines, $context = '')
+ {
+ $blocks = array();
+
+ $block = array(
+ 'type' => '',
+ );
+
+ foreach ($lines as $line)
+ {
+ # context
+
+ switch ($block['type'])
+ {
+ case 'fenced':
+
+ if ( ! isset($block['closed']))
+ {
+ if (preg_match('/^[ ]*'.$block['fence'][0].'{3,}[ ]*$/', $line))
+ {
+ $block['closed'] = true;
+ }
+ else
+ {
+ if ($block['text'] !== '')
+ {
+ $block['text'] .= "\n";
+ }
+
+ $block['text'] .= $line;
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case 'markup':
+
+ if ( ! isset($block['closed']))
+ {
+ if (strpos($line, $block['start']) !== false) # opening tag
+ {
+ $block['depth']++;
+ }
+
+ if (strpos($line, $block['end']) !== false) # closing tag
+ {
+ if ($block['depth'] > 0)
+ {
+ $block['depth']--;
+ }
+ else
+ {
+ $block['closed'] = true;
+ }
+ }
+
+ $block['text'] .= "\n".$line;
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # ~
+
+ $indentation = 0;
+
+ while(isset($line[$indentation]) and $line[$indentation] === ' ')
+ {
+ $indentation++;
+ }
+
+ $outdented_line = $indentation > 0 ? ltrim($line) : $line;
+
+ # blank
+
+ if ($outdented_line === '')
+ {
+ $block['interrupted'] = true;
+
+ continue;
+ }
+
+ # context
+
+ switch ($block['type'])
+ {
+ case 'quote':
+
+ if ( ! isset($block['interrupted']))
+ {
+ $line = preg_replace('/^[ ]*>[ ]?/', '', $line);
+
+ $block['lines'] []= $line;
+
+ continue 2;
+ }
+
+ break;
+
+ case 'li':
+
+ if ($block['indentation'] === $indentation and preg_match('/^'.$block['marker'].'[ ]+(.*)/', $outdented_line, $matches))
+ {
+ unset($block['last']);
+
+ $blocks []= $block;
+
+ $block['last'] = true;
+ $block['lines'] = array($matches[1]);
+
+ unset($block['first']);
+ unset($block['interrupted']);
+
+ continue 2;
+ }
+
+ if ( ! isset($block['interrupted']))
+ {
+ $line = preg_replace('/^[ ]{0,'.$block['baseline'].'}/', '', $line);
+
+ $block['lines'] []= $line;
+
+ continue 2;
+ }
+ elseif ($line[0] === ' ')
+ {
+ $block['lines'] []= '';
+
+ $line = preg_replace('/^[ ]{0,'.$block['baseline'].'}/', '', $line);
+
+ $block['lines'] []= $line;
+
+ unset($block['interrupted']);
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # indentation sensitive types
+
+ switch ($line[0])
+ {
+ case ' ':
+
+ # code
+
+ if ($indentation >= 4)
+ {
+ $code_line = substr($line, 4);
+
+ if ($block['type'] === 'code')
+ {
+ if (isset($block['interrupted']))
+ {
+ $block['text'] .= "\n";
+
+ unset($block['interrupted']);
+ }
+
+ $block['text'] .= "\n".$code_line;
+ }
+ else
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'code',
+ 'text' => $code_line,
+ );
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '#':
+
+ # atx heading (#)
+
+ if (isset($line[1]))
+ {
+ $blocks []= $block;
+
+ $level = 1;
+
+ while (isset($line[$level]) and $line[$level] === '#')
+ {
+ $level++;
+ }
+
+ $block = array(
+ 'type' => 'heading',
+ 'text' => trim($line, '# '),
+ 'level' => $level,
+ );
+
+ continue 2;
+ }
+
+ break;
+
+ case '-':
+ case '=':
+
+ # setext heading (===)
+
+ if ($block['type'] === 'paragraph' and isset($block['interrupted']) === false)
+ {
+ $chopped_line = chop($line);
+
+ $i = 1;
+
+ while (isset($chopped_line[$i]))
+ {
+ if ($chopped_line[$i] !== $line[0])
+ {
+ break 2;
+ }
+
+ $i++;
+ }
+
+ $block['type'] = 'heading';
+
+ $block['level'] = $line[0] === '-' ? 2 : 1;
+
+ continue 2;
+ }
+
+ break;
+ }
+
+ # indentation insensitive types
+
+ switch ($outdented_line[0])
+ {
+ case '<':
+
+ $position = strpos($outdented_line, '>');
+
+ if ($position > 1)
+ {
+ $substring = substr($outdented_line, 1, $position - 1);
+
+ $substring = chop($substring);
+
+ if (substr($substring, -1) === '/')
+ {
+ $is_self_closing = true;
+
+ $substring = substr($substring, 0, -1);
+ }
+
+ $position = strpos($substring, ' ');
+
+ if ($position)
+ {
+ $name = substr($substring, 0, $position);
+ }
+ else
+ {
+ $name = $substring;
+ }
+
+ if ( ! ctype_alpha($name))
+ {
+ break;
+ }
+
+ if (in_array($name, self::$text_level_elements))
+ {
+ break;
+ }
+
+ $blocks []= $block;
+
+ if (isset($is_self_closing))
+ {
+ $block = array(
+ 'type' => 'self-closing tag',
+ 'text' => $outdented_line,
+ );
+
+ unset($is_self_closing);
+
+ continue 2;
+ }
+
+ $block = array(
+ 'type' => 'markup',
+ 'text' => $outdented_line,
+ 'start' => '<'.$name.'>',
+ 'end' => '</'.$name.'>',
+ 'depth' => 0,
+ );
+
+ if (strpos($outdented_line, $block['end']))
+ {
+ $block['closed'] = true;
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '>':
+
+ # quote
+
+ if (preg_match('/^>[ ]?(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'quote',
+ 'lines' => array(
+ $matches[1],
+ ),
+ );
+
+ continue 2;
+ }
+
+ break;
+
+ case '[':
+
+ # reference
+
+ $position = strpos($outdented_line, ']:');
+
+ if ($position)
+ {
+ $reference = array();
+
+ $label = substr($outdented_line, 1, $position - 1);
+ $label = strtolower($label);
+
+ $substring = substr($outdented_line, $position + 2);
+ $substring = trim($substring);
+
+ if ($substring === '')
+ {
+ break;
+ }
+
+ if ($substring[0] === '<')
+ {
+ $position = strpos($substring, '>');
+
+ if ($position === false)
+ {
+ break;
+ }
+
+ $reference['»'] = substr($substring, 1, $position - 1);
+
+ $substring = substr($substring, $position + 1);
+ }
+ else
+ {
+ $position = strpos($substring, ' ');
+
+ if ($position === false)
+ {
+ $reference['»'] = $substring;
+
+ $substring = false;
+ }
+ else
+ {
+ $reference['»'] = substr($substring, 0, $position);
+
+ $substring = substr($substring, $position + 1);
+ }
+ }
+
+ if ($substring !== false)
+ {
+ if ($substring[0] !== '"' and $substring[0] !== "'" and $substring[0] !== '(')
+ {
+ break;
+ }
+
+ $last_char = substr($substring, -1);
+
+ if ($last_char !== '"' and $last_char !== "'" and $last_char !== ')')
+ {
+ break;
+ }
+
+ $reference['#'] = substr($substring, 1, -1);
+ }
+
+ $this->reference_map[$label] = $reference;
+
+ continue 2;
+ }
+
+ break;
+
+ case '`':
+ case '~':
+
+ # fenced code block
+
+ if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\S+)?[ ]*$/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'fenced',
+ 'text' => '',
+ 'fence' => $matches[1],
+ );
+
+ if (isset($matches[2]))
+ {
+ $block['language'] = $matches[2];
+ }
+
+ continue 2;
+ }
+
+ break;
+
+ case '*':
+ case '+':
+ case '-':
+ case '_':
+
+ # hr
+
+ if (preg_match('/^([-*_])([ ]{0,2}\1){2,}[ ]*$/', $outdented_line))
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'rule',
+ );
+
+ continue 2;
+ }
+
+ # li
+
+ if (preg_match('/^([*+-][ ]+)(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $baseline = $indentation + strlen($matches[1]);
+
+ $block = array(
+ 'type' => 'li',
+ 'indentation' => $indentation,
+ 'baseline' => $baseline,
+ 'marker' => '[*+-]',
+ 'first' => true,
+ 'last' => true,
+ 'lines' => array(),
+ );
+
+ $block['lines'] []= preg_replace('/^[ ]{0,4}/', '', $matches[2]);
+
+ continue 2;
+ }
+ }
+
+ # li
+
+ if ($outdented_line[0] <= '9' and preg_match('/^(\d+[.][ ]+)(.*)/', $outdented_line, $matches))
+ {
+ $blocks []= $block;
+
+ $baseline = $indentation + strlen($matches[1]);
+
+ $block = array(
+ 'type' => 'li',
+ 'indentation' => $indentation,
+ 'baseline' => $baseline,
+ 'marker' => '\d+[.]',
+ 'first' => true,
+ 'last' => true,
+ 'ordered' => true,
+ 'lines' => array(),
+ );
+
+ $block['lines'] []= preg_replace('/^[ ]{0,4}/', '', $matches[2]);
+
+ continue;
+ }
+
+ # paragraph
+
+ if ($block['type'] === 'paragraph')
+ {
+ if (isset($block['interrupted']))
+ {
+ $blocks []= $block;
+
+ $block['text'] = $line;
+
+ unset($block['interrupted']);
+ }
+ else
+ {
+ if ($this->breaks_enabled)
+ {
+ $block['text'] .= ' ';
+ }
+
+ $block['text'] .= "\n".$line;
+ }
+ }
+ else
+ {
+ $blocks []= $block;
+
+ $block = array(
+ 'type' => 'paragraph',
+ 'text' => $line,
+ );
+ }
+ }
+
+ $blocks []= $block;
+
+ unset($blocks[0]);
+
+ # $blocks » HTML
+
+ $markup = '';
+
+ foreach ($blocks as $block)
+ {
+ switch ($block['type'])
+ {
+ case 'paragraph':
+
+ $text = $this->parse_span_elements($block['text']);
+
+ if ($context === 'li' and $markup === '')
+ {
+ if (isset($block['interrupted']))
+ {
+ $markup .= "\n".'<p>'.$text.'</p>'."\n";
+ }
+ else
+ {
+ $markup .= $text;
+
+ if (isset($blocks[2]))
+ {
+ $markup .= "\n";
+ }
+ }
+ }
+ else
+ {
+ $markup .= '<p>'.$text.'</p>'."\n";
+ }
+
+ break;
+
+ case 'quote':
+
+ $text = $this->parse_block_elements($block['lines']);
+
+ $markup .= '<blockquote>'."\n".$text.'</blockquote>'."\n";
+
+ break;
+
+ case 'code':
+
+ $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<pre><code>'.$text.'</code></pre>'."\n";
+
+ break;
+
+ case 'fenced':
+
+ $text = htmlspecialchars($block['text'], ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<pre><code';
+
+ if (isset($block['language']))
+ {
+ $markup .= ' class="language-'.$block['language'].'"';
+ }
+
+ $markup .= '>'.$text.'</code></pre>'."\n";
+
+ break;
+
+ case 'heading':
+
+ $text = $this->parse_span_elements($block['text']);
+
+ $markup .= '<h'.$block['level'].'>'.$text.'</h'.$block['level'].'>'."\n";
+
+ break;
+
+ case 'rule':
+
+ $markup .= '<hr />'."\n";
+
+ break;
+
+ case 'li':
+
+ if (isset($block['first']))
+ {
+ $type = isset($block['ordered']) ? 'ol' : 'ul';
+
+ $markup .= '<'.$type.'>'."\n";
+ }
+
+ if (isset($block['interrupted']) and ! isset($block['last']))
+ {
+ $block['lines'] []= '';
+ }
+
+ $text = $this->parse_block_elements($block['lines'], 'li');
+
+ $markup .= '<li>'.$text.'</li>'."\n";
+
+ if (isset($block['last']))
+ {
+ $type = isset($block['ordered']) ? 'ol' : 'ul';
+
+ $markup .= '</'.$type.'>'."\n";
+ }
+
+ break;
+
+ case 'markup':
+
+ $markup .= $block['text']."\n";
+
+ break;
+
+ default:
+
+ $markup .= $block['text']."\n";
+ }
+ }
+
+ return $markup;
+ }
+
+ private function parse_span_elements($text, $markers = array(" \n", '![', '&', '*', '<', '[', '\\', '_', '`', 'http', '~~'))
+ {
+ if (isset($text[1]) === false or $markers === array())
+ {
+ return $text;
+ }
+
+ # ~
+
+ $markup = '';
+
+ while ($markers)
+ {
+ $closest_marker = null;
+ $closest_marker_index = 0;
+ $closest_marker_position = null;
+
+ foreach ($markers as $index => $marker)
+ {
+ $marker_position = strpos($text, $marker);
+
+ if ($marker_position === false)
+ {
+ unset($markers[$index]);
+
+ continue;
+ }
+
+ if ($closest_marker === null or $marker_position < $closest_marker_position)
+ {
+ $closest_marker = $marker;
+ $closest_marker_index = $index;
+ $closest_marker_position = $marker_position;
+ }
+ }
+
+ # ~
+
+ if ($closest_marker === null or isset($text[$closest_marker_position + 1]) === false)
+ {
+ $markup .= $text;
+
+ break;
+ }
+ else
+ {
+ $markup .= substr($text, 0, $closest_marker_position);
+ }
+
+ $text = substr($text, $closest_marker_position);
+
+ # ~
+
+ unset($markers[$closest_marker_index]);
+
+ # ~
+
+ switch ($closest_marker)
+ {
+ case " \n":
+
+ $markup .= '<br />'."\n";
+
+ $offset = 3;
+
+ break;
+
+ case '![':
+ case '[':
+
+ if (strpos($text, ']') and preg_match('/\[((?:[^][]|(?R))*)\]/', $text, $matches))
+ {
+ $element = array(
+ '!' => $text[0] === '!',
+ 'a' => $matches[1],
+ );
+
+ $offset = strlen($matches[0]);
+
+ if ($element['!'])
+ {
+ $offset++;
+ }
+
+ $remaining_text = substr($text, $offset);
+
+ if ($remaining_text[0] === '(' and preg_match('/\([ ]*(.*?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*\)/', $remaining_text, $matches))
+ {
+ $element['»'] = $matches[1];
+
+ if (isset($matches[2]))
+ {
+ $element['#'] = $matches[2];
+ }
+
+ $offset += strlen($matches[0]);
+ }
+ elseif ($this->reference_map)
+ {
+ $reference = $element['a'];
+
+ if (preg_match('/^\s*\[(.*?)\]/', $remaining_text, $matches))
+ {
+ $reference = $matches[1] ? $matches[1] : $element['a'];
+
+ $offset += strlen($matches[0]);
+ }
+
+ $reference = strtolower($reference);
+
+ if (isset($this->reference_map[$reference]))
+ {
+ $element['»'] = $this->reference_map[$reference]['»'];
+
+ if (isset($this->reference_map[$reference]['#']))
+ {
+ $element['#'] = $this->reference_map[$reference]['#'];
+ }
+ }
+ else
+ {
+ unset($element);
+ }
+ }
+ else
+ {
+ unset($element);
+ }
+ }
+
+ if (isset($element))
+ {
+ $element['»'] = str_replace('&', '&', $element['»']);
+ $element['»'] = str_replace('<', '<', $element['»']);
+
+ if ($element['!'])
+ {
+ $markup .= '<img alt="'.$element['a'].'" src="'.$element['»'].'"';
+
+ if (isset($element['#']))
+ {
+ $markup .= ' title="'.$element['#'].'"';
+ }
+
+ $markup .= ' />';
+ }
+ else
+ {
+ $element['a'] = $this->parse_span_elements($element['a'], $markers);
+
+ $markup .= '<a href="'.$element['»'].'"';
+
+ if (isset($element['#']))
+ {
+ $markup .= ' title="'.$element['#'].'"';
+ }
+
+ $markup .= '>'.$element['a'].'</a>';
+ }
+
+ unset($element);
+ }
+ else
+ {
+ $markup .= $closest_marker;
+
+ $offset = $closest_marker === '![' ? 2 : 1;
+ }
+
+ break;
+
+ case '&':
+
+ if (preg_match('/^&#?\w+;/', $text, $matches))
+ {
+ $markup .= $matches[0];
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '&';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '*':
+ case '_':
+
+ if ($text[1] === $closest_marker and preg_match(self::$strong_regex[$closest_marker], $text, $matches))
+ {
+ $markers[] = $closest_marker;
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<strong>'.$matches[1].'</strong>';
+ }
+ elseif (preg_match(self::$em_regex[$closest_marker], $text, $matches))
+ {
+ $markers[] = $closest_marker;
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<em>'.$matches[1].'</em>';
+ }
+
+ if (isset($matches) and $matches)
+ {
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= $closest_marker;
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '<':
+
+ if (strpos($text, '>') !== false)
+ {
+ if ($text[1] === 'h' and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $text, $matches))
+ {
+ $element_url = $matches[1];
+ $element_url = str_replace('&', '&', $element_url);
+ $element_url = str_replace('<', '<', $element_url);
+
+ $markup .= '<a href="'.$element_url.'">'.$element_url.'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ elseif (strpos($text, '@') > 1 and preg_match('/<(\S+?@\S+?)>/', $text, $matches))
+ {
+ $markup .= '<a href="mailto:'.$matches[1].'">'.$matches[1].'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ elseif (preg_match('/^<\/?\w.*?>/', $text, $matches))
+ {
+ $markup .= $matches[0];
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '<';
+
+ $offset = 1;
+ }
+ }
+ else
+ {
+ $markup .= '<';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '\\':
+
+ if (in_array($text[1], self::$special_characters))
+ {
+ $markup .= $text[1];
+
+ $offset = 2;
+ }
+ else
+ {
+ $markup .= '\\';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case '`':
+
+ if (preg_match('/^(`+)[ ]*(.+?)[ ]*(?<!`)\1(?!`)/', $text, $matches))
+ {
+ $element_text = $matches[2];
+ $element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
+
+ $markup .= '<code>'.$element_text.'</code>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '`';
+
+ $offset = 1;
+ }
+
+ break;
+
+ case 'http':
+
+ if (preg_match('/^https?:[\/]{2}[^\s]+\b\/*/ui', $text, $matches))
+ {
+ $element_url = $matches[0];
+ $element_url = str_replace('&', '&', $element_url);
+ $element_url = str_replace('<', '<', $element_url);
+
+ $markup .= '<a href="'.$element_url.'">'.$element_url.'</a>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= 'http';
+
+ $offset = 4;
+ }
+
+ break;
+
+ case '~~':
+
+ if (preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $text, $matches))
+ {
+ $matches[1] = $this->parse_span_elements($matches[1], $markers);
+
+ $markup .= '<del>'.$matches[1].'</del>';
+
+ $offset = strlen($matches[0]);
+ }
+ else
+ {
+ $markup .= '~~';
+
+ $offset = 2;
+ }
+
+ break;
+ }
+
+ if (isset($offset))
+ {
+ $text = substr($text, $offset);
+ }
+
+ $markers[$closest_marker_index] = $closest_marker;
+ }
+
+ return $markup;
+ }
+
+ #
+ # Fields
+ #
+
+ private $reference_map = array();
+
+ #
+ # Read-only
+
+ private static $strong_regex = array(
+ '*' => '/^[*]{2}((?:[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s',
+ '_' => '/^__((?:[^_]|_[^_]*_)+?)__(?!_)/us',
+ );
+
+ private static $em_regex = array(
+ '*' => '/^[*]((?:[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
+ '_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
+ );
+
+ private static $special_characters = array(
+ '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',
+ );
+
+ private static $text_level_elements = array(
+ 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
+ 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
+ 'i', 'rp', 'sub', 'code', 'strike', 'marquee',
+ 'q', 'rt', 'sup', 'font', 'strong',
+ 's', 'tt', 'var', 'mark',
+ 'u', 'xm', 'wbr', 'nobr',
+ 'ruby',
+ 'span',
+ 'time',
+ );
+}
/**
* Main parser components
* @package System.Security.SafeHtml
-* @version $Id: HTMLSax3.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
/**
* Required classes
* @return void
*/
function ignoreWhitespace() {
- while ($this->position < $this->length &&
+ while ($this->position < $this->length &&
strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) {
$this->position++;
}
* <li>XML_OPTION_ENTITIES_UNPARSED: XML entities are returned as
* seperate data handler calls in unparsed form</li>
* <li>XML_OPTION_ENTITIES_PARSED: (PHP 4.3.0+ only) XML entities are
- * returned as seperate data handler calls and are parsed with
+ * returned as seperate data handler calls and are parsed with
* PHP's html_entity_decode() function</li>
* <li>XML_OPTION_STRIP_ESCAPES: strips out the -- -- comment markers
* or CDATA markup inside an XML escape, if found.</li>
/**
* Decorators for dealing with parser options
* @package System.Security.SafeHtml
-* @version $Id: Decorators.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @see TSax3::set_option
*/
/**
/**
* Parsing states.
* @package System.Security.SafeHtml
-* @version $Id: States.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
/**
* Define parser states
*/
function parseAttributes(&$context) {
$Attributes = array();
-
+
$context->ignoreWhitespace();
$attributename = $context->scanUntilCharacters("=/> \n\r\t");
while ($attributename != '') {
$context->unscanCharacter();
}
$Attributes[$attributename] = $attributevalue;
-
+
$context->ignoreWhitespace();
$attributename = $context->scanUntilCharacters("=/> \n\r\t");
}
$context->unscanCharacter();
}
$context->handler_object_element->
- {$context->handler_method_opening}($context->htmlsax, $tag,
+ {$context->handler_method_opening}($context->htmlsax, $tag,
$Attributes, TRUE);
$context->handler_object_element->
- {$context->handler_method_closing}($context->htmlsax, $tag,
+ {$context->handler_method_closing}($context->htmlsax, $tag,
TRUE);
} else {
$context->handler_object_element->
- {$context->handler_method_opening}($context->htmlsax, $tag,
+ {$context->handler_method_opening}($context->htmlsax, $tag,
$Attributes, FALSE);
}
}
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Wsdl.php 3314 2013-08-20 10:00:47Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
* This file is part of the PRADO framework from {@link http://www.xisc.com}
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
- * @version $Id: WsdlGenerator.php 3314 2013-08-20 10:00:47Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: WsdlMessage.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: WsdlOperation.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.Web.Services.SOAP
*/
</tr>\r
\r
<tr>\r
- <td><a href="adodb">adodb</a></td>\r
- <td><a href="http://adodb.sourceforge.net/">ADOdb Database Abstraction Library for PHP</a></td>\r
- <td><a href="adodb/license.txt">Dual licensed using BSD and LGPL.</a></td>\r
- <td>Provides one database access abstraction layer.</td>\r
- <td>Slightly modified to work nicely with E_STRICT in php 5.</td>\r
-</tr>\r
-\r
-<tr>\r
- <td><a href="Markdown">Markdown</a></td>\r
- <td><a href="http://www.michelf.com/projects/php-markdown/">PHP Markdown</a></td>\r
- <td><a href="Markdown/License.text">BSD</a></td>\r
+ <td><a href="Parsedown">Parsedown</a></td>\r
+ <td><a href="https://github.com/erusev/parsedown">Markdown Parser for PHP</a></td>\r
+ <td><a href="Parsedown/LICENSE.txt">MIT</a></td>\r
<td>System.Web.UI.WebControls.TMarkdown</td>\r
- <td>PHP5 class implementation of the PHP Markdown.</td>\r
+ <td>PHP implementation of Markdown, GitHub Flavored.</td>\r
</tr>\r
\r
<tr>\r
*
* @author Alban Hanry <compte_messagerie@hotmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $
* @package System.Caching
*/
*
* @author Alban Hanry <compte_messagerie@hotmail.com>
* @author Knut Urdalen <knut.urdalen@gmail.com>
- * @version $Id: TAPCCache.php 3281 2013-03-13 21:01:40Z ctrlaltca $
* @package System.Caching
* @since 3.0b
*/
{
if(!extension_loaded('apc'))
throw new TConfigurationException('apccache_extension_required');
-
+
if(ini_get('apc.enabled') == false)
- throw new TConfigurationException('apccache_extension_not_enabled');
-
+ throw new TConfigurationException('apccache_extension_not_enabled');
+
if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false)
throw new TConfigurationException('apccache_extension_not_enabled_cli');
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
* the cache acts as an array.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
* - {@link TChainedCacheDependency}: checks whether any of a list of dependencies is changed or not
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* last modification time remains unchanged.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* to a certain depth of the subdirectories.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* set {@link setStateName StateName} to the name of the global state.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* (see {@link TList} for more details}).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* will be checked.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
* for more details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.1.0
*/
-<?php\r/**\r * TEACache class file\r *\r * @author Dario rigolin <drigolin@e-portaltech.it>\r * @link http://www.pradosoft.com/\r * @copyright Copyright © 2005-2013 PradoSoft\r * @license http://www.pradosoft.com/license/\r * @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $\r * @package System.Caching\r */\r\r/**\r * TEACache class\r *\r * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.\r *\r * By definition, cache does not ensure the existence of a value\r * even if it never expires. Cache is not meant to be an persistent storage.\r *\r * To use this module, the eAccelerator PHP extension must be loaded and enabled\r *\r * Please note that as of v0.9.6, eAccelerator no longer supports data caching.\r * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.\r *\r * Some usage examples of TEACache are as follows,\r * <code>\r * $cache=new TEACache; // TEACache may also be loaded as a Prado application module\r * $cache->init(null);\r * $cache->add('object',$object);\r * $object2=$cache->get('object');\r * </code>\r *\r * If loaded, TEACache will register itself with {@link TApplication} as the\r * cache module. It can be accessed via {@link TApplication::getCache()}.\r *\r * TEACache may be configured in application configuration file as follows\r * <code>\r * <module id="cache" class="System.Caching.TEACache" />\r * </code>\r *\r * @author Dario Rigolin <drigolin@e-portaltech.it>\r * @version $Id: TEACache.php 3281 2013-03-13 19:31:03Z xue $\r * @package System.Caching\r * @since 3.2.2\r */\rclass TEACache extends TCache\r{\r /**\r * Initializes this module.\r * This method is required by the IModule interface.\r * @param TXmlElement configuration for this module, can be null\r * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini\r */\r public function init($config)\r {\r if(!function_exists('eaccelerator_get'))\r throw new TConfigurationException('eacceleratorcache_extension_required');\r parent::init($config);\r }\r\r /**\r * Retrieves a value from cache with a specified key.\r * This is the implementation of the method declared in the parent class.\r * @param string a unique key identifying the cached value\r * @return string the value stored in cache, false if the value is not in the cache or expired.\r */\r protected function getValue($key)\r {\r $value = eaccelerator_get($key);\r return ($value === null) ? false : $value;\r }\r\r /**\r * Stores a value identified by a key in cache.\r * This is the implementation of the method declared in the parent class.\r *\r * @param string the key identifying the value to be cached\r * @param string the value to be cached\r * @param integer the number of seconds in which the cached value will expire. 0 means never expire.\r * @return boolean true if the value is successfully stored into cache, false otherwise\r */\r protected function setValue($key,$value,$expire)\r {\r return eaccelerator_put($key,$value,$expire);\r }\r\r /**\r * Stores a value identified by a key into cache if the cache does not contain this key.\r * This is the implementation of the method declared in the parent class.\r *\r * @param string the key identifying the value to be cached\r * @param string the value to be cached\r * @param integer the number of seconds in which the cached value will expire. 0 means never expire.\r * @return boolean true if the value is successfully stored into cache, false otherwise\r */\r protected function addValue($key,$value,$expire)\r {\r return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false;\r }\r\r /**\r * Deletes a value with the specified key from cache\r * This is the implementation of the method declared in the parent class.\r * @param string the key of the value to be deleted\r * @return boolean if no error happens during deletion\r */\r protected function deleteValue($key)\r {\r return eaccelerator_rm($key);\r }\r\r /**\r * Deletes all values from cache.\r * Be careful of performing this operation if the cache is shared by multiple applications.\r */\r public function flush()\r {\r // first, remove expired content from cache\r eaccelerator_gc();\r // now, remove leftover cache-keys\r $keys = eaccelerator_list_keys();\r foreach($keys as $key)\r $this->deleteValue(substr($key['name'], 1));\r return true;\r }\r}\r
\ No newline at end of file
+<?php\r/**\r * TEACache class file\r *\r * @author Dario rigolin <drigolin@e-portaltech.it>\r * @link http://www.pradosoft.com/\r * @copyright Copyright © 2005-2014 PradoSoft\r * @license http://www.pradosoft.com/license/\r * @package System.Caching\r */\r\r/**\r * TEACache class\r *\r * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.\r *\r * By definition, cache does not ensure the existence of a value\r * even if it never expires. Cache is not meant to be an persistent storage.\r *\r * To use this module, the eAccelerator PHP extension must be loaded and enabled\r *\r * Please note that as of v0.9.6, eAccelerator no longer supports data caching.\r * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.\r *\r * Some usage examples of TEACache are as follows,\r * <code>\r * $cache=new TEACache; // TEACache may also be loaded as a Prado application module\r * $cache->init(null);\r * $cache->add('object',$object);\r * $object2=$cache->get('object');\r * </code>\r *\r * If loaded, TEACache will register itself with {@link TApplication} as the\r * cache module. It can be accessed via {@link TApplication::getCache()}.\r *\r * TEACache may be configured in application configuration file as follows\r * <code>\r * <module id="cache" class="System.Caching.TEACache" />\r * </code>\r *\r * @author Dario Rigolin <drigolin@e-portaltech.it>\r * @package System.Caching\r * @since 3.2.2\r */\rclass TEACache extends TCache\r{\r /**\r * Initializes this module.\r * This method is required by the IModule interface.\r * @param TXmlElement configuration for this module, can be null\r * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini\r */\r public function init($config)\r {\r if(!function_exists('eaccelerator_get'))\r throw new TConfigurationException('eacceleratorcache_extension_required');\r parent::init($config);\r }\r\r /**\r * Retrieves a value from cache with a specified key.\r * This is the implementation of the method declared in the parent class.\r * @param string a unique key identifying the cached value\r * @return string the value stored in cache, false if the value is not in the cache or expired.\r */\r protected function getValue($key)\r {\r $value = eaccelerator_get($key);\r return ($value === null) ? false : $value;\r }\r\r /**\r * Stores a value identified by a key in cache.\r * This is the implementation of the method declared in the parent class.\r *\r * @param string the key identifying the value to be cached\r * @param string the value to be cached\r * @param integer the number of seconds in which the cached value will expire. 0 means never expire.\r * @return boolean true if the value is successfully stored into cache, false otherwise\r */\r protected function setValue($key,$value,$expire)\r {\r return eaccelerator_put($key,$value,$expire);\r }\r\r /**\r * Stores a value identified by a key into cache if the cache does not contain this key.\r * This is the implementation of the method declared in the parent class.\r *\r * @param string the key identifying the value to be cached\r * @param string the value to be cached\r * @param integer the number of seconds in which the cached value will expire. 0 means never expire.\r * @return boolean true if the value is successfully stored into cache, false otherwise\r */\r protected function addValue($key,$value,$expire)\r {\r return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false;\r }\r\r /**\r * Deletes a value with the specified key from cache\r * This is the implementation of the method declared in the parent class.\r * @param string the key of the value to be deleted\r * @return boolean if no error happens during deletion\r */\r protected function deleteValue($key)\r {\r return eaccelerator_rm($key);\r }\r\r /**\r * Deletes all values from cache.\r * Be careful of performing this operation if the cache is shared by multiple applications.\r */\r public function flush()\r {\r // first, remove expired content from cache\r eaccelerator_gc();\r // now, remove leftover cache-keys\r $keys = eaccelerator_list_keys();\r foreach($keys as $key)\r $this->deleteValue(substr($key['name'], 1));\r return true;\r }\r}\r
\ No newline at end of file
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
* NB : MemCache server(s) must be restarted to apply settings. Require (PECL memcache >= 2.0.0).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMemCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
private $_persistence = true;
/**
* @var integer number of buckets to create for this server which in turn control its
- * probability of it being selected. The probability is relative to the total weight
+ * probability of it being selected. The probability is relative to the total weight
* of all servers.
*/
private $_weight = 1;
-
+
private $_timeout = 360;
private $_retryInterval = 15;
* @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.
*/
private $_minSavings=0.0;
-
+
private $_status = true;
-
+
private $_failureCallback = null;
/**
Prado::trace('Adding server '.$this->_host, 'System.Caching.TMemCache');
if($this->_cache->addServer($this->_host,$this->_port)===false)
throw new TConfigurationException('memcache_connection_failed',$this->_host,$this->_port);
- }
+ }
if($this->_threshold!==0)
- $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings);
+ $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings);
$this->_initialized=true;
parent::init($config);
}
-
+
/**
* Loads configuration from an XML element
* @param TXmlElement configuration node
);
foreach($checks as $property=>$exception)
{
- $value=$properties->remove($property);
+ $value=$properties->remove($property);
if($value!==null && is_numeric($value))
$server[$property]=$value;
else if($value!==null)
{
return $this->_threshold;
}
-
+
/**
* @param integer minimum value length before attempting to compress
* @throws TInvalidOperationException if the module is already initialized
else
$this->_threshold=TPropertyValue::ensureInteger($value);
}
-
+
/**
* @return float minimum amount of savings to actually store the value compressed
*/
{
return $this->_minSavings;
}
-
+
/**
* @param float minimum amount of savings to actually store the value compressed
* @throws TInvalidOperationException if the module is already initialized
else
$this->_minSavings=TPropertyValue::ensureFloat($value);
}
-
+
/**
* Retrieves a value from cache with a specified key.
* This is the implementation of the method declared in the parent class.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
*/
* SQLite DB file (in the namespace format).
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSqliteCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Caching
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $
* @package System.Caching
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TXCache.php 1994 2007-06-11 16:02:28Z knut $
* @package System.Caching
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* in the collection storage.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAttributeCollection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* for traversing its dummy items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDummyDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* operation, override {@link insertAt()}, and {@link removeAt()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
}
/**
- * Finds the base item. If found, the item is inserted before it.
+ * Finds the base item. If found, the item is inserted before it.
* @param mixed the base item which will be pushed back by the second parameter
* @param mixed the item
* @return int the index where the item is inserted
{
if(($index = $this->indexOf($baseitem)) == -1)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAt($index, $item);
-
+
return $index;
}
else
}
/**
- * Finds the base item. If found, the item is inserted after it.
+ * Finds the base item. If found, the item is inserted after it.
* @param mixed the base item which comes before the second parameter when added to the list
* @param mixed the item
* @return int the index where the item is inserted
{
if(($index = $this->indexOf($baseitem)) == -1)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAt($index + 1, $item);
-
+
return $index + 1;
}
else
*
* TListIterator is used by TList. It allows TList to return a new iterator
* for traversing the items in the list.
- *
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ *
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* @author Robin J. Rogge <rojaro@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $
* @package System.Collections
*/
* TListItemCollection maintains a list of {@link TListItem} for {@link TListControl}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListControl.php 2624 2009-03-19 21:20:47Z godzilla80@gmx.net $
* @package System.Collections
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* TMapIterator is used by TMap. It allows TMap to return a new iterator
* for traversing the items in the map.
*
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* within the specified page will be returned and traversed.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* to return a new iterator for traversing the items in a {@link TList} object.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* to return a new iterator for traversing the items in a {@link TMap} object.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedDataSource.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
*
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* To obtain the page index before it was changed, use {@link getOldPageIndex OldPageIndex}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* Newly fetched data should be saved in {@link setData Data} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Collections
*/
/**
* TPriorityList class
*
- * TPriorityList implements a priority ordered list collection class. It allows you to specify
- * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the
- * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and
- * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal
- * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated.
- * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start
+ * TPriorityList implements a priority ordered list collection class. It allows you to specify
+ * any numeric for priorities down to a specific precision. The lower the numeric, the high the priority of the item in the
+ * list. Thus -10 has a higher priority than -5, 0, 10 (the default), 18, 10005, etc. Per {@link round}, precision may be negative and
+ * thus rounding can go by 10, 100, 1000, etc, instead of just .1, .01, .001, etc. The default precision allows for 8 decimal
+ * places. There is also a default priority of 10, if no different default priority is specified or no item specific priority is indicated.
+ * If you replace TList with this class it will work exactly the same with items inserted set to the default priority, until you start
* using different priorities than the default priority.
*
* As you access the PHP array features of this class, it flattens and caches the results. If at all possible, this
* $n=count($list); // returns the number of items in the list
* </code>
*
- * To extend TPriorityList for doing your own operations with each addition or removal,
+ * To extend TPriorityList for doing your own operations with each addition or removal,
* override {@link insertAtIndexInPriority()} and {@link removeAtIndexInPriority()} and then call the parent.
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TPriorityList.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Collections
* @since 3.2a
*/
-class TPriorityList extends TList
+class TPriorityList extends TList
{
/**
* @var array internal data storage
* @var integer the precision of the numeric priorities within this priority list.
*/
private $_p=8;
-
+
/**
* Constructor.
* Initializes the list with an array or an iterable object.
$this->setPrecision($precision);
$this->setDefaultPriority($defaultPriority);
}
-
+
/**
* Returns the number of items in the list.
* This method is required by Countable interface.
{
return $this->getCount();
}
-
+
/**
* Returns the total number of items in the list
* @return integer the number of items in the list
{
return $this->_c;
}
-
+
/**
* Gets the number of items at a priority within the list
* @param numeric optional priority at which to count items. if no parameter, it will be set to the default {@link getDefaultPriority}
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority]))
return false;
return count($this->_d[$priority]);
}
-
+
/**
* @return numeric gets the default priority of inserted items without a specified priority
*/
{
return $this->_dp;
}
-
+
/**
* This must be called internally or when instantiated.
* @param numeric sets the default priority of inserted items without a specified priority
{
$this->_dp=(string)round(TPropertyValue::ensureFloat($value),$this->_p);
}
-
+
/**
* @return integer The precision of numeric priorities, defaults to 8
*/
{
return $this->_p;
}
-
+
/**
* This must be called internally or when instantiated.
* @param integer The precision of numeric priorities.
{
$this->_p=TPropertyValue::ensureInteger($value);
}
-
+
/**
* Returns an iterator for traversing the items in the list.
* This method is required by the interface IteratorAggregate.
{
return new ArrayIterator($this->flattenPriorities());
}
-
+
/**
* This returns a list of the priorities within this list, ordered lowest to highest.
* @return array the array of priority numerics in decreasing priority order
$this->sortPriorities();
return array_keys($this->_d);
}
-
-
+
+
/**
* This orders the priority list internally.
*/
}
/**
- * This flattens the priority list into a flat array [0,...,n-1]
+ * This flattens the priority list into a flat array [0,...,n-1]
* @return array array of items in the list in priority and index order
*/
protected function flattenPriorities() {
if(is_array($this->_fd))
return $this->_fd;
-
+
$this->sortPriorities();
$this->_fd=array();
foreach($this->_d as $priority => $itemsatpriority)
$this->_fd=array_merge($this->_fd,$itemsatpriority);
return $this->_fd;
}
-
+
/**
* Returns the item at the index of a flattened priority list.
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
return isset($this->_d[$priority])?$this->_d[$priority]:null;
}
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p);
-
+
return !isset($this->_d[$priority])?false:(
isset($this->_d[$priority][$index])?$this->_d[$priority][$index]:false
);
}
/**
- * Appends an item into the list at the end of the specified priority. The position of the added item may
+ * Appends an item into the list at the end of the specified priority. The position of the added item may
* not be at the end of the list.
* @param mixed item to add into the list at priority
* @param numeric priority blank or null for the default priority
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
return $this->insertAtIndexInPriority($item,false,$priority,true);
}
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityAt($index,true))!==false)
$this->insertAtIndexInPriority($item,$priority[1],$priority[0]);
else
}
/**
- * Inserts an item at the specified index within a priority. Override and call this method to
+ * Inserts an item at the specified index within a priority. Override and call this method to
* insert your own functionality.
* @param mixed item to add within the list.
* @param integer index within the priority to add the item, defaults to false which appends the item at the priority
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority), $this->_p);
-
+
if($preserveCache) {
$this->sortPriorities();
$cc=0;
break;
else
$cc+=count($items);
-
+
if($index===false&&isset($this->_d[$priority])) {
$c=count($this->_d[$priority]);
$c+=$cc;
$this->_o = false;
$this->_d[$priority]=array($item);
}
-
+
if($this->_fd&&is_array($this->_fd)) // if there is a flattened array cache
array_splice($this->_fd,$c,0,array($item));
} else {
else
$this->_fd=null;
}
-
+
$this->_c++;
-
+
return $c;
-
+
}
-
+
/**
* Removes an item from the priority list.
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($p=$this->priorityOf($item,true))!==false)
{
if($priority!==false) {
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if($p[0]!=$priority)
throw new TInvalidDataValueException('list_item_inexistent');
}
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityAt($index, true))!==false)
return $this->removeAtIndexInPriority($priority[1],$priority[0]);
throw new TInvalidDataValueException('list_index_invalid',$index);
}
/**
- * Removes the item at a specific index within a priority. Override
+ * Removes the item at a specific index within a priority. Override
* and call this method to insert your own functionality.
* @param integer index of item to remove within the priority.
* @param numeric priority of the item to remove, defaults to null, or left blank, it is then set to the default priority
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority])||$index<0||$index>=count($this->_d[$priority]))
throw new TInvalidDataValueException('list_item_inexistent');
-
+
// $value is an array of elements removed, only one
$value=array_splice($this->_d[$priority],$index,1);
$value=$value[0];
-
+
if(!count($this->_d[$priority]))
unset($this->_d[$priority]);
-
+
$this->_c--;
$this->_fd=null;
return $value;
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
$d=array_reverse($this->_d,true);
foreach($this->_d as $priority=>$items) {
for($index=count($items)-1;$index>=0;$index--)
public function priorityOf($item,$withindex = false)
{
$this->sortPriorities();
-
+
$absindex = 0;
foreach($this->_d as $priority=>$items) {
if(($index=array_search($item,$items,true))!==false) {
$absindex+=$index;
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
} else
$absindex+=count($items);
}
-
+
return false;
}
{
if($index<0||$index>=$this->getCount())
throw new TInvalidDataValueException('list_index_invalid',$index);
-
+
$absindex=$index;
$this->sortPriorities();
foreach($this->_d as $priority=>$items) {
if($index>=($c=count($items)))
$index-=$c;
else
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
}
return false;
}
/**
- * This inserts an item before another item within the list. It uses the same priority as the
+ * This inserts an item before another item within the list. It uses the same priority as the
* found index item and places the new item before it.
* @param mixed indexitem the item to index
* @param mixed the item to add before indexitem
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityOf($indexitem,true))===false)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAtIndexInPriority($item,$priority[1],$priority[0]);
-
+
return $priority[2];
}
/**
- * This inserts an item after another item within the list. It uses the same priority as the
+ * This inserts an item after another item within the list. It uses the same priority as the
* found index item and places the new item after it.
* @param mixed indexitem the item to index
* @param mixed the item to add after indexitem
{
if($this->getReadOnly())
throw new TInvalidOperationException('list_readonly',get_class($this));
-
+
if(($priority=$this->priorityOf($indexitem,true))===false)
throw new TInvalidDataValueException('list_item_inexistent');
-
+
$this->insertAtIndexInPriority($item,$priority[1]+1,$priority[0]);
-
+
return $priority[2]+1;
}
* Combines the map elements which have a priority below the parameter value
* @param numeric the cut-off priority. All items of priority less than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive.
- * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayBelowPriority($priority,$inclusive=false)
* Combines the map elements which have a priority above the parameter value
* @param numeric the cut-off priority. All items of priority greater than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive.
- * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayAbovePriority($priority,$inclusive=true)
}
return $items;
}
-
+
/**
* Copies iterable data into the priority list.
/**
* Merges iterable data into the priority list.
* New data will be appended to the end of the existing data. If another TPriorityList is merged,
- * the incoming parameter items will be appended at the priorities they are present. These items will be added
+ * the incoming parameter items will be appended at the priorities they are present. These items will be added
* to the end of the existing items with equal priorities, if there are any.
* @param mixed the data to be merged with, must be an array or object implementing Traversable
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
{
foreach($data as $priority=>$item)
$this->add($item);
-
+
}
else if($data!==null)
throw new TInvalidDataTypeException('map_data_not_iterable');
/**
* Sets the element at the specified offset. This method is required by the interface ArrayAccess.
- * Setting elements in a priority list is not straight forword when appending and setting at the
+ * Setting elements in a priority list is not straight forword when appending and setting at the
* end boundary. When appending without an offset (a null offset), the item will be added at
* the default priority. The item may not be the last item in the list. When appending with an
* offset equal to the count of the list, the item will get be appended with the last items priority.
*
- * All together, when setting the location of an item, the item stays in that location, but appending
+ * All together, when setting the location of an item, the item stays in that location, but appending
* an item into a priority list doesn't mean the item is at the end of the list.
* @param integer the offset to set element
* @param mixed the element value
*
* @author Brad Anderson <javalizard@mac.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $
* @package System.Collections
*/
/**
* TPriorityMap class
*
- * TPriorityMap implements a collection that takes key-value pairs with
- * a priority to allow key-value pairs to be ordered. This ordering is
+ * TPriorityMap implements a collection that takes key-value pairs with
+ * a priority to allow key-value pairs to be ordered. This ordering is
* important when flattening the map. When flattening the map, if some
- * key-value pairs are required to be before or after others, use this
+ * key-value pairs are required to be before or after others, use this
* class to keep order to your map.
*
* You can access, add or remove an item with a key by using
- * {@link itemAt}, {@link add}, and {@link remove}. These functions
- * can optionally take a priority parameter to allow access to specific
- * priorities. TPriorityMap is functionally backward compatible
+ * {@link itemAt}, {@link add}, and {@link remove}. These functions
+ * can optionally take a priority parameter to allow access to specific
+ * priorities. TPriorityMap is functionally backward compatible
* with {@link TMap}.
- *
+ *
* To get the number of the items in the map, use {@link getCount}.
* TPriorityMap can also be used like a regular array as follows,
* <code>
*
* An item that doesn't specify a priority will receive the default
* priority. The default priority is set during the instantiation
- * of a new TPriorityMap. If no custom default priority is specified,
+ * of a new TPriorityMap. If no custom default priority is specified,
* the standard default priority of 10 is used.
*
* Priorities with significant digits below precision will be rounded.
*
- * A priority may also be a numeric with decimals. This is set
- * during the instantiation of a new TPriorityMap.
+ * A priority may also be a numeric with decimals. This is set
+ * during the instantiation of a new TPriorityMap.
* The default is 8 decimal places for a priority. If a negative number
* is used, rounding occurs into the integer space rather than in
* the decimal space. See {@link round}.
*
* @author Brad Anderson <javalizard@mac.com>
- * @version $Id: TPriorityMap.php 2817 2010-04-18 04:25:03Z javalizard $
* @package System.Collections
* @since 3.2a
*/
{
$this->_r=TPropertyValue::ensureBoolean($value);
}
-
+
/**
* @return numeric gets the default priority of inserted items without a specified priority
*/
{
return $this->_dp;
}
-
+
/**
* This must be called internally or when instantiated.
* @param numeric sets the default priority of inserted items without a specified priority
{
$this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p);
}
-
+
/**
* @return integer The precision of numeric priorities, defaults to 8
*/
{
return $this->_p;
}
-
+
/**
* This must be called internally or when instantiated.
* @param integer The precision of numeric priorities.
{
return new ArrayIterator($this->flattenPriorities());
}
-
-
+
+
/**
* Orders the priority list internally.
*/
protected function flattenPriorities() {
if(is_array($this->_fd))
return $this->_fd;
-
+
$this->sortPriorities();
$this->_fd = array();
foreach($this->_d as $priority => $itemsatpriority)
{
return $this->_c;
}
-
+
/**
* Gets the number of items at a priority within the map.
- * @param numeric optional priority at which to count items. if no parameter,
+ * @param numeric optional priority at which to count items. if no parameter,
* it will be set to the default {@link getDefaultPriority}
* @return integer the number of items in the map at the specified priority
*/
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!isset($this->_d[$priority])||!is_array($this->_d[$priority]))
return false;
return count($this->_d[$priority]);
}
-
+
/**
* This returns a list of the priorities within this map, ordered lowest to highest.
* @return array the array of priority numerics in decreasing priority order
* Returns the item with the specified key. If a priority is specified, only items
* within that specific priority will be selected
* @param mixed the key
- * @param mixed the priority. null is the default priority, false is any priority,
+ * @param mixed the priority. null is the default priority, false is any priority,
* and numeric is a specific priority. default: false, any priority.
* @return mixed the element at the offset, null if no element is found at the offset
*/
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
$oldpriority=$this->priorityAt($key);
if($oldpriority!==false&&$oldpriority!=$priority) {
$value=$this->remove($key,$oldpriority);
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
return isset($this->_d[$priority])?$this->_d[$priority]:null;
}
if($priority===null)
$priority=$this->getDefaultPriority();
$priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p);
-
+
if(!$this->_r)
{
foreach($this->_d as $innerpriority=>$items)
/**
* Removes an item from the map by its key. If no priority, or false, is specified
* then priority is irrelevant. If null is used as a parameter for priority, then
- * the priority will be the default priority. If a priority is specified, or
+ * the priority will be the default priority. If a priority is specified, or
* the default priority is specified, only key-value pairs in that priority
* will be affected.
* @param mixed the key of the item to be removed
- * @param numeric|false|null priority. False is any priority, null is the
+ * @param numeric|false|null priority. False is any priority, null is the
* default priority, and numeric is a specific priority
* @return mixed the removed value, null if no such key exists.
* @throws TInvalidOperationException if the map is read-only
{
if($priority===null)
$priority=$this->getDefaultPriority();
-
+
if($priority===false)
{
$this->sortPriorities();
}
/**
- * When the map is flattened into an array, the priorities are taken into
- * account and elements of the map are ordered in the array according to
+ * When the map is flattened into an array, the priorities are taken into
+ * account and elements of the map are ordered in the array according to
* their priority.
* @return array the list of items in array
*/
* Combines the map elements which have a priority below the parameter value
* @param numeric the cut-off priority. All items of priority less than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: false, not inclusive.
- * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are below a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayBelowPriority($priority,$inclusive=false)
* Combines the map elements which have a priority above the parameter value
* @param numeric the cut-off priority. All items of priority greater than this are returned.
* @param boolean whether or not the input cut-off priority is inclusive. Default: true, inclusive.
- * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
+ * @return array the array of priorities keys with values of arrays of items that are above a specified priority.
* The priorities are sorted so important priorities, lower numerics, are first.
*/
public function toArrayAbovePriority($priority,$inclusive=true)
/**
* Copies iterable data into the map.
* Note, existing data in the map will be cleared first.
- * @param mixed the data to be copied from, must be an array, object implementing
+ * @param mixed the data to be copied from, must be an array, object implementing
* Traversable, or a TPriorityMap
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
*/
/**
* Merges iterable data into the map.
* Existing data in the map will be kept and overwritten if the keys are the same.
- * @param mixed the data to be merged with, must be an array, object implementing
+ * @param mixed the data to be merged with, must be an array, object implementing
* Traversable, or a TPriorityMap
* @throws TInvalidDataTypeException If data is neither an array nor an iterator.
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Collections
{
return $this->_c;
}
-
+
/**
* Returns the number of items in the queue.
* This method is required by Countable interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
* TStackIterator is used by TStack. It allows TStack to return a new iterator
* for traversing the items in the list.
*
- * @deprecated Issue 264 : ArrayIterator should be used instead
+ * @deprecated Issue 264 : ArrayIterator should be used instead
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStack.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Collections
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* Base exception class for Active Records.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
* TActiveRecordConfigurationException class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Relations
*
* @author Cesar Ramos <cramos[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TMssqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TMysqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TPgsqlScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TScaffoldInputBase class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TScaffoldInputCommon class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
* TSqliteScaffoldInput class file.
*
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Data.ActiveRecord.Scaffold.InputBuilder
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
* file explicitly.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldBase.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
* xxx is the property name).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
* that is called before the save() method is called on the TActiveRecord.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldEditView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
* Parameters property of TActiveRecordCriteria.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TScaffoldListView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.ActiveRecord.Scaffold
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
*/
* the Active Record class to be displayed/edited/added.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TScaffoldView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord.Scaffold
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
{
return isset(self::$_relations[get_class($this)][strtolower($property)]);
}
+
+ /**
+ * Return record data as array
+ * @return array of column name and column values
+ * @since 3.2.4
+ */
+ public function toArray(){
+ $result=array();
+ foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){
+ $result[$columnName]=$this->getColumnValue($columnName);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return record data as JSON
+ * @return JSON
+ * @since 3.2.4
+ */
+ public function toJSON(){
+ return json_encode($this->toArray());
+ }
}
/**
* be set to false to prevent the requested change event to be performed.
*
* @author Wei Zhuo<weizhuo@gmail.com>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1.2
*/
* - Exception: throws a TActiveRecordException
*
* @author Yves Berkholz <godzilla80@gmx.net>
- * @version $Id: TActiveRecord.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @see TActiveRecordManager::setInvalidFinderResult
* @see TActiveRecordConfig::setInvalidFinderResult
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordCriteria.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* record as arrays (for most finder methods).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
protected function getRecordTableName(TActiveRecord $record)
{
$class = new ReflectionClass($record);
-
if($class->hasConstant(self::TABLE_CONST))
{
$value = $class->getConstant(self::TABLE_CONST);
$connection->setActive(true);
$driver = $connection->getDriverName();
if($driver == 'pgsql') {
- $tableName = strtolower($tableName);
+ $tableName = strtolower($tableName);
}
$key = $connStr.$tableName;
if(!isset($this->_tables[$key]))
{
+
//call this first to ensure that unserializing the cache
//will find the correct driver dependent classes.
if(!isset($this->_meta[$connStr]))
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
*/
* the active record gateway to cache the table meta data information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TActiveRecordManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.ActiveRecord
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
* for MSSQL servers.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
* @package System.Data.Common.Mssql
*/
* TMssqlMetaData loads MSSQL database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlMetaData.php 1866 2007-04-14 05:02:29Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
class TMssqlMetaData extends TDbMetaData
-{
+{
/**
* @return string TDbTableInfo class name.
*/
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='dbo')
+ {
+ $condition="TABLE_TYPE='BASE TABLE'";
+ $sql=<<<EOD
+SELECT TABLE_NAME, TABLE_SCHEMA FROM [INFORMATION_SCHEMA].[TABLES]
+WHERE TABLE_SCHEMA=:schema AND $condition
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(":schema", $schema);
+ $rows=$command->queryAll();
+ $names=array();
+ foreach ($rows as $row)
+ {
+ if ($schema == self::DEFAULT_SCHEMA)
+ $names[]=$row['TABLE_NAME'];
+ else
+ $names[]=$schema.'.'.$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];
+ }
+
+ return $names;
+ }
}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common.Mssql
*/
* Describes the column metadata of the schema for a Mssql database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMssqlTableColumn.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Mssql
*/
* TMssqlTableInfo class provides additional table information for Mssql database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMssqlTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Mssql
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
* TMysqlCommandBuilder implements default TDbCommandBuilder
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
* See http://netevil.org/node.php?nid=795&SC=1
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
{
list($schemaName,$tableName) = $this->getSchemaTableName($table);
$find = $schemaName===null ? "`{$tableName}`" : "`{$schemaName}`.`{$tableName}`";
+ $colCase = $this->getDbConnection()->getColumnCase();
+ if($colCase != TDbColumnCaseMode::Preserved)
+ $this->getDbConnection()->setColumnCase('Preserved');
$this->getDbConnection()->setActive(true);
$sql = "SHOW FULL FIELDS FROM {$find}";
$command = $this->getDbConnection()->createCommand($sql);
}
if($index===0)
throw new TDbException('dbmetadata_invalid_table_view', $table);
+ if($colCase != TDbColumnCaseMode::Preserved)
+ $this->getDbConnection()->setColumnCase($colCase);
return $tableInfo;
}
*/
protected function processColumn($tableInfo, $col)
{
- $columnId = $col['field'];
+ $columnId = $col['Field'];
$info['ColumnName'] = "`$columnId`"; //quote the column names!
$info['ColumnId'] = $columnId;
$info['ColumnIndex'] = $col['index'];
- if($col['null']==='YES')
+ if($col['Null']==='YES')
$info['AllowNull'] = true;
- if(is_int(strpos(strtolower($col['extra']), 'auto_increment')))
+ if(is_int(strpos(strtolower($col['Extra']), 'auto_increment')))
$info['AutoIncrement']=true;
- if($col['default']!=="")
- $info['DefaultValue'] = $col['default'];
+ if($col['Default']!=="")
+ $info['DefaultValue'] = $col['Default'];
- if($col['key']==='PRI' || in_array($columnId, $tableInfo->getPrimaryKeys()))
+ if($col['Key']==='PRI' || in_array($columnId, $tableInfo->getPrimaryKeys()))
$info['IsPrimaryKey'] = true;
if($this->isForeignKeyColumn($columnId, $tableInfo))
$info['IsForeignKey'] = true;
- $info['DbType'] = $col['type'];
+ $info['DbType'] = $col['Type'];
$match=array();
//find SET/ENUM values, column size, precision, and scale
- if(preg_match('/\((.*)\)/', $col['type'], $match))
+ if(preg_match('/\((.*)\)/', $col['Type'], $match))
{
- $info['DbType']= preg_replace('/\(.*\)/', '', $col['type']);
+ $info['DbType']= preg_replace('/\(.*\)/', '', $col['Type']);
//find SET/ENUM values
if($this->isEnumSetType($info['DbType']))
$command->bindValue(':table', $tableName);
try
{
- return count($result = $command->queryRow()) > 0 && $result['table_type']==='VIEW';
+ return count($result = $command->queryRow()) > 0 && $result['Table_type']==='VIEW';
}
catch(TDbException $e)
{
$primary = array();
foreach($command->query() as $row)
{
- if($row['key_name']==='PRIMARY')
- $primary[] = $row['column_name'];
+ if($row['Key_name']==='PRIMARY')
+ $primary[] = $row['Column_name'];
}
// MySQL version was increased to >=5.1.21 instead of 5.x
// due to a MySQL bug (http://bugs.mysql.com/bug.php?id=19588)
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ if($schema==='')
+ return $this->getDbConnection()->createCommand('SHOW TABLES')->queryColumn();
+ $names=$this->getDbConnection()->createCommand('SHOW TABLES FROM '.$this->quoteTableName($schema))->queryColumn();
+ foreach($names as &$name)
+ $name=$schema.'.'.$name;
+ return $names;
+ }
}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
* Describes the column metadata of the schema for a Mysql database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
*/
* TMysqlTableInfo class provides additional table information for MySQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMysqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Mysql
* @since 3.1
*/
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
* for Oracle database.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
" SELECT rownum as {$pradoNUMLIN} {$aliasedFields} FROM ".
" ($sql) {$fieldsALIAS} WHERE rownum <= {$limit} ".
") WHERE {$pradoNUMLIN} >= {$offset} ";
-
+
************************* */
$offset=(int)$offset;
$toReg = $offset + $limit ;
$fullTableName = $this->getTableInfo()->getTableFullName();
- if (empty ($sORDERBY))
+ if (empty ($sORDERBY))
$sORDERBY="ROWNUM";
-
+
$newSql = " SELECT $fields FROM " .
"( " .
" SELECT ROW_NUMBER() OVER ( ORDER BY {$sORDERBY} ) -1 as {$pradoNUMLIN} {$aliasedFields} " .
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
*/
* TOracleMetaData loads Oracle database table and column information.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
* @since 3.1
*/
{
private $_defaultSchema = 'system';
-
+
/**
* @return string TDbTableInfo class name.
*/
}
return false;
}
-}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ if($schema==='')
+ {
+ $sql=<<<EOD
+SELECT table_name, '{$schema}' as table_schema FROM user_tables
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ }
+ else
+ {
+ $sql=<<<EOD
+SELECT object_name as table_name, owner as table_schema FROM all_objects
+WHERE object_type = 'TABLE' AND owner=:schema
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(':schema',$schema);
+ }
+ $rows=$command->queryAll();
+ $names=array();
+ foreach($rows as $row)
+ {
+ if($schema===$this->getDefaultSchema() || $schema==='')
+ $names[]=$row['TABLE_NAME'];
+ else
+ $names[]=$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];
+ }
+ return $names;
+ }
+}
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
*/
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
- * @version $Id: TOracleTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Oracle
* @since 3.1
*/
class TOracleTableColumn extends TDbTableColumn
{
private static $types=array(
- 'numeric' => array( 'numeric' )
+ 'numeric' => array( 'numeric' )
// 'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'),
// 'boolean' => array('boolean'),
// 'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric')
*
* @author Marcos Nobre <marconobre[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
* TDbTableInfo class describes the meta data of a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TOracleTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
* for Pgsql database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
* TPgsqlMetaData loads PostgreSQL database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlMetaData.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='public')
+ {
+ if($schema==='')
+ $schema=self::DEFAULT_SCHEMA;
+ $sql=<<<EOD
+SELECT table_name, table_schema FROM information_schema.tables
+WHERE table_schema=:schema AND table_type='BASE TABLE'
+EOD;
+ $command=$this->getDbConnection()->createCommand($sql);
+ $command->bindParam(':schema',$schema);
+ $rows=$command->queryAll();
+ $names=array();
+ foreach($rows as $row)
+ {
+ if($schema===self::DEFAULT_SCHEMA)
+ $names[]=$row['table_name'];
+ else
+ $names[]=$row['table_schema'].'.'.$row['table_name'];
+ }
+ return $names;
+ }
}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
*/
* TPgsqlTableInfo class provides additional table information for PostgreSQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPgsqlTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common.Pgsql
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
*/
* for Sqlite database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
* TSqliteMetaData loads SQLite database table and column information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteMetaData.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Commom.Sqlite
* @since 3.1
*/
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. This is not used for sqlite database.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ $sql="SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name<>'sqlite_sequence'";
+ return $this->getDbConnection()->createCommand($sql)->queryColumn();
+ }
}
-
-/**
-
-CREATE TABLE foo
-(
- id INTEGER NOT NULL PRIMARY KEY,
- id2 CHAR(2)
-);
-
-CREATE TABLE bar
-(
- id INTEGER NOT NULL PRIMARY KEY,
- foo_id INTEGER
- CONSTRAINT fk_foo_id REFERENCES foo(id) ON DELETE CASCADE
-);
-*/
-
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
* Describes the column metadata of the schema for a PostgreSQL database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteTableColumn.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
*/
* TSqliteTableInfo class provides additional table information for PostgreSQL database.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqliteTableInfo.php 1861 2007-04-12 08:05:03Z wei $
* @package System.Data.Common.Sqlite
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
* giving by {@link setTableInfo TableInfo} the property.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbCommandBuilder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $
* @package System.Data.Common
*/
* Use the {@link getTableInfo} method to retrieve a table information.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbMetaData.php 3284 2013-04-11 07:14:59Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
return $lft . str_replace(self::$delimiterIdentifier, '', $name) . $rgt;
}
+
+ /**
+ * Returns all table names in the database.
+ * This method should be overridden by child classes in order to support this feature
+ * because the default implementation simply throws an exception.
+ * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
+ * If not empty, the returned table names will be prefixed with the schema name.
+ * @return array all table names in the database.
+ */
+ abstract public function findTableNames($schema='');
}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
* TDbTableColumn class describes the column meta data of the schema for a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbTableColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
*/
* TDbTableInfo class describes the meta data of a database table.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbTableInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.Common
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.DataGateway
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $
* @package System.Data.DataGateway
*/
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDbSqlCriteria.php 1835 2007-04-03 01:38:15Z wei $
* @package System.Data.DataGateway
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.DataGateway
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* the object data.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* is used inplace of the current result map.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDiscriminator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
/**
* TInlineParameterMapParser class.
*
- * The inline parameter map syntax lets you embed the property name,
- * the property type, the column type, and a null value replacement into a
+ * The inline parameter map syntax lets you embed the property name,
+ * the property type, the column type, and a null value replacement into a
* parametrized SQL statement.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TInlineParameterMapParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* The <parameterMap> element accepts two attributes: id (required) and extends (optional).
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TParameterMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
return $value;
}
-
-
+
+
/**
* Create type handler from {@link Type setType()} or {@link TypeHandler setTypeHandler}.
* @param TParameterProperty parameter property
$handler = Prado::createComponent($type);
return $handler;
}
-
+
/**
* @param mixed object to obtain the property from.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* will be written to the database instead of the value.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TParameterProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
public function __sleep()
{
- $exprops = array(); $cn = 'TParameterProperty';
+ $exprops = array(); $cn = 'TParameterProperty';
if ($this->_typeHandler===null) $exprops[] = "\0$cn\0_typeHandler";
if ($this->_type===null) $exprops[] = "\0$cn\0_type";
if ($this->_column===null) $exprops[] = "\0$cn\0_column";
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* from the "parent" <resultMap> are set before any values specified by this <resultMap>.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TResultMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* with the {@link Select setSelect()} .
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TResultProperty.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
public function __sleep()
{
- $exprops = array(); $cn = 'TResultProperty';
+ $exprops = array(); $cn = 'TResultProperty';
if ($this->_nullValue===null) $exprops[] = "\0$cn\0_nullValue";
if ($this->_propertyName===null) $exprops[] = "\0$cn\0_propertyNama";
if ($this->_columnName===null) $exprops[] = "\0$cn\0_columnName";
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* it with a TSimpleDynamicParser::DYNAMIC_TOKEN.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSimpleDynamicParser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* the current request.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* Implemented cache are 'Basic', 'FIFO' and 'LRU'.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* Provides a hash of the object to be cached.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCacheModel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* statement can return a database-generated key.)
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
public function __sleep()
{
- $cn = __CLASS__;
+ $cn = __CLASS__;
$exprops = array("\0$cn\0_resultMap");
if (!$this->_parameterMapName) $exprops[] = "\0$cn\0_parameterMapName";
if (!$this->_parameterMap) $exprops[] = "\0$cn\0_parameterMap";
* TSqlMapSelect class file.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
* to generate a key to be used for the insert command.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* TSqlMapUpdate class corresponds to <update> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* TSqlMapDelete class corresponds to the <delete> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* TSqlMapSelect corresponds to the <selectKey> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
* TSqlMapXmlConfig class file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
*/
abstract class TSqlMapXmlConfigBuilder
* Configures the TSqlMapManager using xml configuration file.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
* description
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapXmlConfiguration.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Configuration
* @since 3.1
*/
*
* @author Berczi Gabor <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
* @package System.Data.SqlMap
*/
/**
* TFastSqlMapApplicationCache class file
- *
+ *
* Fast SqlMap result cache class with minimal-concurrency get/set and atomic flush operations
- *
+ *
* @author Berczi Gabor <gabor.berczi@devworx.hu>
- * @version $Id: TFastSqlMapApplicationCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
* @package System.Data.SqlMap
* @since 3.2
*/
{
$this->_cacheModel = $cacheModel;
}
-
+
protected function getBaseKeyKeyName()
{
return 'SqlMapCacheBaseKey::'.$this->_cacheModel->getId();
}
-
+
protected function getBaseKey()
{
$cache = $this->getCache();
}
return $basekey;
}
-
+
protected function getCacheKey($key)
{
return $this->getBaseKey().'###'.$key;
{
$this->getCache()->delete($this->getBaseKeyKeyName());
}
-
+
public function get($key)
{
$result = $this->getCache()->get($this->getCacheKey($key));
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* TLazyLoadList executes mapped statements when the proxy collection is first accessed.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* particular object and relays the call to handler object.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TLazyLoadList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* </code>
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPropertyAccess.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* a least-recently-used cache implementation.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* object that was first added when the cache is full.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* object that was accessed last when the cache is full.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* caching SqlMap results.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* TSqlMapException is the base exception class for all SqlMap exceptions.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* TSqlMapConfigurationException, raised during configuration file parsing.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* TSqlMapUndefinedException, raised when mapped statemented are undefined.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* TSqlMapDuplicateException, raised when a duplicate mapped statement is found.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* TInvalidPropertyException, raised when setting or getting an invalid property.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapException.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* The paged list does not need to know about the total number of records.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapPagedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* to PHP types and vice versa.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* booleans using "Y" and "N" instead of the more typical 0/1.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapTypeHandlerRegistry.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
* IMappedStatement interface file.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* Interface for all mapping statements.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: IMappedStatement.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TCacheingStatement class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCachingStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TDeleteMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDeleteMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TInsertMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TInsertMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* This class is usualy instantiated during SQLMap configuration by TSqlDomBuilder.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.0
*/
parent::__wakeup();
if (is_null($this->_selectQueue)) $this->_selectQueue = array();
}
-
+
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!count($this->_selectQueue)) $exprops[] = "\0$cn\0_selectQueue";
if (is_null($this->_groupBy)) $exprops[] = "\0$cn\0_groupBy";
if (!$this->_IsRowDataFound) $exprops[] = "\0$cn\0_IsRowDataFound";
* TPostSelectBinding class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
* build using the {@link collect} method.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!count($this->_tree)) $exprops[] = "\0$cn\0_tree";
if (!count($this->_entries)) $exprops[] = "\0$cn\0_entries";
if (!count($this->_list)) $exprops[] = "\0$cn\0_list";
* TResultSetListItemParameter class
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
* TResultSetMapItemParameter class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TPreparedCommand class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedCommand.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TpreparedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedStatement.php 3261 2013-01-22 22:36:51Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
public function setPreparedSql($value){ $this->_sqlString = $value; }
public function getParameterNames($needed = true)
- {
+ {
if (!$this->_parameterNames and $needed)
$this->_parameterNames = new TList;
- return $this->_parameterNames;
+ return $this->_parameterNames;
}
public function setParameterNames($value){ $this->_parameterNames = $value; }
public function getParameterValues($needed = true)
- {
+ {
if (!$this->_parameterValues and $needed)
$this->_parameterValues=new TMap;
- return $this->_parameterValues;
+ return $this->_parameterValues;
}
public function setParameterValues($value){ $this->_parameterValues = $value; }
-
+
public function __sleep()
{
- $exprops = array(); $cn = __CLASS__;
+ $exprops = array(); $cn = __CLASS__;
if (!$this->_parameterNames or !$this->_parameterNames->getCount()) $exprops[] = "\0$cn\0_parameterNames";
if (!$this->_parameterValues or !$this->_parameterValues->getCount()) $exprops[] = "\0$cn\0_parameterValues";
return array_diff(parent::__sleep(),$exprops);
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TPreparedStatementFactory class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TPreparedStatementFactory.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TSelectMappedStatment class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSelectMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TSimpleDynamicSql class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSimpleDynamicSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TStaticSql class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TStaticSql.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
*/
* TUpdateMappedStatement class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TUpdateMappedStatement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap.Statements
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* Database connection and TSqlMapManager configuration.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TSqlMapConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* This class should be instantiated from a TSqlMapManager instance.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapGateway.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSqlMapManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data.SqlMap
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
* that extends the TDbConnection class.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id: TDataSourceConfig.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
* You may also call {@link prepare} to explicitly prepare an SQL statement.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbCommand.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
*/
public function __sleep()
{
- return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement"));
+ return array_diff(parent::__sleep(),array("\0TDbCommand\0_statement"));
}
/**
* the form :name. For a prepared statement using question mark
* placeholders, this will be the 1-indexed position of the parameter.
* Unlike {@link bindValue}, the variable is bound as a reference and will
- * only be evaluated at the time that {@link execute} or {@link query} is called.
+ * only be evaluated at the time that {@link execute} or {@link query} is called.
* @param mixed Name of the PHP variable to bind to the SQL statement parameter
* @param int SQL data type of the parameter
* @param int length of the data type
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
* of certain DBMS attributes, such as {@link getNullConversion NullConversion}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
public function __sleep()
{
// $this->close(); - DO NOT CLOSE the current connection as serializing doesn't neccessarily mean we don't this connection anymore in the current session
- return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active"));
+ return array_diff(parent::__sleep(),array("\0TDbConnection\0_pdo","\0TDbConnection\0_active"));
}
/**
// Ignore the warning if a driver doesn't understand this.
@$this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $this->_pdo->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
$this->_active=true;
$this->setConnectionCharset();
}
* TDbColumnCaseMode
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
* TDbNullConversionMode
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbConnection.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
* for more details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbDataReader.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbTransaction.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Data
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
*/
* <module id="error" class="TErrorHandler" ErrorTemplatePath="System.Exceptions" />
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TErrorHandler.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
*/
* "message.txt" will be used instead.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
$msgFile=$this->getErrorMessageFile();
// Cache messages
- if (!isset(self::$_messageCache[$msgFile]))
+ if (!isset(self::$_messageCache[$msgFile]))
{
if(($entries=@file($msgFile))!==false)
{
* TSystemException is the base class for all framework-level exceptions.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TApplicationException is the base class for all user application-level exceptions.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TInvalidOperationException represents an exception caused by invalid operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TInvalidDataTypeException represents an exception caused by invalid data type.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TInvalidDataValueException represents an exception caused by invalid data value.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* such as error in an application configuration file or control template file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TTemplateException represents an exception caused by invalid template syntax.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.1
*/
* TIOException represents an exception related with improper IO operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TDbException represents an exception related with DB operations.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TDbConnectionException represents an exception caused by DB connection failure.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* TNotSupportedException represents an exception caused by using an unsupported PRADO feature.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* This exception is mainly thrown within a PHP error handler.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
* It is used by {@link TErrorHandler} to provide different error output to users.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TException.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Exceptions
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TChoiceFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
* # <tt>&</tt> -- conditional AND.
* # <tt>&&</tt> -- condition AND with short circuit.
* # <tt>|</tt> -- conditional OR.
- * # <tt>||</tt> -- conditional OR with short circuit.
+ * # <tt>||</tt> -- conditional OR with short circuit.
* # <tt>!</tt> -- negation.
*
* Additional round brackets can also be used to perform grouping.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDateFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
{
$this->setViewState('Value',$value,'');
}
-
+
/**
* Get the default text value for this control.
* @return string default text value
{
return $this->getViewState('DefaultText','');
}
-
+
/**
* Set the default text value for this control.
* @param string default text value
$defaultText = $this->getDefaultText();
if(empty($value) && !empty($defaultText))
return $this->getDefaultText();
-
+
$app = $this->getApplication()->getGlobalization();
//initialized the default class wide formatter
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TGlobalization.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
* @package System.I18N
parent::init($xml);
//set the culture according to browser language settings
- $http = new HTTPNegotiator();
+ $http = new HTTPNegotiator();
$languages = $http->getLanguages();
if(count($languages) > 0)
{
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TI18NControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TNumberFormat.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
{
return $this->getViewState('DefaultText','');
}
-
+
/**
* Set the default text value for this control.
* @param string default text value
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslate.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
$catalogue = $config['catalogue'];
if (empty($catalogue)) $catalogue='messages';
Translation::init($catalogue);
-
+
$key = $this->getKey();
if(!empty($key)) $text = $key;
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTranslateParameter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Translation.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.I18N
*/
public static function init($catalogue='messages')
{
static $saveEventHandlerAttached=false;
-
+
//initialized the default class wide formatter
if(!isset(self::$formatters[$catalogue]))
{
* {@link http://prado.sourceforge.net/}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
* For example, Australian English is "en_AU".
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: CultureInfo.php 3187 2012-07-12 11:21:01Z ctrlaltca $
* @package System.I18N.core
*/
class CultureInfo
/**
* File::Gettext
- *
+ *
* @author Michael Wallner <mike@php.net>
* @license PHP License
*/
*/
//ini_set('track_errors', true);
-/**
+/**
* File_Gettext
- *
+ *
* GNU gettext file reader and writer.
- *
+ *
* #################################################################
* # All protected members of this class are public in its childs. #
* #################################################################
* @author Michael Wallner <mike@php.net>
* @version $Revision: 1.4 $
* @access public
- * @package System.I18N.core
+ * @package System.I18N.core
*/
class TGettext
{
/**
* strings
- *
+ *
* associative array with all [msgid => msgstr] entries
- *
+ *
* @access protected
* @var array
*/
/**
* meta
- *
- * associative array containing meta
+ *
+ * associative array containing meta
* information like project name or content type
- *
+ *
* @access protected
* @var array
*/
protected $meta = array();
-
+
/**
* file path
- *
+ *
* @access protected
* @var string
*/
protected $file = '';
-
+
/**
* Factory
*
* @static
* @access public
- * @return object Returns File_Gettext_PO or File_Gettext_MO on success
+ * @return object Returns File_Gettext_PO or File_Gettext_MO on success
* or PEAR_Error on failure.
* @param string $format MO or PO
* @param string $file path to GNU gettext file
*/
- function factory($format, $file = '')
+ static function factory($format, $file = '')
{
$format = strToUpper($format);
$filename = dirname(__FILE__).'/'.$format.'.php';
if(is_file($filename) == false)
throw new Exception ("Class file $file not found");
-
+
include_once $filename;
$class = 'TGettext_' . $format;
*
* That's a simple fake of the 'msgfmt' console command. It reads the
* contents of a GNU PO file and saves them to a GNU MO file.
- *
+ *
* @static
* @access public
* @return mixed Returns true on success or PEAR_Error on failure.
* @param string $pofile path to GNU PO file
* @param string $mofile path to GNU MO file
*/
- function poFile2moFile($pofile, $mofile)
+ static function poFile2moFile($pofile, $mofile)
{
if (!is_file($pofile)) {
throw new Exception("File $pofile doesn't exist.");
}
-
+
include_once dirname(__FILE__).'/PO.php';
-
+
$PO = new TGettext_PO($pofile);
if (true !== ($e = $PO->load())) {
return $e;
}
-
+
$MO = $PO->toMO();
if (true !== ($e = $MO->save($mofile))) {
return $e;
}
unset($PO, $MO);
-
+
return true;
}
-
+
/**
* prepare
*
* @param string $string
* @param bool $reverse
*/
- function prepare($string, $reverse = false)
+ static function prepare($string, $reverse = false)
{
if ($reverse) {
$smap = array('"', "\n", "\t", "\r");
return (string) str_replace($smap, $rmap, $string);
}
}
-
+
/**
* meta2array
*
* @return array
* @param string $meta
*/
- function meta2array($meta)
+ static function meta2array($meta)
{
$array = array();
foreach (explode("\n", $meta) as $info) {
/**
* toArray
- *
+ *
* Returns meta info and strings as an array of a structure like that:
* <code>
* array(
* )
* )
* </code>
- *
+ *
* @see fromArray()
* @access protected
* @return array
{
return array('meta' => $this->meta, 'strings' => $this->strings);
}
-
+
/**
* fromArray
- *
+ *
* Assigns meta info and strings from an array of a structure like that:
* <code>
* array(
* )
* )
* </code>
- *
+ *
* @see toArray()
* @access protected
* @return bool
}
return true;
}
-
+
/**
* toMO
*
$MO->fromArray($this->toArray());
return $MO;
}
-
+
/**
* toPO
*
/**
* Translation table cache.
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.I18N.core
*/
* It can cache each cataloug+variant or just the whole section.
* @package System.I18N.core
* @author $Author: weizhuo $
- * @version $Id: MessageCache.php 3188 2012-07-12 12:13:23Z ctrlaltca $
*/
-class MessageCache
+class MessageCache
{
/**
* Caceh life time, default is 1 year.
*/
protected $lifetime = 3153600;
-
+
/**
* Create a new Translation cache.
* @param string $cacheDir Directory to store the cache files.
*/
public function __construct($cacheDir)
- {
+ {
$cacheDir = $cacheDir.'/';
-
+
if(!is_dir($cacheDir))
throw new Exception(
'The cache directory '.$cacheDir.' does not exists.'.
throw new Exception(
'The cache directory '.$cacheDir.' must be writable '.
'by the server.');
-
+
$options = array(
'cacheDir' => $cacheDir,
'lifeTime' => $this->getLifeTime(),
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
* @param string $filename If the source is a file, this file's modified
- * time is newer than the cache's modified time, no cache hit.
+ * time is newer than the cache's modified time, no cache hit.
* @return mixed Boolean FALSE if no cache hit. Otherwise, translation
* table data for the specified section and locale.
*/
- public function get($catalogue, $culture, $lastmodified=0)
+ public function get($catalogue, $culture, $lastmodified=0)
{
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->_setFileName($ID, $group);
$cache = $this->cache->getCacheFile();
-
- if(is_file($cache) == false)
+
+ if(is_file($cache) == false)
return false;
$lastmodified = (int)$lastmodified;
-
+
if($lastmodified <= 0 || $lastmodified > filemtime($cache))
- return false;
-
+ return false;
+
//echo '@@ Cache hit: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->get($ID, $group);
}
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function save($data, $catalogue, $culture)
- {
+ public function save($data, $catalogue, $culture)
+ {
$ID = $this->getID($catalogue, $culture);
- $group = $this->getGroup($catalogue, $culture);
-
+ $group = $this->getGroup($catalogue, $culture);
+
//echo '## Cache save: "'.$ID.'" : "'.$group.'"';
//echo "<br>\n";
-
+
return $this->cache->save($data, $ID, $group);
}
-
+
/**
* Clean up the cache for the specified section and locale.
* @param string $catalogue The translation section.
* @param string $culture The translation locale, e.g. "en_AU".
*/
- public function clean($catalogue, $culture)
+ public function clean($catalogue, $culture)
{
- $group = $this->getGroup($catalogue, $culture);
+ $group = $this->getGroup($catalogue, $culture);
$this->cache->clean($group);
}
-
+
/**
* Flush the cache. Deletes all the cache files.
*/
* Mike BENOIT <ipso@snappymail.ca>
*
* @package System.I18N.core
-* @version $Id: TCache_Lite.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @author Fabien MARTY <fab@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.gnu.org/copyleft/lesser.html GNU LGPL
*
* @author Vincent Blavet <vincent@phpconcept.net>
* @copyright Copyright © 1997-2003 The PHP Group
- * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.IO
*/
* TTarFileExtractor class
*
* @author Vincent Blavet <vincent@phpconcept.net>
- * @version $Id: TTarFileExtractor.php 3188 2012-07-12 12:13:23Z ctrlaltca $
* @package System.IO
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.IO
*/
* and can be obtained by calling {@link flush()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.IO
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $
* @package System
*/
* rewritten for customization.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: PradoBase.php 3325 2013-09-13 08:19:04Z ctrlaltca $
* @package System
* @since 3.0
*/
*/
public static function getVersion()
{
- return '3.2.3';
+ return '3.2.4';
}
/**
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
* and {@link TUser}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: IUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
* To login or logout a user, call {@link login} or {@link logout}, respectively.
*
* The {@link setAuthExpire AuthExpire} property can be used to define the time
- * in seconds after which the authentication should expire.
+ * in seconds after which the authentication should expire.
* {@link setAllowAutoLogin AllowAutoLogin} specifies if the login information
* should be stored in a cookie to perform automatic login. Enabling this
* feature will cause that {@link setAuthExpire AuthExpire} has no effect
* <module id="users" class="System.Security.TUserManager" />
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
$user=$this->_userManager->getUser(null)->loadFromString($sessionInfo);
// check for authentication expiration
- $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
+ $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time();
// try authenticating through cookie if possible
if($this->hasEventHandler('OnAuthenticate'))
$this->raiseEvent('OnAuthenticate',$this,$application);
}
-
+
/**
* Performs user logout on authentication expiration.
* An 'OnAuthExpire' event will be raised if there is any handler attached to it.
if($this->hasEventHandler('OnAuthExpire'))
$this->raiseEvent('OnAuthExpire',$this,$param);
}
-
+
/**
* Performs the real authorization work.
* Authorization rules obtained from the application will be used to check
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
/**
* IP rules are separated by comma ',' and can contain wild card in the rules (e.g. '192.132.23.33, 192.122.*.*')
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
* To check if a user is allowed, call {@link isUserAllowed}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAuthorizationRule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
* which specifies how to establish database connection to retrieve user information.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.1.0
*/
* - {@link createUser()}: creates a new user instance given the username
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDbUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
* Note, to use encryption, the PHP Mcrypt extension must be loaded.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
* - SHA1: an SHA1 hash is generated from the data and used for validation.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSecurityManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
* TUser is meant to be used together with {@link IUserManager}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TUser.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl Mathisen <carl@kamikazemedia.no>
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0
*/
*/
public function init($config)
{
- $this->loadUserData($config);
+ $this->loadUserData($config);
if($this->_userFile!==null)
{
if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
}
$this->_initialized=true;
}
-
+
/*
* Loads user/role information
* @param mixed the variable containing the user information
* - SHA1: the password is recorded as the SHA1 hash value of the original password
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TUserManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Security
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
/**
* File extension for external config files
*/
- const CONFIG_FILE_EXT_XML='.xml';
+ const CONFIG_FILE_EXT_XML='.xml';
/**
* Configuration file type, application.xml and config.xml
*/
* @var TApplicationMode application mode
*/
private $_mode=TApplicationMode::Debug;
-
+
/**
* @var string Customizable page service ID
*/
$this->_uniqueID=md5($this->_runtimePath);
$this->_parameters=new TMap;
$this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
-
+
Prado::setPathOfAlias('Application',$this->_basePath);
}
{
$this->_id=$value;
}
-
+
/**
* @return string page service ID
*/
{
$this->_configType = $value;
}
-
+
/**
* @return string the application configuration type. default is 'xml'
*/
}
return $this->_configFileExt;
}
-
+
/**
* @return string the default configuration file name
*/
foreach($config->getProperties() as $name=>$value)
$this->setSubProperty($name,$value);
}
-
+
if(empty($this->_services))
$this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null)
$serviceID=$this->getPageServiceID();
-
+
$this->startService($serviceID);
}
* - Normal: the application is running in normal production mode.
* - Performance: the application is running in performance mode.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
$this->_properties[$name]=$value;
}
$this->_empty = false;
- }
+ }
if(isset($config['paths']) && is_array($config['paths']))
$this->loadPathsPhp($config['paths'],$configPath);
if(isset($config['parameters']) && is_array($config['parameters']))
$this->loadParametersPhp($config['parameters'], $configPath);
-
+
if(isset($config['includes']) && is_array($config['includes']))
$this->loadExternalXml($config['includes'],$configPath);
}
$properties['id'] = $id;
$this->_modules[$id]=array($type,$properties,$module);
$this->_empty=false;
- }
+ }
}
/**
$properties['id'] = $id;
$this->_services[$id] = array($type,$properties,$service);
$this->_empty = false;
- }
+ }
}
/**
* Cache will be exploited if it is enabled.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplication.php 3317 2013-09-03 10:19:09Z ctrlaltca $
* @package System
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* publishing private files: {@link publishAsset} and {@link publishFilePath}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TApplicationComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* TComponent, TPropertyValue classes
*
* @author Qiang Xue <qiang.xue@gmail.com>
- *
+ *
* Global Events, intra-object events, Class behaviors, expanded behaviors
* @author Brad Anderson <javalizard@mac.com>
- *
+ *
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* </code>
* Js-friendly properties can be accessed using both their Js-less name and their Js-enabled name:
* <code>
- * // set some simple text as property value
+ * // set some simple text as property value
* $component->Text = 'text';
* // set some javascript code as property value
* $component->JsText = 'raw javascript';
* clientside inside a javascript block.
* In the second case, the property will be 'marked' as being a safe javascript
* statement and will not be encoded when rendered inside a javascript block.
- * This special handling makes use of the {@link TJavaScriptLiteral} class.
+ * This special handling makes use of the {@link TJavaScriptLiteral} class.
*
* Events
*
* - array($object,'buttonClicked') : $object->buttonClicked($sender,$param);
* - array($object,'MainContent.SubmitButton.buttonClicked') :
* $object->MainContent->SubmitButton->buttonClicked($sender,$param);
- *
- * With the addition of behaviors, a more expansive event model is needed. There
- * are two new event types (global and dynamic events) as well as a more comprehensive
+ *
+ * With the addition of behaviors, a more expansive event model is needed. There
+ * are two new event types (global and dynamic events) as well as a more comprehensive
* behavior model that includes class wide behaviors.
*
* A global event is defined by all events whose name starts with 'fx'.
- * The event name is potentially a method name and is thus case-insensitive. All 'fx' events
+ * The event name is potentially a method name and is thus case-insensitive. All 'fx' events
* are valid as the whole 'fx' event/method space is global in nature. Any object may patch into
- * any global event by defining that event as a method. Global events have priorities
- * just like 'on' events; so as to be able to order the event execution. Due to the
- * nature of all events which start with 'fx' being valid, in effect, every object
- * has every 'fx' global event. It is simply an issue of tapping into the desired
+ * any global event by defining that event as a method. Global events have priorities
+ * just like 'on' events; so as to be able to order the event execution. Due to the
+ * nature of all events which start with 'fx' being valid, in effect, every object
+ * has every 'fx' global event. It is simply an issue of tapping into the desired
* global event.
*
* A global event that starts with 'fx' can be called even if the object does not
* implement the method of the global event. A call to a non-existing 'fx' method
- * will, at minimal, function and return null. If a method argument list has a first
+ * will, at minimal, function and return null. If a method argument list has a first
* parameter, it will be returned instead of null. This allows filtering and chaining.
* 'fx' methods do not automatically install and uninstall. To install and uninstall an
- * object's global event listeners, call the object's {@link listen} and
+ * object's global event listeners, call the object's {@link listen} and
* {@link unlisten} methods, respectively. An object may auto-install its global event
* during {@link __construct} by overriding {@link getAutoGlobalListen} and returning true.
- *
+ *
* As of PHP version 5.3, nulled objects without code references will still continue to persist
* in the global event queue because {@link __destruct} is not automatically called. In the common
* __destruct method, if an object is listening to global events, then {@link unlisten} is called.
* {@link unlisten} is required to be manually called before an object is
- * left without references if it is currently listening to any global events. This includes
+ * left without references if it is currently listening to any global events. This includes
* class wide behaviors.
*
- * An object that contains a method that starts with 'fx' will have those functions
+ * An object that contains a method that starts with 'fx' will have those functions
* automatically receive those events of the same name after {@link listen} is called on the object.
*
- * An object may listen to a global event without defining an 'fx' method of the same name by
+ * An object may listen to a global event without defining an 'fx' method of the same name by
* adding an object method to the global event list. For example
* <code>
* $component->fxGlobalCheck=$callback; // or $component->OnClick->add($callback);
*
* Events between Objects and their behaviors, Dynamic Events
*
- * An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
+ * An intra-object/behavior event is defined by methods that start with 'dy'. Just as with
* 'fx' global events, every object has every dynamic event. Any call to a method that
- * starts with 'dy' will be handled, regardless of whether it is implemented. These
+ * starts with 'dy' will be handled, regardless of whether it is implemented. These
* events are for communicating with attached behaviors.
- *
+ *
* Dynamic events can be used in a variety of ways. They can be used to tell behaviors
* when a non-behavior method is called. Dynamic events could be used as data filters.
- * They could also be used to specify when a piece of code is to be run, eg. should the
+ * They could also be used to specify when a piece of code is to be run, eg. should the
* loop process be performed on a particular piece of data. In this way, some control
* is handed to the behaviors over the process and/or data.
- *
+ *
* If there are no handlers for an 'fx' or 'dy' event, it will return the first
* parameter of the argument list. If there are no arguments, these events
* will return null. If there are handlers an 'fx' method will be called directly
* within the object. Global 'fx' events are triggered by calling {@link raiseEvent}.
- * For dynamic events where there are behaviors that respond to the dynamic events, a
+ * For dynamic events where there are behaviors that respond to the dynamic events, a
* {@link TCallChain} is developed. A call chain allows the behavior dynamic event
* implementations to call further implementing behaviors within a chain.
- *
- * If an object implements {@link IDynamicMethods}, all global and object dynamic
- * events will be sent to {@link __dycall}. In the case of global events, all
+ *
+ * If an object implements {@link IDynamicMethods}, all global and object dynamic
+ * events will be sent to {@link __dycall}. In the case of global events, all
* global events will trigger this method. In the case of behaviors, all undefined
* dynamic events which are called will be passed through to this method.
*
*
* There are two types of behaviors. There are individual object behaviors and
* there are class wide behaviors. Class behaviors depend upon object behaviors.
- *
+ *
* When a new class implements {@link IBehavior} or {@link IClassBehavior} or
- * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an
+ * extends {@link TBehavior} or {@link TClassBehavior}, it may be added to an
* object by calling the object's {@link attachBehavior}. The behaviors associated
- * name can then be used to {@link enableBehavior} or {@link disableBehavior}
+ * name can then be used to {@link enableBehavior} or {@link disableBehavior}
* the specific behavior.
*
- * All behaviors may be turned on and off via {@link enableBehaviors} and
+ * All behaviors may be turned on and off via {@link enableBehaviors} and
* {@link disableBehaviors}, respectively. To check if behaviors are on or off
* a call to {@link getBehaviorsEnabled} will provide the variable.
- *
- * Attaching and detaching whole sets of behaviors is done using
+ *
+ * Attaching and detaching whole sets of behaviors is done using
* {@link attachBehaviors} and {@link detachBehaviors}. {@link clearBehaviors}
* removes all of an object's behaviors.
*
* {@link asa} returns a behavior of a specific name. {@link isa} is the
* behavior inclusive function that acts as the PHP operator {@link instanceof}.
* A behavior could provide the functionality of a specific class thus causing
- * the host object to act similarly to a completely different class. A behavior
- * would then implement {@link IInstanceCheck} to provide the identity of the
+ * the host object to act similarly to a completely different class. A behavior
+ * would then implement {@link IInstanceCheck} to provide the identity of the
* different class.
*
- * Class behaviors are similar to object behaviors except that the class behavior
+ * Class behaviors are similar to object behaviors except that the class behavior
* is the implementation for all instances of the class. A class behavior
* will have the object upon which is being called be prepended to the parameter
* list. This way the object is known across the class behavior implementation.
* using {@link detachClassBehavior}. Class behaviors are important in that
* they will be applied to all new instances of a particular class. In this way
* class behaviors become default behaviors to a new instances of a class in
- * {@link __construct}. Detaching a class behavior will remove the behavior
+ * {@link __construct}. Detaching a class behavior will remove the behavior
* from the default set of behaviors created for an object when the object
* is instanced.
*
- * Class behaviors are also added to all existing instances via the global 'fx'
- * event mechanism. When a new class behavior is added, the event
+ * Class behaviors are also added to all existing instances via the global 'fx'
+ * event mechanism. When a new class behavior is added, the event
* {@link fxAttachClassBehavior} is raised and all existing instances that are
* listening to this global event (primarily after {@link listen} is called)
* will have this new behavior attached. A similar process is used when
*
* Dynamic events start with 'dy'. This mechanism is used to allow objects
* to communicate with their behaviors directly. The entire 'dy' event space
- * is valid. All attached, enabled behaviors that implement a dynamic event
- * are called when the host object calls the dynamic event. If there is no
+ * is valid. All attached, enabled behaviors that implement a dynamic event
+ * are called when the host object calls the dynamic event. If there is no
* implementation or behaviors, this returns null when no parameters are
* supplied and will return the first parameter when there is at least one
* parameter in the dynamic event.
* 5 == $this->dyBehaviorEvent(5); //when no behaviors implement this dynamic event
* </code>
*
- * Dynamic events can be chained together within behaviors to allow for data
+ * Dynamic events can be chained together within behaviors to allow for data
* filtering. Dynamic events are implemented within behaviors by defining the
* event as a method.
* <code>
* }
* }
* </code>
- * This implementation of a behavior and dynamic event will flow through to the
- * next behavior implementing the dynamic event. The first parameter is always
+ * This implementation of a behavior and dynamic event will flow through to the
+ * next behavior implementing the dynamic event. The first parameter is always
* return when it is supplied. Otherwise a dynamic event returns null.
*
* In the case of a class behavior, the object is also prepended to the dynamic
*
* Global Event and Dynamic event catching
*
- * Given that all global 'fx' events and dynamic 'dy' events are valid and
+ * Given that all global 'fx' events and dynamic 'dy' events are valid and
* operational, there is a mechanism for catching events called that are not
* implemented (similar to the built-in PHP method {@link __call}). When
- * a dynamic or global event is called but a behavior does not implement it,
- * yet desires to know when an undefined dynamic event is run, the behavior
+ * a dynamic or global event is called but a behavior does not implement it,
+ * yet desires to know when an undefined dynamic event is run, the behavior
* implements the interface {@link IDynamicMethods} and method {@link __dycall}.
*
- * In the case of dynamic events, {@link __dycall} is supplied with the method
+ * In the case of dynamic events, {@link __dycall} is supplied with the method
* name and its parameters. When a global event is raised, via {@link raiseEvent},
* the method is the event name and the parameters are supplied.
*
* When implemented, this catch-all mechanism is called for event global event event
* when implemented outside of a behavior. Within a behavior, it will also be called
- * when the object to which the behavior is attached calls any unimplemented dynamic
- * event. This is the fall-back mechanism for informing a class and/or behavior
+ * when the object to which the behavior is attached calls any unimplemented dynamic
+ * event. This is the fall-back mechanism for informing a class and/or behavior
* of when an global and/or undefined dynamic event is executed.
- *
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Brad Anderson <javalizard@mac.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* @var array event handler lists
*/
private $_e=array();
-
+
/**
- * @var boolean if listening is enabled. Automatically turned on or off in
+ * @var boolean if listening is enabled. Automatically turned on or off in
* constructor according to {@link getAutoGlobalListen}. Default false, off
*/
private $_listeningenabled=false;
-
+
/**
* @var array static registered global event handler lists
*/
private static $_ue=array();
-
+
/**
* @var boolean if object behaviors are on or off. default true, on
*/
* @var TPriorityMap list of object behaviors
*/
private $_m=null;
-
+
/**
* @var array static global class behaviors, these behaviors are added upon instantiation of a class
*/
private static $_um=array();
-
-
+
+
/**
* @const string the name of the global {@link raiseEvent} listener
*/
/**
* The common __construct
- * If desired by the new object, this will auto install and listen to global event functions
+ * If desired by the new object, this will auto install and listen to global event functions
* as defined by the object via 'fx' methods. This also attaches any predefined behaviors.
* This function installs all class behaviors in a class hierarchy from the deepest subclass
* through each parent to the top most class, TComponent.
public function __construct() {
if($this->getAutoGlobalListen())
$this->listen();
-
+
$classes=array_reverse($this->getClassHierarchy(true));
foreach($classes as $class) {
if(isset(self::$_um[$class]))
$this->attachBehaviors(self::$_um[$class]);
}
}
-
-
+
+
/**
* Tells TComponent whether or not to automatically listen to global events.
* Defaults to false because PHP variable cleanup is affected if this is true.
* When unsetting a variable that is listening to global events, {@link unlisten}
* must explicitly be called when cleaning variables allocation or else the global
* event registry will contain references to the old object. This is true for PHP 5.4
- *
+ *
* Override this method by a subclass to change the setting. When set to true, this
* will enable {@link __construct} to call {@link listen}.
*
if($this->_listeningenabled)
$this->unlisten();
}
-
-
+
+
/**
- * This utility function is a private array filter method. The array values
+ * This utility function is a private array filter method. The array values
* that start with 'fx' are filtered in.
*/
private function filter_prado_fx($name) {
return strncasecmp($name,'fx',2)===0;
}
-
-
+
+
/**
- * This returns an array of the class name and the names of all its parents. The base object first,
+ * This returns an array of the class name and the names of all its parents. The base object first,
* {@link TComponent}, and the deepest subclass is last.
* @param boolean optional should the names be all lowercase true/false
* @return array array of strings being the class hierarchy of $this.
return array_map('strtolower',$classes);
return $classes;
}
-
-
+
+
/**
- * This adds an object's fx event handlers into the global broadcaster to listen into any
+ * This adds an object's fx event handlers into the global broadcaster to listen into any
* broadcast global events called through {@link raiseEvent}
*
* Behaviors may implement the function:
public function listen() {
if($this->_listeningenabled)
return;
-
+
$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
-
+
foreach($fx as $func)
$this->attachEventHandler($func,array($this,$func));
-
+
if(is_a($this,'IDynamicMethods')) {
$this->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
}
-
+
$this->_listeningenabled=true;
-
+
$this->dyListen($fx);
-
+
return count($fx);
}
-
+
/**
* this removes an object's fx events from the global broadcaster
*
public function unlisten() {
if(!$this->_listeningenabled)
return;
-
+
$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
-
+
foreach($fx as $func)
$this->detachEventHandler($func,array($this,$func));
-
+
if(is_a($this,'IDynamicMethods')) {
$this->detachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
}
-
+
$this->_listeningenabled=false;
-
+
$this->dyUnlisten($fx);
-
+
return count($fx);
}
-
+
/**
* Gets the state of listening to global events
* @return boolean is Listening to global broadcast enabled
{
return $this->_listeningenabled;
}
-
+
/**
* Calls a method.
* Do not call this method directly. This is a PHP magic method that we override
- * to allow behaviors, dynamic events (intra-object/behavior events),
+ * to allow behaviors, dynamic events (intra-object/behavior events),
* undefined dynamic and global events, and
* to allow using the following syntax to call a property setter or getter.
* <code>
* @param mixed method parameters
* @throws TInvalidOperationException If the property is not defined or read-only or
* method is undefined
- * @return mixed result of the method call, or false if 'fx' or 'dy' function but
+ * @return mixed result of the method call, or false if 'fx' or 'dy' function but
* is not found in the class, otherwise it runs
*/
public function __call($method, $args)
if (($getset=='set')&&method_exists($this,'getjs'.$propname))
throw new TInvalidOperationException('component_property_readonly',get_class($this),$method);
}
-
+
if($this->_m!==null&&$this->_behaviorsenabled)
{
if(strncasecmp($method,'dy',2)===0)
array_unshift($behavior_args,$this);
$callchain->addCall(array($behavior,$method),$behavior_args);
}
-
+
}
if($callchain->getCount()>0)
return call_user_func_array(array($callchain,'call'),$args);
}
}
}
-
+
if(strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0)
{
if($this instanceof IDynamicMethods)
return $this->__dycall($method,$args);
return isset($args[0])?$args[0]:null;
}
-
+
throw new TApplicationException('component_method_undefined',get_class($this),$method);
}
}
}
if($sets)return $value;
-
+
}
-
+
if(method_exists($this,'get'.$name)||method_exists($this,'getjs'.$name))
{
throw new TInvalidOperationException('component_property_readonly',get_class($this),$name);
/**
* Checks if a property value is null, there are no events in the object
- * event list or global event list registered under the name, and, if
- * behaviors are enabled,
+ * event list or global event list registered under the name, and, if
+ * behaviors are enabled,
* Do not call this method. This is a PHP magic method that we override
* to allow using isset() to detect if a component property is set or not.
- * This also works for global events. When behaviors are enabled, it
- * will check for a behavior of the specified name, and also check
+ * This also works for global events. When behaviors are enabled, it
+ * will check for a behavior of the specified name, and also check
* the behavior for events and properties.
* @param string the property name or the event name
* @since 3.2.3
if((!($behavior instanceof IBehavior)||$behavior->getEnabled()))
return isset($behavior->$name);
}
-
+
}
else
return false;
/**
* Sets a component property to be null. Clears the object or global
- * events. When enabled, loops through all behaviors and unsets the
+ * events. When enabled, loops through all behaviors and unsets the
* property or event.
* Do not call this method. This is a PHP magic method that we override
* to allow using unset() to set a component property to be null.
/**
* Determines whether an event is defined.
- * An event is defined if the class has a method whose name is the event name
+ * An event is defined if the class has a method whose name is the event name
* prefixed with 'on', 'fx', or 'dy'.
- * Every object responds to every 'fx' and 'dy' event as they are in a universally
+ * Every object responds to every 'fx' and 'dy' event as they are in a universally
* accepted event space. 'on' event must be declared by the object.
* When enabled, this will loop through all active behaviors for 'on' events
* defined by the behavior.
{
if((strncasecmp($name,'on',2)===0&&method_exists($this,$name))||strncasecmp($name,'fx',2)===0||strncasecmp($name,'dy',2)===0)
return true;
-
+
else if($this->_m!==null&&$this->_behaviorsenabled)
{
foreach($this->_m->toArray() as $behavior)
}
/**
- * Checks if an event has any handlers. This function also checks through all
+ * Checks if an event has any handlers. This function also checks through all
* the behaviors for 'on' events when behaviors are enabled.
- * 'dy' dynamic events are not handled by this function.
+ * 'dy' dynamic events are not handled by this function.
* @param string the event name
* @return boolean whether an event has been attached one or several handlers
*/
}
/**
- * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also
+ * Returns the list of attached event handlers for an 'on' or 'fx' event. This function also
* checks through all the behaviors for 'on' event lists when behaviors are enabled.
* @return TPriorityList list of attached event handlers for an event
* @throws TInvalidOperationException if the event is not defined
* function handlerName($sender, $param, $name) {}
* </code>
* where $sender represents the object that raises the event,
- * and $param is the event parameter. $name refers to the event name
+ * and $param is the event parameter. $name refers to the event name
* being handled.
*
* This is a convenient method to add an event handler.
*
* @param string the event name
* @param callback the event handler
- * @param numeric|null the priority of the handler, defaults to null which translates into the
+ * @param numeric|null the priority of the handler, defaults to null which translates into the
* default priority of 10.0 within {@link TPriorityList}
* @throws TInvalidOperationException if the event does not exist
*/
/**
* Detaches an existing event handler.
- * This method is the opposite of {@link attachEventHandler}. It will detach
+ * This method is the opposite of {@link attachEventHandler}. It will detach
* any 'on' events definedb by an objects active behaviors as well.
* @param string event name
* @param callback the event handler to be removed
- * @param numeric|false|null the priority of the handler, defaults to false which translates
+ * @param numeric|false|null the priority of the handler, defaults to false which translates
* to an item of any priority within {@link TPriorityList}; null means the default priority
* @return boolean if the removal is successful
*/
* This method represents the happening of an event and will
* invoke all attached event handlers for the event in {@link TPriorityList} order.
* This method does not handle intra-object/behavior dynamic 'dy' events.
- *
- * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER},
- * all event responses are stored in an array, filtered for null responses, and returned.
- * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along
+ *
+ * There are ways to handle event responses. By defailt {@link EVENT_RESULT_FILTER},
+ * all event responses are stored in an array, filtered for null responses, and returned.
+ * If {@link EVENT_RESULT_ALL} is specified, all returned results will be stored along
* with the sender and param in an array
* <code>
* $result[] = array('sender'=>$sender,'param'=>$param,'response'=>$response);
* fed forward as the parameters for the next event. This allows for events to filter data
* directly by affecting the event parameters
*
- * If a callable function is set in the response type or the post function filter is specified then the
+ * If a callable function is set in the response type or the post function filter is specified then the
* result of each called event handler is post processed by the callable function. Used in
* combination with {@link EVENT_RESULT_FEED_FORWARD}, any event (and its result) can be chained.
*
- * When raising a global 'fx' event, registered handlers in the global event list for
+ * When raising a global 'fx' event, registered handlers in the global event list for
* {@link GLOBAL_RAISE_EVENT_LISTENER} are always added into the set of event handlers. In this way,
- * these global events are always raised for every global 'fx' event. The registered handlers for global
- * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero
+ * these global events are always raised for every global 'fx' event. The registered handlers for global
+ * raiseEvent events have priorities. Any registered global raiseEvent event handlers with a priority less than zero
* are added before the main event handlers being raised and any registered global raiseEvent event handlers
* with a priority equal or greater than zero are added after the main event handlers being raised. In this way
* all {@link GLOBAL_RAISE_EVENT_LISTENER} handlers are always called for every raised 'fx' event.
* dyPreRaiseEvent has the effect of being able to change the event being raised. This intra
* object/behavior event returns the name of the desired event to be raised. It will pass through
* if no dynamic event is specified, or if the original event name is returned.
- * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be
+ * dyIntraRaiseEventTestHandler returns true or false as to whether a specific handler should be
* called for a specific raised event (and associated event arguments)
* dyIntraRaiseEventPostHandler does not return anything. This allows behaviors to access the results
* of an event handler in the per handler loop.
* dyPostRaiseEvent returns the responses. This allows for any post processing of the event
* results from the sum of all event handlers
*
- * When handling a catch-all {@link __dycall}, the method name is the name of the event
+ * When handling a catch-all {@link __dycall}, the method name is the name of the event
* and the parameters are the sender, the param, and then the name of the event.
- *
+ *
* @param string the event name
* @param mixed the event sender object
* @param TEventParameter the event parameter
* @param numeric how the results of the event are tabulated. default: {@link EVENT_RESULT_FILTER} The default filters out
* null responses. optional
- * @param function any per handler filtering of the response result needed is passed through
+ * @param function any per handler filtering of the response result needed is passed through
* this if not null. default: null. optional
* @return mixed the results of the event
* @throws TInvalidOperationException if the event is undefined
$postfunction=$responsetype;
$responsetype=null;
}
-
+
if($responsetype===null)
$responsetype=TEventResults::EVENT_RESULT_FILTER;
-
+
$name=strtolower($name);
$responses=array();
-
+
$name=$this->dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction);
-
+
if($this->hasEventHandler($name)||$this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
{
$handlers=$this->getEventHandlers($name);
{
if($this->dyIntraRaiseEventTestHandler($handler,$sender,$param,$name)===false)
continue;
-
+
if(is_string($handler))
{
if(($pos=strrpos($handler,'.'))!==false)
}
else
throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,gettype($handler));
-
+
$this->dyIntraRaiseEventPostHandler($name,$sender,$param,$handler,$response);
-
+
if($postfunction)
$response=call_user_func_array($postfunction,array($sender,$param,$this,$response));
-
+
if($responsetype&TEventResults::EVENT_RESULT_ALL)
$responses[]=array('sender'=>$sender,'param'=>$param,'response'=>$response);
else
$responses[]=$response;
-
+
if($response!==null&&($responsetype&TEventResults::EVENT_RESULT_FEED_FORWARD))
$param=$response;
-
+
}
}
else if(strncasecmp($name,'on',2)===0&&!$this->hasEvent($name))
throw new TInvalidOperationException('component_event_undefined',get_class($this),$name);
-
+
if($responsetype&TEventResults::EVENT_RESULT_FILTER)
$responses=array_filter($responses);
-
+
$responses=$this->dyPostRaiseEvent($responses,$name,$sender,$param,$responsetype,$postfunction);
-
+
return $responses;
}
* return $chain->dyEvaluateExpressionFilter(str_replace('foo', 'bar', $expression)); //example
* }
* </code>
- * to be executed when evaluateExpression is called. All attached behaviors are notified through
+ * to be executed when evaluateExpression is called. All attached behaviors are notified through
* dyEvaluateExpressionFilter. The chaining is important in this function due to the filtering
* pass-through effect.
*
* return $chain->dyEvaluateStatementsFilter(str_replace('foo', 'bar', $statements)); //example
* }
* </code>
- * to be executed when evaluateStatements is called. All attached behaviors are notified through
+ * to be executed when evaluateStatements is called. All attached behaviors are notified through
* dyEvaluateStatementsFilter. The chaining is important in this function due to the filtering
* pass-through effect.
*
* return $chain->dyCreatedOnTemplate($parent); //example
* }
* </code>
- * to be executed when createdOnTemplate is called. All attached behaviors are notified through
+ * to be executed when createdOnTemplate is called. All attached behaviors are notified through
* dyCreatedOnTemplate.
*
* @param TComponent potential parent of this control
* public function dyAddParsedObject($object[, $chain]) {
* }
* </code>
- * to be executed when addParsedObject is called. All attached behaviors are notified through
+ * to be executed when addParsedObject is called. All attached behaviors are notified through
* dyAddParsedObject.
*
* @param string|TComponent text string or component parsed and instantiated in template
{
$this->dyAddParsedObject($object);
}
-
-
+
+
/**
- * This is the method registered for all instanced objects should a class behavior be added after
+ * This is the method registered for all instanced objects should a class behavior be added after
* the class is instanced. Only when the class to which the behavior is being added is in this
* object's class hierarchy, via {@link getClassHierarchy}, is the behavior added to this instance.
* @param $sender the application
if(in_array($param->getClass(),$this->getClassHierarchy(true)))
return $this->attachBehavior($param->getName(),$param->getBehavior(),$param->getPriority());
}
-
-
+
+
/**
- * This is the method registered for all instanced objects should a class behavior be removed after
+ * This is the method registered for all instanced objects should a class behavior be removed after
* the class is instanced. Only when the class to which the behavior is being added is in this
* object's class hierarchy, via {@link getClassHierarchy}, is the behavior removed from this instance.
* @param $sender the application
if(in_array($param->getClass(),$this->getClassHierarchy(true)))
return $this->detachBehavior($param->getName(),$param->getPriority());
}
-
-
+
+
/**
- * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects.
- * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well.
+ * This will add a class behavior to all classes instanced (that are listening) and future newly instanced objects.
+ * This registers the behavior for future instances and pushes the changes to all the instances that are listening as well.
* The universal class behaviors are stored in an inverted stack with the latest class behavior being at the first position in the array.
* This is done so class behaviors are added last first.
* @param string name the key of the class behavior
* @param object|string class behavior or name of the object behavior per instance
* @param string|class string of class or class on which to attach this behavior. Defaults to null which will error
- * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class
+ * but more important, if this is on PHP 5.3 it will use Late Static Binding to derive the class
* it should extend.
* <code>
* TPanel::attachClassBehavior('javascripts', (new TJsPanelBehavior())->init($this));
$class=get_called_class();
if(!$class)
throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
-
+
if(!is_string($name))
$name=get_class($name);
$class=strtolower($class);
$behaviorObject=is_string($behavior)?new $behavior:$behavior;
return $behaviorObject->raiseEvent('fxAttachClassBehavior',null,$param);
}
-
-
+
+
/**
* This will remove a behavior from a class. It unregisters it from future instances and
* pulls the changes from all the instances that are listening as well.
* PHP 5.3 uses Late Static Binding to derive the static class upon which this method is called.
* @param $name the key of the class behavior
- * @param $class string class on which to attach this behavior. Defaults to null.
- * @param $priority numeric|null|false priority. false is any priority, null is default
- * {@link TPriorityList} priority, and numeric is a specific priority.
+ * @param $class string class on which to attach this behavior. Defaults to null.
+ * @param $priority numeric|null|false priority. false is any priority, null is default
+ * {@link TPriorityList} priority, and numeric is a specific priority.
* @throws Exception if the the class cannot be derived from Late Static Binding and is not
* not supplied as a parameter.
* @since 3.2.3
$class=get_called_class();
if(!$class)
throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
-
+
$class=strtolower($class);
if(!is_string($name))
$name=get_class($name);
* then the behavior can determine what it is an instanceof. If this behavior function returns true,
* then this method returns true. If the behavior instance checking function returns false,
* then no further checking is performed as it is assumed to be correct.
- *
- * If the behavior instance check function returns nothing or null or the behavior
+ *
+ * If the behavior instance check function returns nothing or null or the behavior
* doesn't implement the {@link IInstanceCheck} interface, then the default instanceof occurs.
* The default isa behavior is to check if the behavior is an instanceof the class.
*
foreach($this->_m->toArray() as $behavior){
if(($behavior instanceof IBehavior)&&!$behavior->getEnabled())
continue;
-
+
$check = null;
if(($behavior->isa('IInstanceCheck'))&&$check=$behavior->isinstanceof($class,$this))
return true;
* public function dyAttachBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when attachBehavior is called. All attached behaviors are notified through
+ * to be executed when attachBehavior is called. All attached behaviors are notified through
* dyAttachBehavior.
*
* @param string the behavior's name. It should uniquely identify this behavior.
* public function dyDetachBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when detachBehavior is called. All attached behaviors are notified through
+ * to be executed when detachBehavior is called. All attached behaviors are notified through
* dyDetachBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
* public function dyEnableBehaviors($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when enableBehaviors is called. All attached behaviors are notified through
+ * to be executed when enableBehaviors is called. All attached behaviors are notified through
* dyEnableBehaviors.
* @since 3.2.3
*/
* public function dyDisableBehaviors($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when disableBehaviors is called. All attached behaviors are notified through
+ * to be executed when disableBehaviors is called. All attached behaviors are notified through
* dyDisableBehaviors.
* @since 3.2.3
*/
$this->_behaviorsenabled=false;
}
}
-
+
/**
* Returns if all the behaviors are turned on or off for the object.
* public function dyEnableBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when enableBehavior is called. All attached behaviors are notified through
+ * to be executed when enableBehavior is called. All attached behaviors are notified through
* dyEnableBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
* public function dyDisableBehavior($name,$behavior[, $chain]) {
* }
* </code>
- * to be executed when disableBehavior is called. All attached behaviors are notified through
+ * to be executed when disableBehavior is called. All attached behaviors are notified through
* dyDisableBehavior.
*
* @param string the behavior's name. It uniquely identifies the behavior.
{
$a = (array)$this;
$a = array_keys($a);
- $exprops = array();
+ $exprops = array();
if($this->_listeningenabled===false)
- $exprops[] = "\0TComponent\0_listeningenabled";
+ $exprops[] = "\0TComponent\0_listeningenabled";
if($this->_behaviorsenabled===true)
- $exprops[] = "\0TComponent\0_behaviorsenabled";
+ $exprops[] = "\0TComponent\0_behaviorsenabled";
if ($this->_e===array())
$exprops[] = "\0TComponent\0_e";
if ($this->_m===null)
private $_name;
private $_behavior;
private $_priority;
-
+
/**
* Holds the parameters for the Class Behavior Events
* @param string $class this is the class to get the behavior
$this->_behavior=$behavior;
$this->_priority=$priority;
}
-
+
/**
* This is the class to get the behavior
* @return string the class to get the behavior
{
return $this->_class;
}
-
+
/**
* name of the behavior
* @return string the name to get the behavior
{
return $this->_name;
}
-
+
/**
* This is the behavior which the class is to get
- * @return object the behavior to implement
+ * @return object the behavior to implement
*/
public function getBehavior()
{
return $this->_behavior;
}
-
+
/**
* This is the priority which the behavior is to get
- * @return numeric the priority of the behavior
+ * @return numeric the priority of the behavior
*/
public function getPriority()
{
* TTextAlign::Right.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* - enum: enumerable type, represented by an array of strings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* TEventParameter is the base class for all event parameter classes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
}
/**
- * IBaseBehavior interface is the base behavior class from which all other
+ * IBaseBehavior interface is the base behavior class from which all other
* behaviors types are derived
- *
+ *
* @author Brad Anderson <javalizard@mac.com>
* @version $Id$
* @package System
* IBehavior interfaces is implemented by instance behavior classes.
*
* A behavior is a way to enhance a component with additional methods and
- * events that are defined in the behavior class and not available in the
+ * events that are defined in the behavior class and not available in the
* class. Objects may signal behaviors through dynamic events.
*
* @author Brad Anderson <javalizard@mac.com>
/**
- * IClassBehavior interface is implements behaviors across all instances of
+ * IClassBehavior interface is implements behaviors across all instances of
* a particular class
*
- * Any calls to functions not present in the original object but to behaviors
- * derived from this class, will have inserted as the first argument parameter
+ * Any calls to functions not present in the original object but to behaviors
+ * derived from this class, will have inserted as the first argument parameter
* the object containing the behavior.
*
* For example:
/**
- * IInstanceCheck This interface allows objects to determine their own
- * 'instanceof' results when {@link TComponent::isa} is called. This is
- * important with behaviors because behaviors may want to look like
+ * IInstanceCheck This interface allows objects to determine their own
+ * 'instanceof' results when {@link TComponent::isa} is called. This is
+ * important with behaviors because behaviors may want to look like
* particular objects other than themselves.
*
* @author Brad Anderson <javalizard@mac.com>
*/
interface IInstanceCheck {
/**
- * The method checks $this or, if needed, the parameter $instance is of type
- * class. In the case of a Class Behavior, the instance to which the behavior
+ * The method checks $this or, if needed, the parameter $instance is of type
+ * class. In the case of a Class Behavior, the instance to which the behavior
* is attached may be important to determine if $this is an instance
* of a particular class.
* @param class|string the component that this behavior is checking if it is an instanceof.
* @param object the object which the behavior is attached to. default: null
- * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and
+ * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and
* the default mechanisms take over.
*/
public function isinstanceof($class,$instance=null);
}
/**
- * TJavaScriptLiteral class that encloses string literals that are not
+ * TJavaScriptLiteral class that encloses string literals that are not
* supposed to be escaped by {@link TJavaScript::encode() }
*
* Since Prado 3.2 all the data that gets sent clientside inside a javascript statement
* $raw=_js($js);
* </code>
*
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.2.0
*/
/**
* TJavaScriptString class is an internal class that marks strings that will be
- * forcibly encoded when rendered inside a javascript block
+ * forcibly encoded when rendered inside a javascript block
*
- * @version $Id: TComponent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.2.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* used as the basic class for application modules.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* used as the basic class for application services.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* accessibility to resources as the PRADO Web applications.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TShellApplication.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1.0
*/
/**
* TBehavior is a convenient base class for behavior classes.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBehaviour.php 3211 2012-10-31 02:35:01Z javalizard@gmail.com $
* @package System.Util
* @since 3.2.3
*/
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2008-2013 Pradosoft
+ * @copyright Copyright © 2008-2014 Pradosoft
* @license http://www.pradosoft.com/license/
*/
/**
* TCallChain is a recursive event calling mechanism. This class implements
* the {@link IDynamicMethods} class so that any 'dy' event calls can be caught
- * and patched through to the intended recipient
+ * and patched through to the intended recipient
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TCallChain.php 564 2009-01-21 22:07:10Z javalizard $
* @package System.Util
* @since 3.2.3
*/
* @var {@link TListIterator} for moving through the chained method calls
*/
private $_iterator=null;
-
+
/**
* @var string the method name of the call chain
*/
private $_method=null;
-
+
/**
* This initializes the list and the name of the method to be called
* @param string the name of the function call
$this->_method=$method;
parent::__construct();
}
-
-
+
+
/**
* This initializes the list and the name of the method to be called
- * @param string|array this is a callable function as a string or array with
+ * @param string|array this is a callable function as a string or array with
* the object and method name as string
* @param array The array of arguments to the function call chain
*/
{
$this->add(array($method,$args));
}
-
+
/**
* This method calls the next Callable in the list. All of the method arguments
- * coming into this method are substituted into the original method argument of
+ * coming into this method are substituted into the original method argument of
* call in the chain.
- *
+ *
* If the original method call has these parameters
* <code>
* $originalobject->dyExampleMethod('param1', 'param2', 'param3')
* list in 'dy' event calls is always the object containing the behavior. This modifies
* the parameter replacement mechanism slightly to leave the object containing the behavior
* alone and only replacing the other parameters in the argument list. As per {@link __call},
- * any calls to a 'dy' event do not need the object containing the behavior as the addition of
+ * any calls to a 'dy' event do not need the object containing the behavior as the addition of
* the object to the argument list as the first element is automatic for IClassBehaviors.
*
* The last parameter of the method parameter list for any callable in the call chain
*
* When there are no handlers or no handlers left, it returns the first parameter of the
* argument list.
- *
+ *
*/
public function call()
{
$args=func_get_args();
if($this->getCount()===0)
return isset($args[0])?$args[0]:null;
-
+
if(!$this->_iterator)
{
$chain_array=array_reverse($this->toArray());
$result = $args[0];
return $result;
}
-
-
+
+
/**
* This catches all the unpatched dynamic events. When the method call matches the
- * call chain method, it passes the arguments to the original __call (of the dynamic
- * event being unspecified in TCallChain) and funnels into the method {@link call},
+ * call chain method, it passes the arguments to the original __call (of the dynamic
+ * event being unspecified in TCallChain) and funnels into the method {@link call},
* so the next dynamic event handler can be called.
* If the original method call has these parameters
* <code>
/**
* TClassBehavior is a convenient base class for whole class behaviors.
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TClassBehavior.php 564 2009-01-21 22:07:10Z javalizard $
* @package System.Util
* @since 3.2.3
*/
public function attach($component)
{
}
-
+
/**
* Detaches the behavior object from the component.
* @param TComponent the component that this behavior is to be detached from.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
* then field 'MyValue.MySubValue' will return that method call result.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* Evaluates the data value at the specified field.
* - If the data is an array, then the field is treated as an array index
* and the corresponding element value is returned; the field name can also include
- * dots to access subarrays. For example a field named 'MyField.MySubField' will
+ * dots to access subarrays. For example a field named 'MyField.MySubField' will
* first try to access $data['MyField.MySubField'], then try $data['MyField']['MySubField'].
* - If the data is a TMap or TList object, then the field is treated as a key
* into the map or list, and the corresponding value is returned.
* @author Fabio Bas ctrlaltca[AT]gmail[DOT]com
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $
* @package System.Util
*/
* julian dates anymore.
*
* @author Fabio Bas ctrlaltca[AT]gmail[DOT]com
- * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $
* @package System.Util
* @since 3.0.4
* @deprecated since 3.2.1
$dt = new DateTime();
if($is_gmt)
$dt->setTimeZone(new DateTimeZone('UTC'));
- $dt->setDate($year!==false ? $year : date('Y'),
- $mon!==false ? $mon : date('m'),
+ $dt->setDate($year!==false ? $year : date('Y'),
+ $mon!==false ? $mon : date('m'),
$day!==false ? $day : date('d'));
$dt->setTime($hr, $min, $sec);
return (int) $dt->format('U');
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
* </code>
* PHP configuration style:
* <code>
- *
+ *
* </code>
* You can specify multiple routes with different filtering conditions and different
* targets, even if the routes are of the same type.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
/**
* Adds a TLogRoute instance to the log router.
- *
- * @param TLogRoute $route
+ *
+ * @param TLogRoute $route
* @throws TInvalidDataTypeException if the route object is invalid
*/
public function addRoute($route)
* satisfying both filter conditions will they be returned.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
*/
protected function formatLogMessage($message,$level,$category,$time)
{
- return @gmdate('M d H:i:s',$time).' ['.$this->getLevelName($level).'] ['.$category.'] '.$message."\n";
+ return @date('M d H:i:s',$time).' ['.$this->getLevelName($level).'] ['.$category.'] '.$message."\n";
}
/**
* specifies how many files to be kept.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* {@link setSentFrom SentFrom} address.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* TBrowserLogRoute prints selected log messages in the response.
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* @var string css class for indentifying the table structure in the dom tree
*/
private $_cssClass=null;
-
+
public function processLogs($logs)
{
if(empty($logs) || $this->getApplication()->getMode()==='Performance') return;
}
$response->write($this->renderFooter());
}
-
+
/**
* @param string the css class of the control
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.2
*/
* {@link http://www.getfirebug.com/ FireBug Website}
*
* @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.2
*/
* {@link http://www.firephp.org/ FirePHP Website}
*
* @author Yves Berkholz <godzilla80[at]gmx[dot]net>
- * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.1.5
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
* log categories, and by control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp.
* A level filter is specified by an integer, whose bits indicate the levels interested.
* For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels.
- * A category filter is specified by an array of categories to filter.
+ * A category filter is specified by an array of categories to filter.
* A message whose category name starts with any filtering category
* will be returned. For example, a category filter array('System.Web','System.IO')
* will return messages under categories such as 'System.Web', 'System.IO',
* 'System.Web.UI', 'System.Web.UI.WebControls', etc.
* A control client id filter is specified by an array of control client id
* A message whose control client id starts with any filtering naming panels
- * will be returned. For example, a category filter array('ctl0_body_header',
+ * will be returned. For example, a category filter array('ctl0_body_header',
* 'ctl0_body_content_sidebar')
* will return messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar',
* 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc.
* Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp.
* A level filter is specified by an integer, whose bits indicate the levels interested.
* For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels.
- * A category filter is specified by an array of categories to filter.
+ * A category filter is specified by an array of categories to filter.
* A message whose category name starts with any filtering category
* will be deleted. For example, a category filter array('System.Web','System.IO')
* will delete messages under categories such as 'System.Web', 'System.IO',
* 'System.Web.UI', 'System.Web.UI.WebControls', etc.
* A control client id filter is specified by an array of control client id
* A message whose control client id starts with any filtering naming panels
- * will be deleted. For example, a category filter array('ctl0_body_header',
+ * will be deleted. For example, a category filter array('ctl0_body_header',
* 'ctl0_body_content_sidebar')
* will delete messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar',
* 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
* @link http://www.pradosoft.com/
* @copyright 2010 Bigpoint GmbH
* @license http://www.pradosoft.com/license/
- * @version $Id: TRpcClient.php 137 2010-03-27 22:13:36Z rrogge $
* @since 3.2
* @package System.Util
*/
* @package System.Util
* @since 3.2
*/
-
+
class TRpcClientTypesEnumerable extends TEnumerable
{
const JSON = 'TJsonRpcClient';
* @package System.Util
* @since 3.2
*/
-
+
class TRpcClientRequestException extends TApplicationException
{
}
/**
* TRpcClientResponseException class
*
- * This Exception is fired when the
+ * This Exception is fired when the
*
* @author Robin J. Rogge <rrogge@bigpoint.net>
* @version $Id$
// skip response handling if the request was just a notification request
if($this->isNotification)
return true;
-
+
// decode response
if(($_response = xmlrpc_decode($_response)) === null)
throw new TRpcClientResponseException('Empty response received');
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
if(is_numeric($value))
return $s->getDate($value);
else
- return $s->parseDate($value);
+ return $s->parseDate($value);
}
/**
if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null))
return null;
else
- {
+ {
if(empty($year)) {
$year = date('Y');
}
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Util
* @since 3.0
*/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $
* @package System.Web.Javascripts
*/
* functions.
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TJavaScript.php 3291 2013-05-09 17:44:58Z ctrlaltca $
* @package System.Web.Javascripts
* @since 3.0
*/
else
return '';
}
-
/**
* Encodes a PHP variable into javascript string.
* This method invokes json_encode to perform the encoding.
*/
public static function jsonEncode($value, $options = 0)
{
- if (is_string($value) &&
- ($g=Prado::getApplication()->getGlobalization(false))!==null &&
- strtoupper($enc=$g->getCharset())!='UTF-8')
- $value=iconv($enc, 'UTF-8', $value);
+ if (($g=Prado::getApplication()->getGlobalization(false))!==null &&
+ strtoupper($enc=$g->getCharset())!='UTF-8') {
+ self::convertToUtf8($value, $enc);
+ }
+
$s = @json_encode($value,$options);
self::checkJsonError();
return $s;
}
+ /**
+ * Encodes an string or the content of an array to UTF8
+ * @param string|array|mixed $value
+ * @param string $sourceEncoding
+ */
+ private static function convertToUtf8(&$value, $sourceEncoding) {
+ if(is_string($value))
+ $value=iconv($sourceEncoding, 'UTF-8', $value);
+ else if (is_array($value))
+ {
+ foreach($value as &$element)
+ self::convertToUtf8($element, $sourceEncoding);
+ }
+ }
+
/**
* Decodes a javascript string into PHP variable.
* This method invokes json_decode to perform the decoding.
self::checkJsonError();
return $s;
}
-
+
private static function checkJsonError()
{
switch ($err = json_last_error())
/**
* Minimize the size of a javascript script.
* This method is based on Douglas Crockford's JSMin.
- * @param string code that you want to minimzie
+ * @param string code that you want to minimzie
* @return minimized version of the code
*/
public static function JSMin($code)
createStyleSheetCode: function(code) {
var asset = document.createElement('style');
asset.setAttribute('type', 'text/css');
- asset.innerText = code;
+
+ if(asset.styleSheet)
+ asset.styleSheet.cssText = code; // IE7+IE8
+ else {
+ var cssCodeNode = document.createTextNode(code);
+ asset.appendChild(cssCodeNode);
+ }
var head = document.getElementsByTagName('head')[0];
head.appendChild(asset);
this.maximum = this.options.maximum || this.range.end;
this.minimum = this.options.minimum || this.range.start;
this.hiddenField=$(this.options.ID+'_1');
+ this.trackInitialized=false;
- // Will be used to align the handle onto the track, if necessary
- this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft);
- this.alignY = parseInt(this.options.alignY || - this.track.offsetTop);
-
- this.trackLength = this.maximumOffset() - this.minimumOffset();
- this.handleLength = this.isVertical() ?
- (this.handle.offsetHeight != 0 ?
- this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
- (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
- this.handle.style.width.replace(/px$/,""));
+ this.initializeTrack();
this.active = false;
this.dragging = false;
if(this.options['AutoPostBack']==true)
this.observe(this.hiddenField, "change", Prado.PostBack.bindEvent(this,options));
-
},
+
+ initializeTrack : function()
+ {
+ if(this.trackInitialized || !$(this.track).is(":visible"))
+ return;
+
+ // Will be used to align the handle onto the track, if necessary
+ this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft);
+ this.alignY = parseInt(this.options.alignY || - this.track.offsetTop);
+
+ this.trackLength = this.maximumOffset() - this.minimumOffset();
+ this.handleLength = this.isVertical() ?
+ (this.handle.offsetHeight != 0 ?
+ this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
+ (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
+ this.handle.style.width.replace(/px$/,""));
+ this.trackInitialized=true;
+ },
+
setDisabled: function(){
this.disabled = true;
startDrag: function(event) {
if(Event.isLeftClick(event)) {
+ this.initializeTrack();
if(!this.disabled){
this.active = true;
var handle = Event.element(event);
}
}
-});
\ No newline at end of file
+});
* Version of Prado clientscripts
* @var Version
*/
- Version: '3.2.3',
+ Version: '3.2.4',
/**
* Registry for Prado components
if(!this.control)
this.control = $(this.options.ControlToValidate);
- if(!this.control || this.control.disabled)
+ if(!this.control || this.control.disabled || !this.control.descendantOf(document))
{
this.isValid = true;
return this.isValid;
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @link http://www.pradosoft.com
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.Services
else
throw new TConfigurationException('feedservice_class_required',$id);
}
-
+
// init feed properties
foreach($properties as $name=>$value)
$feed->setSubproperty($name,$value);
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
throw new TConfigurationException('jsonservice_response_type_invalid',$id);
}
else
- throw new TConfigurationException('jsonservice_class_required',$id);
+ throw new TConfigurationException('jsonservice_class_required',$id);
}
}
else
* will be empty if the returned content is null.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TJsonService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.0
*/
* Configurations along this path are merged together to be provided for the page.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPageService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.0
*/
Prado::trace("Loading page configuration file $fname",'System.Web.Services.TPageService');
if(empty($fname) || !is_file($fname))
return;
-
+
if(Prado::getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
{
$fcontent = include $fname;
$this->loadFromPhp($fcontent,dirname($fname),$configPagePath);
}
else
- {
+ {
$dom=new TXmlDocument;
if($dom->loadFromFile($fname))
$this->loadFromXml($dom,dirname($fname),$configPagePath);
$this->loadApplicationConfigurationFromXml($dom,$configPath);
$this->loadPageConfigurationFromXml($dom,$configPath,$configPagePath);
}
-
+
public function loadApplicationConfigurationFromPhp($config,$configPath)
{
$appConfig=new TApplicationConfiguration;
if(isset($page['properties']))
{
$properties=$page['properties'];
- unset($page['properties']);
+ unset($page['properties']);
}
$matching=false;
$id=($configPagePath==='')?$id:$configPagePath.'.'.$id;
$this->_properties=array_merge($this->_properties,$properties);
}
}
-
+
// external configurations
if(isset($config['includes']) && is_array($config['includes']))
{
if(!is_array($parameters))
$parameters = array($parameters);
- $ret = $this->callApiMethod($_request['method'], $parameters);
// a request without an id is a notification that doesn't need a response
if($this->_id !== null)
{
return $this->encode(array(
'jsonrpc' => '2.0',
'id' => $this->_id,
- 'result' => $ret
+ 'result' => $this->callApiMethod($_request['method'], $parameters),
));
} else {
return $this->encode(array(
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
*/
* @throws TConfigurationException if soap server id is not specified or duplicated
*/
private function loadConfig($config)
- {
+ {
if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
{
if(is_array($config))
* It also manages the URI for the SOAP service and WSDL.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSoapService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.Services
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
* pointing to a valid directory writable by the Web server process.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TAssetManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.1.1
*/
*
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCacheHttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
*/
* request module. It can be accessed via {@link TApplication::getRequest()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
if($this->getEnableCache())
{
$cache = $this->getApplication()->getCache();
- if($cache !== null)
+ if($cache !== null)
{
$dependencies = null;
if($this->getApplication()->getMode() !== TApplicationMode::Performance)
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
* domain, path, expire, and secure.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
* - fragment: anchor
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
* - HiddenPath: the URL format is like /path/to/name1,value1/name2,value2...
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpRequest.php 3273 2013-02-13 21:51:21Z ctrlaltca $
* @package System.Web
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
* will force the browser to ask for a username and a password.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpResponse.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
* and {@link getTimeout TimeOut} are configurable properties of THttpSession.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
$this->_started=false;
}
}
-
+
/**
* Update the current session id with a newly generated one
*
* for traversing the session variables.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
* - Only: using cookie only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpSession.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
*/
* THttpUtility class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THttpUtility.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id $
* @package System.Web
* In order to use the 'HiddenPath' format you need proper url rewrite configuration;
* here's an example for Apache's .htaccess:
* <cdde>
- * Options +FollowSymLinks
+ * Options +FollowSymLinks
* RewriteEngine On
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteCond %{REQUEST_FILENAME} !-f
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
*/
* in the GET variables.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.0.5
*/
* Since 3.2.2 you can also add a list of "constants" parameters that can be used just
* like the original "parameters" parameters, except that the supplied value will be treated
* as a simple string constant instead of a regular expression. For example
- *
+ *
* <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/detail/{pageidx}" parameters.pageidx="\d+" constants.listtype="detailed"/>
* <url ServiceParameter="MyPage" pattern="/mypage/mypath/list/summary/{pageidx}" parameters.pageidx="\d+" constants.listtype="summarized"/>
*
* The constants is practically a table-based validation and translation of specified, fixed-set parameter values.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.0.5
*/
* URL prefix behavior that can be used by {@link TUrlMappingPattern::constructUrl()}.
*
* @author Yves Berkholz <godzilla80[at]gmx[dot]net>
- * @version $Id: TUrlMapping.php 3290 2013-05-06 08:32:15Z ctrlaltca $
* @package System.Web
* @since 3.2
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* will update the button's caption upon callback response completion.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TActiveButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
}
/**
- * Raises the callback event. This method is required by
+ * Raises the callback event. This method is required by
* {@link ICallbackEventHandler} interface. If {@link getCausesValidation CausesValidation}
* is true, it will invoke the page's {@link TPage::validate validate}
* method first. It will raise {@link onClick OnClick} event first
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* changed during a callback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
/**
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
- *
+ *
* Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false
- *
+ *
* @param THtmlWriter the writer for the rendering purpose
* @param string checkbox id
* @param string onclick js
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* List items can not be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
*
* This is the active counterpart of the {@link TClientScript} class.
*
- * TActiveClientScript has the ability to render itself on ajax
+ * TActiveClientScript has the ability to render itself on ajax
* callbacks. This means that every variable or function declared in javascript
* code will be available to the page.
*
* Beware that when rendered on normal (postback) or ajax callbacks, some
- * javascript code won't behave in the same way.
- * When rendered as part of a normal/postback response, scripts will execute instantly
+ * javascript code won't behave in the same way.
+ * When rendered as part of a normal/postback response, scripts will execute instantly
* where they are in the page and in a synchronous fashion.
* Instead, when they are rendered as part of a callback response,
* they will be executed when all DOM modifications are complete and any dynamic
* This can potentially hurt compatibility and graceful fallback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveClientScript.php 3144 2012-05-19 10:07:03Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.2
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* corresponding client-side properties.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Tracking changes to the page state during callback.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Calculates the viewstate changes during the request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Calculate the changes to a scalar value.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Calculates the changes to the Style properties.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Calculate the changes to attributes collection.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* will be true when validation is made during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Custom Validator callback client side options class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* If it is enabled (clickable), its command name and parameter will also be set.
* It overrides the datagrid's original method to create active controls instead, thus
* the pager will do callbacks instead of the regular postbacks.
- * @param mixed the container pager instance of TActiveDatagridPager
+ * @param mixed the container pager instance of TActiveDatagridPager
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
* TActiveDataGridPager represents a pager in an activedatagrid.
*
* @author Fabio Bas <ctrlaltca@gmail.com>
- * @version $Id: TDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
* The {@link getPager Pager} property indicates the datagrid pager related with the event.
*
* @author Fabio Bas <ctrlaltca@gmail.com>
- * @version $Id: TActiveDataGrid.php 3057 2011-11-09 12:35:57Z ctrlaltca@gmail.com $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
<?php
/**
* TActiveDataList class file
- *
+ *
* @author Marcos Aurelio Nobre <marconobre@gmail.com>
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TActiveDataList.php 2706 2009-09-24 14:42:30Z rojaro $
*/
/**
*
* TActiveDataList represents a data bound and updatable grid control which is the
* active counterpart to the original {@link TDataList} control.
- *
+ *
* This component can be used in the same way as the regular datalist, the only
* difference is that the active datalist uses callbacks instead of postbacks
* for interaction.
* @package System.Web.UI.ActiveControls
*/
class TActiveDataList extends TDataList implements IActiveControl {
-
+
/**
* Creates a new callback control, sets the adapter to
- * TActiveControlAdapter.
+ * TActiveControlAdapter.
*/
public function __construct()
{
{
return $this->getAdapter()->getBaseActiveControl();
}
-
+
/**
* Sets the data source object associated with the repeater control.
* In addition, the render method of all connected pagers is called so they
$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
}
}
-
+
/**
* Returns the id of the surrounding container (span).
* @return string container id
{
return $this->ClientID.'_Container';
}
-
+
/**
* Renders the repeater.
* If the repeater did not pass the prerender phase yet, it will register itself for rendering later.
$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
}
}
-
+
/**
* Loops through all {@link TActivePager} on the page and registers the ones which are set to paginate
- * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the
+ * the repeater for rendering. This is to ensure that the connected pagers are also rendered if the
* data source changed.
*/
private function renderPager()
}
}
}
-
+
/**
* Renders the repeater by writing a span tag with the container id obtained from {@link getContainerID()}
* which will be called by the replacement method of the client script to update it's content.
<?php
/**
* TActiveDatePicker class file
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
/**
* TActiveDatePicker class
- *
+ *
* The active control counter part to date picker control.
* When the date selection is changed, the {@link onCallback OnCallback} event is
* raised.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1.3
*/
class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, IActiveControl
{
-
+
/**
* @return boolean a value indicating whether an automatic postback to the server
* will occur whenever the user modifies the text in the TActiveDatePicker control and
$options['AutoPostBack'] = $this->getAutoPostBack();
return $options;
}
-
+
/**
* Creates a new callback control, sets the adapter to
* TActiveControlAdapter. If you override this class, be sure to set the
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
+
/**
* @return TBaseActiveCallbackControl standard callback control options.
*/
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select');
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select');
$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select');
-
+
}
}
}
-
+
/**
* Raises the callback event. This method is required by {@link
- * ICallbackEventHandler} interface.
+ * ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
public function raiseCallbackEvent($param){
$this->onCallback($param);
- }
-
+ }
+
/**
* This method is invoked when a callback is requested. The method raises
* 'OnCallback' event to fire up the event handlers. If you override this
public function onCallback($param){
$this->raiseEvent('OnCallback', $this, $param);
}
-
+
/**
* Registers the javascript code to initialize the date picker.
*/
* is changed.
* The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
* as parameter to this event
- *
+ *
* @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
- * @version $Id: TActiveDatePicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.2.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* List items can be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
<?php
/**
* TActiveFileUpload.php
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (issue 349 remote vulnerability fix)
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
/**
* TActiveFileUpload
- *
+ *
* TActiveFileUpload displays a file upload field on a page. Upon postback,
* the text entered into the field will be treated as the name of the file
* that will be uploaded to the server. The property {@link getHasFile HasFile}
*
* TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded
* (whether it succeeds or not).
- *
+ *
* TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback.
* This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback
* a status icon is displayed; either a green checkmark if the upload is successful,
* or a red x if there was an error.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
-class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
+class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
{
-
+
const SCRIPT_PATH = 'prado/activefileupload';
-
+
/**
* @var THiddenField a flag to tell which component is doing the callback.
*/
*/
private $_target;
-
+
/**
* Creates a new callback control, sets the adapter to
* TActiveControlAdapter. If you override this class, be sure to set the
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
-
+
+
/**
* @param string asset file in the self::SCRIPT_PATH directory.
* @return string asset file url.
$base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
return $base.'/'.self::SCRIPT_PATH.'/'.$file;
}
-
-
+
+
/**
* This method is invoked when a file is uploaded.
* If you override this method, be sure to call the parent implementation to ensure
// save the file so that it will persist past the end of this return.
$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
parent::saveAs($localName);
-
+
$filename=addslashes($this->getFileName());
-
-
+
+
$params = new TActiveFileUploadCallbackParams;
$params->localName = $localName;
$params->fileName = $filename;
parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;
-
+
exit();
}
}
-
+
/**
* @return string the path where the uploaded file will be stored temporarily, in namespace format
* default "Application.runtime.*"
public function getTempPath(){
return $this->getViewState('TempPath', 'Application.runtime.*');
}
-
+
/**
* @param string the path where the uploaded file will be stored temporarily in namespace format
* default "Application.runtime.*"
public function setTempPath($value){
$this->setViewState('TempPath',$value,'Application.runtime.*');
}
-
+
/**
* @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
* Note: When set to false, you will need to trigger the callback yourself.
public function getAutoPostBack(){
return $this->getViewState('AutoPostBack', true);
}
-
+
/**
* @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true.
* Note: When set to false, you will need to trigger the callback yourself.
public function setAutoPostBack($value){
$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
}
-
+
/**
* @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}
- */
+ */
public function getCallbackJavascript(){
return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")";
}
-
+
/**
* @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable.
*/
public function onInit($sender){
parent::onInit($sender);
-
+
if (!Prado::getApplication()->getCache())
if (!Prado::getApplication()->getSecurityManager())
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
-
+
if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){
throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath());
}
}
-
+
/**
* Raises <b>OnFileUpload</b> event.
- *
- * This method is required by {@link ICallbackEventHandler} interface.
+ *
+ * This method is required by {@link ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
public function raiseCallbackEvent($param){
$cp = $param->getCallbackParameter();
if ($key = $cp->targetID == $this->_target->getUniqueID()){
-
+
$params = $this->popParamsByToken($cp->callbackToken);
-
+
$_FILES[$key]['name'] = $params->fileName;
$_FILES[$key]['size'] = intval($params->fileSize);
$_FILES[$key]['type'] = $params->fileType;
$_FILES[$key]['error'] = intval($params->errorCode);
$_FILES[$key]['tmp_name'] = $params->localName;
$this->loadPostData($key, null);
-
+
$this->raiseEvent('OnFileUpload', $this, $param);
}
}
{
$this->onFileUpload($this->getPage()->getRequest()->itemAt('TActiveFileUpload_TargetId'));
}
-
+
protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params)
{
if ($cache = Prado::getApplication()->getCache())
}
else
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
-
+
return $token;
}
-
+
protected function popParamsByToken($token)
{
if ($cache = Prado::getApplication()->getCache())
throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely');
assert($params instanceof TActiveFileUploadCallbackParams);
-
+
return $params;
}
$this->_errorCode = UPLOAD_ERR_FORM_SIZE;
$localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
$fileName = addslashes($this->getFileName());
-
+
$params = new TActiveFileUploadCallbackParams;
$params->localName = $localName;
$params->fileName = $fileName;
$params->fileSize = $this->getFileSize();
$params->fileType = $this->getFileType();
$params->errorCode = $this->getErrorCode();
-
+
echo <<<EOS
<script language="Javascript">
Options = new Object();
Options.fileType = '{$params->fileType}';
Options.errorCode = '{$params->errorCode}';
Options.callbackToken = '{$this->pushParamsAndGetToken($params)}';
- parent.Prado.WebUI.TactiveFileUpload.onFileUpload(Options);
+ parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
</script>
EOS;
}
}
-
+
public function createChildControls(){
$this->_flag = Prado::createComponent('THiddenField');
$this->_flag->setID('Flag');
$this->getControls()->add($this->_flag);
-
+
$this->_busy = Prado::createComponent('TImage');
$this->_busy->setID('Busy');
$this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif'));
$this->_busy->setStyle("display:none");
$this->getControls()->add($this->_busy);
-
+
$this->_success = Prado::createComponent('TImage');
$this->_success->setID('Success');
$this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png'));
$this->_success->setStyle("display:none");
$this->getControls()->add($this->_success);
-
+
$this->_error = Prado::createComponent('TImage');
$this->_error->setID('Error');
$this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png'));
$this->_error->setStyle("display:none");
$this->getControls()->add($this->_error);
-
+
$this->_target = Prado::createComponent('TInlineFrame');
$this->_target->setID('Target');
$this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html'));
$this->_target->setShowBorder(false);
$this->getControls()->add($this->_target);
}
-
-
+
+
/**
- * Removes localfile on ending of the callback.
+ * Removes localfile on ending of the callback.
*/
public function onUnload($param){
- if ($this->getPage()->getIsCallback() &&
- $this->getHasFile() &&
+ if ($this->getPage()->getIsCallback() &&
+ $this->getHasFile() &&
file_exists($this->getLocalName())){
unlink($this->getLocalName());
}
public function addAttributesToRender($writer){
parent::addAttributesToRender($writer);
$writer->addAttribute('id',$this->getClientID());
-
+
$this->getPage()->getClientScript()->registerPradoScript('activefileupload');
$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions());
}
protected function getClientOptions(){
$options['ID'] = $this->getClientID();
$options['EventTarget'] = $this->getUniqueID();
-
+
$options['inputID'] = $this->getClientID();
$options['flagID'] = $this->_flag->getClientID();
$options['targetID'] = $this->_target->getUniqueID();
}
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* completes successfully.
*/
public function getSuccessImage(){
$this->ensureChildControls();
return $this->_success;
}
-
+
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* does not complete successfully.
*/
public function getErrorImage(){
$this->ensureChildControls();
return $this->_error;
}
-
+
/**
- * @return TImage the image displayed when an upload
+ * @return TImage the image displayed when an upload
* is in progress.
*/
public function getBusyImage(){
/**
* TActiveFileUploadCallbackParams is an internal class used by {@link TActiveFileUpload}.
- *
+ *
* @author Bradley Booms <Bradley.Booms@nsighttel.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TActiveFileUpload.php 3232 2013-01-02 14:42:24Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TActiveFileUploadCallbackParams
*
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* {@link setNavigateUrl NavigateUrl} and {@link setTarget Target}.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveHyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* and it is raise <b>after</b> the {@link onClick OnClick} event.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* the client-side "for" attribute on the label.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* will update the link text upon callback response completion.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
$this->getClientClassName(), $this->getPostBackOptions());
} else {
- $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
+ $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
}
}
}
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* List items can be added dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* during callback response.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* repopulate the client-side options.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveListControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
{
Prado::trace("ActivePage redirect()",'System.Web.UI.ActiveControls.TActivePageAdapter');
$this->appendContentPart($this->getResponse(), self::CALLBACK_REDIRECT, $url);
- //$this->getResponse()->appendHeader(self::CALLBACK_REDIRECT.': '.$url);
}
/**
$data = TJavaScript::jsonEncode($responseData);
$this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data);
- //$response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data);
}
}
{
$pagestate = $this->getPage()->getClientState();
$this->appendContentPart($response, self::CALLBACK_PAGESTATE_HEADER, $pagestate);
- //$response->appendHeader(self::CALLBACK_PAGESTATE_HEADER.': '.$pagestate);
}
}
$executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute();
$actions = TJavaScript::jsonEncode($executeJavascript);
$this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions);
- //$response->appendHeader(self::CALLBACK_ACTION_HEADER.': '.$actions);
$cs = $this->Page->getClientScript();
}
/**
- * Gets callback parameter. JSON encoding is assumed.
+ * Gets callback parameter.
* @return string postback event parameter
*/
public function getCallbackEventParameter()
if($this->_callbackEventParameter===null)
{
$param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
- if(strlen($param) > 0)
- $this->_callbackEventParameter=TJavaScript::jsonDecode((string)$param);
+ $this->_callbackEventParameter=$param;
}
return $this->_callbackEventParameter;
}
* the error stack trace.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
{
$response = $this->getApplication()->getResponse();
$trace = $this->getExceptionStackTrace($exception);
+ // avoid error on non-utf8 strings
try {
$trace = TJavaScript::jsonEncode($trace);
} catch (Exception $e) {
// strip everythin not 7bit ascii
$trace = preg_replace('/[^(\x20-\x7F)]*/','', serialize($trace));
}
- $response->setStatusCode(500, 'Internal Server Error');
- $response->appendHeader(TActivePageAdapter::CALLBACK_ERROR_HEADER.': '.$trace);
+
+ // avoid exception loop if headers have already been sent
+ try {
+ $response->setStatusCode(500, 'Internal Server Error');
+ } catch (Exception $e) { }
+
+ $content = $response->createHtmlWriter();
+ $content->getWriter()->setBoundary(TActivePageAdapter::CALLBACK_ERROR_HEADER);
+ $content->write($trace);
}
else
{
* TInvalidCallbackException class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePageAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com)
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
/**
* TActivePager is the active control counter part of TPager.
- *
+ *
* When a page change is requested, TActivePager raises a callback instead of the
* traditional postback.
*
* The {@link onCallback OnCallback} event is raised during a callback request
* and it is raise <b>after</b> the {@link onPageIndexChanged OnPageIndexChanged} event.
- *
+ *
* @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com)
- * @version $Id: TActivePager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1.2
*/
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
}
-
+
/**
* @return TBaseActiveControl standard active control options.
*/
/**
* Raises the callback event. This method is required by {@link
- * ICallbackEventHandler} interface.
+ * ICallbackEventHandler} interface.
* This method is mainly used by framework and control developers.
* @param TCallbackEventParameter the event parameter
*/
-
+
public function raiseCallbackEvent($param)
{
$this->onCallback($param);
{
$this->raiseEvent('OnCallback', $this, $param);
}
-
+
/**
* Builds a dropdown list pager
* Override parent implementation to build Active dropdown lists.
protected function buildListPager()
{
$list=new TActiveDropDownList;
-
+
$list->getAdapter()->getBaseActiveControl()->setClientSide(
$this->getClientSide()
);
-
+
$this->getControls()->add($list);
$list->setDataSource(range(1,$this->getPageCount()));
$list->dataBind();
$list->setSelectedIndex($this->getCurrentPageIndex());
$list->setAutoPostBack(true);
$list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged'));
- $list->attachEventHandler('OnCallback', array($this, 'handleCallback'));
- }
-
+ $list->attachEventHandler('OnCallback', array($this, 'handleCallback'));
+ }
+
/**
* Creates a pager button.
* Override parent implementation to create, depending on the button type, a TActiveLinkButton,
* a TActiveButton or a TActiveImageButton may be created.
- *
+ *
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
{
$button=new TLabel;
$button->setText($text);
+ $button->setCssClass($this->getButtonCssClass());
return $button;
}
}
if(!$enabled)
$button->setEnabled(false);
}
-
+
if($buttonType===TPagerButtonType::ImageButton)
{
$button->ImageUrl = $text;
}
-
+
$button->setText($text);
$button->setCommandName($commandName);
$button->setCommandParameter($commandParameter);
$button->setCausesValidation(false);
-
- $button->attachEventHandler('OnCallback', array($this, 'handleCallback'));
+ $button->setCssClass($this->getButtonCssClass());
+
+ $button->attachEventHandler('OnCallback', array($this, 'handleCallback'));
$button->getAdapter()->getBaseActiveControl()->setClientSide(
$this->getClientSide()
);
-
+
return $button;
}
-
+
/**
* Event handler to the OnCallback active buttons or active dropdownlist.
- * This handler will raise the {@link onCallback OnCallback} event
+ * This handler will raise the {@link onCallback OnCallback} event
*
* @param mixed $sender
* @param TCallbackEventParameter $param
{
$control->render($param->getNewWriter());
// FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting
- // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this.
+ // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this.
usleep(1);
}
}
// Raise callback event
$this->onCallback($param);
- }
-
+ }
+
public function render ($writer)
{
if($this->getHasPreRendered())
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActivePanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
if ($this->getHasControls())
{
// If we update a TActivePanel on callback,
- // We shouldn't update all childs, because the whole content will be replaced by
+ // We shouldn't update all childs, because the whole content will be replaced by
// the parent
foreach ($this->findControlsByType('IActiveControl', false) as $control)
{
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* and can not be changed using javascript.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
* Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false
- *
+ *
*/
protected function renderInputTag($writer,$clientID,$onclick)
{
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* List items can not be changed dynamically during a callback request.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
public function setCaption($value)
{
parent::setCaption($value);
- // if it's an active control, this should not be needed.
+ // if it's an active control, this should not be needed.
$this->callClientFunction('setCaption',$value);
}
* @author LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de>
* @package System.Web.UI.ActiveControls
* @since 3.1.9
- * @version $Id: TActiveRepeater.php 2707 2009-09-29 10:33:30Z Christophe.Boulain $
*/
/**
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* event.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* "informal" are ignored as text for suggestions.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* suggestion selected by the user, -1 if not suggestion is selected.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* item template.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TAutoComplete.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* response returns.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TBaseActiveControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TCallbackClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
/**
* Client script to click on an element. <b>This client-side function is unpredictable.</b>
- *
+ *
* @param TControl control element or element id
*/
public function click($control)
{
$promptText = $control->getPromptText();
$promptValue = $control->getPromptValue();
-
+
if($promptValue==='')
$promptValue = $promptText;
-
+
if($promptValue!=='')
$options[] = array($promptText, $promptValue);
}
-
+
foreach($items as $item)
{
if($item->getHasAttributes())
/**
* Scroll the top of the browser viewing area to the location of the
* element.
+ *
* @param TControl control element or element id
*/
public function scrollTo($element)
{
$boundary = $this->getResponseContentBoundary($content);
}
-
+
$this->callClientFunction('Prado.Element.appendScriptBlock', array($boundary));
}
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
*
* * Note that theses 2 events are not fired correctly by Opera. To make
* them work in this browser, Prado will fire them just after onPreDispatch.
- *
- * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events
+ *
+ * In a general way, onUninitialized, onLoading, onLoaded and onInteractive events
* are not implemented consistently in all browsers.When cross browser compatibility is
* needed, it is best to avoid use them
*
* viewstate update. This will automatically set HasPriority to true when enabled.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TCallbackClientSide.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
* callback handler function) can be set using {@link setResponseData ResponseData} property.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: TActivePageAdapter.php 1648 2007-01-24 05:52:22Z wei $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* to be attached to other active controls.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackOptions.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* property.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
* is generated using microtime.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TCallbackResponseAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
<?php
/**
* TDraggable class file
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
/**
* TDraggable is a control which can be dragged
- *
+ *
* This control will make "draggable" control.
* Properties :
*
* <b>{@link setRevert Revert}</b>: Set to True if you want your dragged element to revert to its initial position if not dropped on a valid area.
* <b>{@link setConstraint Constraint}</b>: Set this to Horizontal or Vertical if you want to constraint your move in one direction.
* <b>{@link setHandle Handle}</b>:
- *
+ *
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
-class TDraggable extends TPanel
+class TDraggable extends TPanel
{
/**
* Set the handle id or css class
{
$this->setViewState('DragHandle', TPropertyValue::ensureString($value), null);
}
-
+
/**
* Get the handle id or css class
* @return string
{
return $this->getViewState('DragHandle', null);
}
-
+
/**
* Determine if draggable element should revert to it orginal position
* upon release in an non-droppable container.
{
return $this->getViewState('Revert', TDraggableRevertOptions::Revert);
}
-
+
/**
* Sets whether the draggable element should revert to it orginal position
* upon release in an non-droppable container.
$value=TDraggableRevertOptions::None;
$this->setViewState('Revert', TPropertyValue::ensureEnum($value, 'TDraggableRevertOptions'), true);
}
-
+
/**
* Determine if the element should be cloned when dragged
* If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
{
return $this->getViewState('Ghosting', TDraggableGhostingOptions::None);
}
-
+
/**
* Sets wether the element should be cloned when dragged
* If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
$value=TDraggableGhostingOptions::None;
$this->setViewState('Ghosting', TPropertyValue::ensureEnum($value, 'TDraggableGhostingOptions'), TDraggableGhostingOptions::None);
}
-
+
/**
* Determine if the element should be constrainted in one direction or not
* @return CDraggableConstraint
{
return $this->getViewState('Constraint', TDraggableConstraint::None);
}
-
+
/**
* Set wether the element should be constrainted in one direction
* @param CDraggableConstraint
{
$this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'TDraggableConstraint'), TDraggableConstraint::None);
}
-
+
/**
* Registers clientscripts
*
$code="new {$class}('{$this->getClientId()}', {$options}) ";
$cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
}
-
+
/**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
{
return 'Draggable';
}
-
+
/**
* Gets the post back options for this textbox.
* @return array
else
$options['revert']=strtolower($revert);
if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint);
- switch ($this->getGhosting())
+ switch ($this->getGhosting())
{
case TDraggableGhostingOptions::SuperGhosting:
$options['superghosting']=true;
return $options;
}
-
+
}
/**
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableConstraint extends TEnumerable
{
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableGhostingOptions extends TEnumerable
{
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableRevertOptions extends TEnumerable
{
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3159 2012-2013 PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright © 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TDropContainerEventParameter extends TEventParameter
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* {@link setPreventDefaultAction PreventDefaultAction} is set to true.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TEventTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
*
* Since 3.1.2, you can set the {@link setReadOnly ReadOnly} property to make
* the control not editable. This property can be also changed on callback
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TInPlaceTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
$client->setValue($this, $value);
}
}
-
+
/**
* Update ClientSide Readonly property
* @param boolean value
if($this->hasEventHandler('OnLoadingText'))
$options['LoadTextOnEdit'] = true;
-
+
$options['ReadOnly']=$this->getReadOnly();
return $options;
}
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* {@link setStartTimerOnLoad StartTimerOnLoad} is true.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TTimeTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* property sets the control ID to observe the trigger.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
* observed, the polling interval is reset to the original value.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TValueTriggeredCallback.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCachePageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1.1
*/
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
$this->_registeredPradoScripts[$name]=true;
else
throw new TInvalidOperationException('csmanager_pradoscript_invalid',$name);
-
+
if(($packages=array_keys($this->_registeredPradoScripts))!==array())
{
$base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH;
if($target instanceof TControl)
$target=$target->getClientID();
$id = TJavaScript::quoteString($target);
- $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');';
+ $this->_endScripts['prado:focus'] = 'Prado.Element.focus('.$id.');';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
* $this->Page->ClientScript->registerStyleSheetFile($url, $url);
* }
* }
- * ?>
* </code>
*
* @param string a unique key identifying the file
public function registerScriptFile($key, $url)
{
$this->_scriptFiles[$key]=$url;
-
+
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerScriptFile',$params);
}
*/
public function flushScriptFiles($writer, $control=null)
{
- $this->_page->ensureRenderInForm($control);
- $this->renderAllPendingScriptFiles($writer);
+ if(!$this->_page->getIsCallback())
+ {
+ $this->_page->ensureRenderInForm($control);
+ $this->renderAllPendingScriptFiles($writer);
+ }
}
/**
$writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n");
}
- public function getHiddenFields()
+ public function getHiddenFields()
{
return $this->_hiddenFields;
}
* between ActiveControls and validators.
*
* @author <weizhuo[at]gmail[dot]com>
- * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* by other controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompositeControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* They work together with page lifecycles to process a page request.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* controls to maintain a list of their child controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* controls to it. This is useful for controls that do not allow child controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* INamingContainer marks a control as a naming container.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* If a control wants to respond to postback event, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* If a control wants to load post data, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* If a control wants to validate user input, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* If a control wants to be validated by a validator, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* If a control wants to check broadcast event, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* This interface must be implemented by theme.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* parsed template structures.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* {@link TImageButton}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* {@link setParameter Parameter} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* with the command via {@link getCommandParameter CommandParameter} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* consecutive static strings, expressions and statements.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* various behaviors for the control to which the adapter is attached.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* URLs.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TForm.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
$this->renderChildren($writer);
$cs->renderHiddenFieldsEnd($writer);
$page->endFormRender($writer);
-
+
$cs->renderScriptFilesEnd($writer);
$cs->renderEndScripts($writer);
}
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* tags in HTML and XHTML.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THtmlWriter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
{
return $this->_writer;
}
-
+
public function setWriter($writer)
{
$this->_writer = $writer;
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* TPage class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
return $data;
}
}
-
+
/**
* Sets Adapter to TActivePageAdapter and calls apter to process the
* callback request.
$this->setAdapter(new TActivePageAdapter($this));
+ $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
+ if(strlen($callbackEventParameter) > 0)
+ $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter);
+
// Decode Callback postData from UTF-8 to current Charset
if (($g=$this->getApplication()->getGlobalization(false))!==null &&
strtoupper($enc=$g->getCharset())!='UTF-8')
* classes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* traffic for transmitting bulky page state.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TSessionPageStatePersister.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* different extension name. For template file, the extension name is ".tpl".
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
*/
* template manager module that can be accessed via {@link TPageService::getTemplateManager()}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* set their parent as $control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateManager.php 3251 2013-01-15 18:37:04Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* and {@link getBufferOutput BufferOutput} are configurable properties of THttpResponse.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* To apply a theme to a particular control, call {@link applySkin}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TThemeManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
* </code>
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
}
/**
- * @return string CSS class for the whole accordion control div.
+ * @return string CSS class for the whole accordion control div.
*/
public function getCssClass()
{
protected function registerStyleSheet()
{
$url = $this->getCssUrl();
-
+
if($url === '') {
return;
}
-
+
if($url === 'default') {
$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'accordion.css');
}
-
+
if($url !== '') {
$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
}
* Class TAccordionView.
*
* TAccordionView represents a single view in a {@link TAccordion}.
- *
+ *
* TAccordionView is represented inside the {@link TAccordion} with an header label whose text is defined by
* the {@link setCaption Caption} property; optionally the label can be an hyperlink: use the
* {@link setNavigateUrl NavigateUrl} property to define the destination url.
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
$writer->addAttribute('id',$this->getClientID().'_0');
$style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle();
-
+
$style->addAttributesToRender($writer);
$writer->renderBeginTag($this->getTagName());
$url = $this->getNavigateUrl();
if(($caption=$this->getCaption())==='')
$caption=' ';
-
+
if ($url!='')
$writer->write("<a href=\"{$url}\">");
$writer->write("{$caption}");
* Class TAccordionViewCollection.
*
* TAccordionViewCollection is a collection of {@link TAccordionView} to be used inside a {@link TAccordion}.
- *
+ *
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @version $Id: TAccordion.php 2915 2011-05-15 16:26:11Z ctrlaltca@gmail.com $
* @package System.Web.UI.WebControls
* @since 3.2
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* content can be specified via {@link setHorizontalAlign HorizontalAlign}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* override the method {@link evaluateIsValid}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
$target=$this->getValidationTarget();
// if the target is not a disabled web control
if($target===null ||
- ($target!==null &&
+ ($target!==null &&
!($target instanceof TWebControl && !$target->getEnabled(true))))
{
if($this->evaluateIsValid())
* See the quickstart documentation for further details.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - String
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBaseValidator.php 3319 2013-09-08 20:59:44Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* For more details, see {@link TRepeater} and {@link TDataList}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBoundColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* will be raised under such a circumstance.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* of the item that is currently being clicked.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* for a {@link TBulletedList} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - LinkButton: the bulleted list items are displayed as link buttons that can cause postbacks
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TBulletedList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* if the button does not cause a postback.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Button: a client button (normally does not perform form submission)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCaptcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* the CAPTCHA control that the user input should be compared with.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCaptchaValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
/**
* Check if we need a span tag to surround this control. The span tag will be created if
- * the Text property is set for this control.
+ * the Text property is set for this control.
*
* @return bool wether this control needs a surrounding span tag
*/
* - Right: right aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBoxColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* The alignment of the text besides each checkbox can be specified via {@link setTextAlign TextAlign}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCheckBoxList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
{
return false;
}
-
+
/**
* @param boolean whether the control is to be enabled.
*/
{
parent::setEnabled($value);
$value = !TPropertyValue::ensureBoolean($value);
- // if this is an active control,
- // and it's a callback,
+ // if this is an active control,
+ // and it's a callback,
// and we can update clientside,
// then update the 'disabled' attribute of the items.
if(($this instanceof IActiveControl) &&
/**
* Wether the list should be rendered inside a span or not
- *
+ *
*@return boolean true if we need a span
*/
protected function getSpanNeeded ()
{
return $this->getRepeatLayout()===TRepeatLayout::Raw;
}
-
+
/**
* Renders the checkbox list control.
* This method overrides the parent implementation.
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
$options['ItemCount'] = $this->getItemCount();
return $options;
}
-
+
}
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* set the {@link setFlushScriptFiles FlushScriptFiles} property to false, so Prado
* can postpone the loading of all the referenced script files further down the page
* generation cycle.
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TClientScript.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* # <b>Simple</b> - Grid with 12 simple colors.
* # <b>Basic</b> - Grid with the most common 70 colors. This is the default mode.
* # <b>Full</b> - Full-featured color picker.
- *
+ *
* The <b>CssClass</b> property can be used to override the CSS class name
* for the color picker panel. The <b>ColorStyle</b> property sets the packages
* styles available. E.g. <b>default</b>.
- *
+ *
* If the <b>Mode</b> property is set to <b>Full</b>, the color picker panel will
* display an "Ok" and "Cancel" buttons. You can customize the button labels setting the <b>OKButtonText</b>
* and <b>CancelButtonText</b> properties.
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* # Full - Full-featured color picker.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* Client-side javascript code options.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TColorPicker.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* LessThan and LessThanEqual.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - LessThanEqual
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCompareValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* or {@link getFalseTemplate FalseTemplate}, but never both. And the condition is evaluated only once.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TConditional.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* {@link TContent} and {@link TContentPlaceHolder} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TContent.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* {@link TContent} and {@link TContentPlaceHolder} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TContentPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* with the TCustomValidator.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* <b>OnServerValidate</b> event of TCustomValidator components.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TCustomValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* custom paging, set {@link setAllowCustomPaging AllowCustomPaging} to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Pager: pager
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataBoundControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* - Save the data in viewstate and get it back during postbacks.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* Depending on the button type, a TLinkButton or a TButton may be created.
* If it is enabled (clickable), its command name and parameter will also be set.
* Derived classes may override this method to create additional types of buttons, such as TImageButton.
- * @param mixed the container pager instance of TActiveDatagridPager
+ * @param mixed the container pager instance of TActiveDatagridPager
* @param string button type, either LinkButton or PushButton
* @param boolean whether the button should be enabled
* @param string caption of the button
* The {@link getItem Item} property indicates the datagrid item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* The {@link getPager Pager} property indicates the datagrid pager related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* gives the sort expression carried with the sort command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* returns the new page index carried with the page command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* gives the index of the item from the bound data source.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataGridPager represents a datagrid pager.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataGridItemCollection represents a collection of data grid items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataGridColumnCollection represents a collection of data grid columns.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Numeric: pager buttons are displayed as numeric page numbers
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - PushButton: form submit buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - TopAndBottom: pager appears on both top and bottom of the data grid.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGrid.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* which is the major logic for managing the data and presentation of cells in the column.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - ImageButton: image buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* define an item renderer class specific for {@link TDataGrid}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TDataGridPagerStyle specifies the styles available for a datagrid pager.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataGridPagerStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* complex data may also have serializing problem if saved in viewstate.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* The {@link getItem Item} property indicates the DataList item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* is given by {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataListItemCollection represents a collection of data list items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* which allows TDataList to apply CSS styles to the renders.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataListItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
* - {@link getData Data}: data associated with this renderer.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* IDataSource class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataSourceControl class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataSourceControl class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TDataSourceSelectParameters class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TDataSourceView class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TReadOnlyDataSourceView class
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDataSourceView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* provided, the string will be assumed to be in GNU datetime format.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TDataTypeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
{
return $this->getViewState('UpToYear', intval(@date('Y'))+10);
}
-
+
/**
* @param TDatePickerPositionMode calendar UI position
*/
* is changed.
* The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
* as parameter to this event
- *
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - DropDownList: dropdown lists are used to pick up date values
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - ImageButton: Shows an image next to the text input, clicking on the image shows the date picker,
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDatePicker.php 3318 2013-09-04 14:04:51Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* available item in the dropdown list will be selected.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDropDownList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TDropDownListColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TEditCommandColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* checkdnsrr() is available in the installed PHP.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* make sure {@link setExpression Expression} does not come directly from user input.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TExpression.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* (whether it succeeds or not).
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TFileUpload.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
* @author Berczi Gabor <gabor.berczi@devworx.hu>
* @link http://www.pradosoft.com/
* @license http://www.pradosoft.com/license/
- * @version $Id: TFlushOutput.php $
* @package System.Web.UI.WebControls
*/
* <com:TFlushOutput />
* </code>
*
- * You can specify whether you want to keep buffering of the output
+ * You can specify whether you want to keep buffering of the output
* (if it was enabled) till the next occourence of a <com: TFlushOutput />
- * or the end of the page rendering, or stop buffering, by using the
+ * or the end of the page rendering, or stop buffering, by using the
* {@link setContinueBuffering ContinueBuffering}.
*
* @author Berczi Gabor <gabor.berczi@devworx.hu>
- * @version $Id: TFlushOutput.php $
* @package System.Web.UI.WebControls
* @since 3.1
*/
-class TFlushOutput extends TControl
+class TFlushOutput extends TControl
{
/**
* @var boolean whether to continue buffering of output
public function render($writer)
{
//$writer->write('<!-- flush -->');
- // ajax responses can't be parsed by the client side before loaded and returned completely,
+ // ajax responses can't be parsed by the client side before loaded and returned completely,
// so don't bother with flushing output somewhere mid-page if refreshing in a callback
if (!$this->Page->IsCallback)
{
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TFont encapsulates the CSS style fields related with font settings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TFont.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
*/
* theme will not be rendered.
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
* attributes for a meta tag, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* contained in a {@link THead} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THead.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader1.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader1.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader1 extends THtmlElement {
-
+
+class THeader1 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h1';
}
-
+
}
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader2.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader2.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader2 extends THtmlElement {
-
+
+class THeader2 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h2';
}
-
+
}
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader3.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader3.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2a
*/
-
-class THeader3 extends THtmlElement {
-
+
+class THeader3 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h3';
}
-
+
}
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader4.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader4.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader4 extends THtmlElement {
-
+
+class THeader4 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h4';
}
-
+
}
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader5.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader5.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader5 extends THtmlElement {
-
+
+class THeader5 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h5';
}
-
+
}
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THeader6.php 2590 2008-12-10 11:34:24Z carlgmathisen $
* @package System.Web.UI.WebControls
*/
* This is also useful for the {@link TWebControlDecorator} (used by themes).
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THeader6.php 2541 2008-10-21 15:05:13Z javalizard $
* @package System.Web.UI.WebControls
* @since 3.2
*/
-
-class THeader6 extends THtmlElement {
-
+
+class THeader6 extends THtmlElement {
+
/**
* @return string tag name
*/
{
return 'h6';
}
-
+
}
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.xisc.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* event will be raised.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THiddenField.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
$options['theme_advanced_toolbar_align'] = 'left';
$options['theme_advanced_path_location'] = 'bottom';
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
+ if($this->getReadOnly())
+ $options['readonly'] = true;
$options = array_merge($options, $this->parseEditorOptions($this->getOptions()));
return $options;
if(count($option) == 2)
{
$value=trim(trim($option[1]),"'\"");
- if (($s=strtolower($value))==='false')
+ if (($s=strtolower($value))==='false')
$value=false;
elseif ($s==='true')
$value=true;
*
* @author Fabio Bas <ctrlaltca[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlArea4.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* THtmlArea4 wraps the visual editing functionalities provided by the
* version 4 of TinyMCE project {@link http://tinymce.com/}. It has been
- * developed as a plug'n'play substitute for {@link THtmlArea}, that is
+ * developed as a plug'n'play substitute for {@link THtmlArea}, that is
* based on the previous iteration (version 3) of the same project.
* Please note that both components can't be used together in the same page.
*
* </code>
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: THtmlArea.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
$options['height'] = $this->getHeight();
$options['resize'] = 'both';
$options['menubar'] = false;
+ if($this->getReadOnly())
+ {
+ $options['readonly'] = true;
+ $options['toolbar'] = false;
+ $options['menubar'] = false;
+ $options['statusbar'] = false;
+ }
$options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
if(count($option) == 2)
{
$value=trim(trim($option[1]),"'\"");
- if (($s=strtolower($value))==='false')
+ if (($s=strtolower($value))==='false')
$value=false;
elseif ($s==='true')
$value=true;
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: THtmlElement.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
{
$this->_tagName=TPropertyValue::ensureString($value);
}
-
+
/**
* This is the default tag when no other is specified
- * @return string the default tag
+ * @return string the default tag
*/
public function getDefaultTagName() {
return 'span';
}
-
+
/**
* This tells you if this TagName has deviated from the original
- * @return boolean true if TagName has deviated from the default.
+ * @return boolean true if TagName has deviated from the default.
*/
public function getIsMutated() {
return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName();
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.xisc.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* the alignment of the image displayed is set by the
* {@link setImageAlign ImageAlign} property and {@link getText Text} is
* displayed as the alternate text of the image.
- *
+ *
* The link target is specified via the {@link setTarget Target} property.
* If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty,
* the content enclosed within the control tag will be rendered.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
{
return $this->getViewState('ImageHeight','');
}
-
+
/**
* Sets the height of the image in the THyperLink
* @param string height of the image in the THyperLink
{
$this->setViewState('ImageUrl',$value,'');
}
-
+
/**
* @return string width of the image in the THyperLink
*/
{
return $this->getViewState('ImageWidth','');
}
-
+
/**
* Sets the width of the image in the THyperLink
* @param string width of the image
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THyperLinkColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
{
return $this->getViewState('ImageHeight','');
}
-
+
/**
* @param string height of the image in the THyperLink
*/
{
return $this->getViewState('ImageUrl','');
}
-
+
/**
* @param string url of the image in the THyperLink
*/
{
$this->setViewState('ImageUrl',$value,'');
}
-
+
/**
* @return string width of the image in the THyperLink
*/
{
return $this->getViewState('ImageWidth','');
}
-
+
/**
* @param string width of the image in the THyperLink
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* or {@link setDescriptionUrl DescriptionUrl} property, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImage.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TImageButton displays the {@link setText Text} property as the hint text to the displayed image.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* {@link TImageButton::onClick Click} event of {@link TImageButton} controls.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* access {@link getPostBackValue PostBackValue}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* THotSpotCollection represents a collection of hotspots in an imagemap.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* and {@link TRectangleHotSpot}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TImageMap} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TImageMap} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Inactive: the hotspot is inactive (not clickable)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TImageMap.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* @author Jason Ragsdale <jrags@jasrags.net>
* @author Harry Pottash <hpottash@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Original Prado v2 IFrame Author Information
* @author Jason Ragsdale <jrags@jasrags.net>
* @author Harry Pottash <hpottash@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Bottom: bottom aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Both: show both horizontal and vertical scroll bars all the time.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TInlineFrame.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
* - {@link getData Data}: data associated with this renderer
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TItemDataRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.2
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TJavascriptLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
class TJavascriptLogger extends TWebControl
{
private static $_keyCodes = array(
- '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57,
+ '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57,
'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72,
'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80,
'q'=>81, 'r'=>82, 's'=>83, 't'=>84, 'u'=>85, 'v'=>86, 'w'=>87, 'x'=>88, 'y'=>89, 'z'=>90);
*
* @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
* also be changed by specifying {@link setKeyboardCssClass KeyboardCssClass}.
*
* @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TKeyboard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Make sure it does not contain dangerous characters that you want to avoid.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLabel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* as an image button by enclosing an <img> tag as the body of TLinkButton.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
}
/**
- * Returns true if this control validated successfully.
+ * Returns true if this control validated successfully.
* Defaults to true.
* @return bool wether this control validated successfully.
*/
* - Multiple: allow multiple selection
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* @author Robin J. Rogge <rojaro@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* be used to add a dummy list item that will be rendered first.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
public function renderContents($writer)
{
$this->renderPrompt($writer);
-
+
if($this->_items)
{
$writer->writeLine();
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail.com>
- * @version $Id: TListControlValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* if the list control supports so.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListItem.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* does not contain unwanted characters that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLiteral.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $
* @package System.Web.UI.WebControls
*/
* If {@link setEncode Encode} is true, the static texts will be HTML-encoded.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TLiteralColumn.php 1397 2006-09-07 07:55:53Z wei $
* @package System.Web.UI.WebControls
* @since 3.0.5
*/
if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::EditItem || $itemType===TListItemType::SelectedItem)
{
if($this->getDataField()!=='')
- $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
- else
{
- if(($dataField=$this->getDataField())!=='')
- $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
- else
- {
- $text=$this->getText();
- if($this->getEncode())
- $text=THttpUtility::htmlEncode($text);
- $cell->setText($text);
- }
+ $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
+ } else {
+ $text=$this->getText();
+ if($this->getEncode())
+ $text=THttpUtility::htmlEncode($text);
+ $cell->setText($text);
}
}
else
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Using TTextHighlighter and MarkdownParser classes
*/
Prado::using('System.Web.UI.WebControls.TTextHighlighter');
-Prado::using('System.3rdParty.Markdown.MarkdownParser');
+Prado::using('System.3rdParty.Parsedown.Parsedown');
/**
* TMarkdown class
* To use TMarkdown, simply enclose the content to be rendered within
* the body of TMarkdown in a template.
*
- * See http://www.pradosoft.com/demos/quickstart/?page=Markdown for
+ * See https://daringfireball.net/projects/markdown/basics for
* details on the Markdown syntax usage.
*
* TMarkdown also performs syntax highlighting for code blocks whose language
* and enclosed within a pair of square brackets (e.g. [php]).
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TMarkdown.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
*/
public function processText($text)
{
- $renderer = new MarkdownParser;
- $result = $renderer->parse($text);
+ $result = Parsedown::instance()->parse($text);
return preg_replace_callback(
- '/<pre><code>\[\s*(\w+)\s*\]\n+((.|\n)*?)\s*<\\/code><\\/pre>/im',
+ '/<pre><code class="language-(\w+)">((.|\n)*?)<\\/code><\\/pre>/im',
array($this, 'highlightCode'), $result);
}
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* when its active view is changed during a postback.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TViewCollection represents a collection that only takes {@link TView} instances
* as collection elements.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TMultiView.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* to determine whether the content is cached or not.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
$textwriter = new TTextWriter();
$multiwriter = new TOutputCacheTextWriterMulti(array($writer->getWriter(),$textwriter));
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter);
-
+
$stack=$this->getPage()->getCachingStack();
$stack->push($this);
parent::render($htmlWriter);
* <b>OnCheckDependency</b> event of {@link TOutputCache} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* <b>OnCalculateKey</b> event of {@link TOutputCache} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TOutputCache.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.2
*/
//parent::__construct();
$this->_writers = $writers;
}
-
+
public function write($s)
{
foreach($this->_writers as $writer)
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* Since Prado 3.2.1, you can use the {@link setButtonCssClass ButtonCssClass} property to specify a css class
* that will be applied to each button created by the pager in NextPrev or Numeric mode.
- *
+ *
* TPager raises an {@link onPageIndexChanged OnPageIndexChanged} event when
* the end-user interacts with it and specifies a new page (e.g. clicking
* on a page button that leads to a new page.) The new page index may be obtained
* Multiple pagers can be associated with the same data-bound control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.2
*/
* returns the new page index carried with the page command.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.2
*/
* - DropDownList: a dropdown list is used to select pages
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - PushButton: form submit buttons
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* by setting the {@link setDefaultButton DefaultButton} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
if(($butt=$this->getDefaultButton())!=='')
{
- $buttons = $this->findControlsByID($butt);
- if (count($buttons)>0)
- $button = reset($buttons);
- else
- $button = null;
- if($button===null)
+ if(($button=$this->findControl($butt))===null)
throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt);
else
$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TPanelStyle represents the CSS style specific for panel HTML tag.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - RightToLeft: content in a panel is right to left
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Vertical: vertical scroll bar only
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPanelStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* by manipulating the {@link TControl::getControls Controls} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TPlaceHolder.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Using TCheckBox parent class
*/
Prado::using('System.Web.UI.WebControls.TCheckBox');
-/**
- * Using TRadioButtonList class
- */
-Prado::using('System.Web.UI.WebControls.TRadioButtonList');
/**
* TRadioButton class
* that may bring security vulnerabilities.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRadioButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
{
if($groupName!=='')
$groupName=substr($uniqueID,0,$pos+1).$groupName;
- else if($this->getNamingContainer() instanceof TRadioButtonList)
+ else if(is_a($this->getNamingContainer(), 'TRadioButtonList'))
$groupName=substr($uniqueID,0,$pos);
}
if($groupName==='')
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* one radiobutton can be selected at a time.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRadioButtonList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* defaulted as UTF-8.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - StringLength
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRangeValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
- * @version $Id: TRatingList.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
$index = $this->getRatingIndex($value);
parent::setSelectedIndex($index);
}
-
+
public function setSelectedIndex($value)
{
$this->setRating($value+1);
{
return $this->getViewState('RatingStyle', 'default');
}
-
+
/**
* @return string rating style css class name.
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Use a {@link TRequiredFieldValidator} to ensure the input is not empty.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRegularExpressionValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* This interface must be implemented by classes who want to use {@link TRepeatInfo}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* the column and repeat direction settings.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Horizontal
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Raw: the repeated contents are stacked together without any additional decorations
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeatInfo.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* complex data may also have serializing problem if saved in viewstate.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* The {@link getItem Item} property indicates the repeater item related with the event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* raises the Command event.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* is given by {@link getItemType ItemType} property.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TRepeaterItemCollection represents a collection of repeater items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeater.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* the bubbling scheme for the OnCommand event of repeater items.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRepeaterItemRenderer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
else
return $this->validateStandardControl($control);
}
-
+
private function validateListControl($control)
{
$initial = trim($this->getInitialValue());
}
return $count > 0;
}
-
+
private function validateRadioButtonGroup($control)
{
$initial = trim($this->getInitialValue());
}
return false;
}
-
+
private function validateStandardControl($control)
{
$initial = trim($this->getInitialValue());
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* to ensure the contents gets parsed correctly.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TSafeHtml.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
* You can also provide the allowed values by setting the {@link SetValues Values} array.
*
* A 'Progress Indicator' can be displayed within the track with the {@link SetProgressIndicator ProgressIndicator} property.
- *
+ *
* The TSlider control can be easily customized using CssClasses. You can provide your own css file, using the
* {@link SetCssUrl CssUrl} property.
- * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider"
+ * The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider"
* for an horizontal slider, and "Slider VerticalSlider" for a vertical one.
*
* If {@link SetAutoPostBack AutoPostBack} property is true, postback is sent as soon as the value changed.
* - ClientSide.onChange is called when the slider value has changed (at the end of a move).
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
{
$this->setViewState('StepSize', $value, 1.0);
}
-
+
/**
* @return boolean wether to display a progress indicator or not. Defaults to true.
*/
{
$this->setViewState('Values', TPropertyValue::ensureArray($value), array());
}
-
+
/**
* @return boolean a value indicating whether an automatic postback to the server
* will occur whenever the user modifies the slider value. Defaults to false.
$class=($this->getDirection()==TSliderDirection::Horizontal)?'HorizontalSlider':'VerticalSlider';
$writer->addAttribute('class', 'Slider '.$class);
}
-
+
}
/**
}
$writer->renderEndTag();
*/
-
+
$writer->renderEndTag();
-
+
// Render the 'Handle'
$writer->addAttribute('class', 'Handle');
$writer->addAttribute('id', $this->getClientID().'_handle');
* The <tt>OnChange</tt> event is raised when the slider value is changed (or at the end of a move)
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
* - Vertical : Vertical slider
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @version $Id: TSlider.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* make sure {@link setStatements Statements} does not come directly from user input.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStatements.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TStyle encapsulates the CSS style applied to a control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Hidden: the control is not displayed and is included in the layout.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1
*/
* TTableStyle represents the CSS style specific for HTML table.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TTableItemStyle represents the CSS style specific for HTML table item.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Justify: the begin and end are justified
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Middle: middle aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Both: both horizontal and vertical grid lines are shown
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TStyleSheet.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
* </code>
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
protected function registerStyleSheet()
{
$url = $this->getCssUrl();
-
+
if($url === '') {
return;
}
-
+
if($url === 'default') {
$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
}
-
+
if($url !== '') {
$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
}
* setting the {@link setActive Active} property.
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
* TTabViewCollection is used to maintain a list of views belong to a {@link TTabPanel}.
*
* @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTabPanel.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.1.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TTableRowCollection is used to maintain a list of rows belong to a table.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Right: right aligned
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTable.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* indicates whether the contents in the cell should be wrapped.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TTableFooterRow displays a table footer row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableFooterRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TTableHeaderCell displays a table header cell on a Web page.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Column: the scope is column-wise
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderCell.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* TTableHeaderRow displays a table header row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableHeaderRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* {@link setVerticalAlign VerticalAlign} properties, respectively.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TTableCellCollection is used to maintain a list of cells belong to a table row.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Footer: in table footer
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTableRow.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* takes precedence.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTemplateColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Currently, no alternatives are available.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Password: the textbox will hide user input like a password input box
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* by a {@link TTextBox} control.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextBox.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* because it needs to insert some CSS styles.
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
/**
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Id: TTextHighlighter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* Note, all child classes must implement {@link processText} method.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TTextProcessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI
* @since 3.0.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* {@link setEnableClientScript EnableClientScript} is true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* See the quickstart documentation for further details.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - HeaderOnly: only the HeaderText will be display.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Fixed: Similar to Dynamic except that the error messages physically occupy the page layout (even though they may not be visible)
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TValidationSummary.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* the body contents enclosed within the HTML tag.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWebControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* @var boolean ensures the inclusion the id in the tag rendering.
*/
private $_ensureid=false;
-
+
/**
* @var TWebControlDecorator this render things before and after both the open and close tag
*/
protected $_decorator;
-
+
/**
* Subclasses can override getEnsureId or just set this property. eg. If your subclass
$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
return $this->_decorator;
}
-
+
/**
* Copies basic control attributes from another control.
* Properties including AccessKey, ToolTip, TabIndex, Enabled
{
$this->getStyle()->setWidth($value);
}
-
+
/**
- * If your subclass overrides the onPreRender method be sure to call
+ * If your subclass overrides the onPreRender method be sure to call
* this method through parent::onPreRender($param); so your sub-class can be decorated,
* among other things.
* @param TEventParameter event parameter to be passed to the event handlers
public function onPreRender($param) {
if($decorator = $this->getDecorator(false))
$decorator->instantiate();
-
+
parent::onPreRender($param);
}
$decorator->renderPostContentsText($writer);
$writer->renderEndTag();
$decorator->renderPostTagText($writer);
- } else
+ } else
$writer->renderEndTag($writer);
}
}
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* browsers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWebControlAdapter.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
*
* @author Brad Anderson <javalizard@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $
* @package System.Web.UI.WebControls
*/
/**
* TWebControlDecorator class
- *
+ *
* A TWebControlDecorator can be applied to a {@link TWebControl} to customize its rendering.
- * TWebControlDecorator can add custom html code before and after both the open and close
+ * TWebControlDecorator can add custom html code before and after both the open and close
* tag of a {@link TWebControl}.
* The html code can be an user-defined text or an external template file that will be
* instantiated and rendered in place.
- *
- * This is an easy way to have your look and feel depend upon the theme instead of writing
+ *
+ * This is an easy way to have your look and feel depend upon the theme instead of writing
* specific html in your templates to achieve your website desires.
* Here is an example of how to code your theme skin:
* <code>
*
*
* @author Brad Anderson <javalizard@gmail.com>
- * @version $Id: TWebControlDecorator.php 2541 2008-10-21 15:05:13Z qiang.xue $
* @package System.Web.UI.WebControls
* @since 3.2
*/
class TWebControlDecorator extends TComponent {
-
+
/**
* @var boolean tells if there should only be decoration around the inner content
*/
private $_internalonly;
-
+
/**
* @var boolean tells if the decoration uses state in its templates. If there are no templates
- * in the instance of the decoration this variable is unused.
+ * in the instance of the decoration this variable is unused.
*/
private $_usestate = false;
-
+
/**
* @var TWebControl the control to decorate
*/
private $_control;
-
+
/**
* @var TControl to tell the decorator where to place the outer controls
*/
private $_outercontrol;
-
+
/**
- * @var boolean This tells if the Templates have been
+ * @var boolean This tells if the Templates have been
*/
private $_addedTemplateDecoration=false;
-
-
+
+
/**
* @var string the text that goes before the open tag
*/
* @var string the text that goes after the close tag
*/
private $_posttagtext = '';
-
-
-
+
+
+
/**
* @var TTemplate the template that goes before the open tag
*/
* @var TTemplate the template that goes after the close tag
*/
private $_posttagtemplate;
-
+
/**
* Constructor.
* Initializes the control .
$this->_control = $control;
$this->_internalonly = $onlyinternal;
}
-
+
/**
* @return boolean if the templates in this decoration need state. This defaults to false
*/
{
return $this->_usestate;
}
-
+
/**
- * @param boolean $value true to tell the decoration that the templates need state and should be
+ * @param boolean $value true to tell the decoration that the templates need state and should be
* placed in a control step before the state is saved.
*/
public function setUseState($value)
{
$this->_usestate = TPropertyValue::ensureBoolean($value);
}
-
+
/**
* @return string gets the text before the open tag in the TWebControl
*/
public function getPreTagText() {
return $this->_pretagtext;
}
-
+
/**
* @param string sets the text before the open tag in the TWebControl
*/
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_pretagtext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text after the open tag in the TWebControl
*/
public function getPreContentsText() {
return $this->_precontentstext;
}
-
+
/**
* @param string sets the text after the open tag in the TWebControl
*/
if(!$this->_control->getIsSkinApplied())
$this->_precontentstext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text before the close tag in the TWebControl
*/
public function getPostContentsText() {
return $this->_postcontentstext;
}
-
+
/**
* @param string sets the text before the close tag in the TWebControl
*/
if(!$this->_control->getIsSkinApplied())
$this->_postcontentstext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return string the text before the close tag in the TWebControl
*/
public function getPostTagText() {
return $this->_posttagtext;
}
-
+
/**
* @param string sets the text after the close tag in the TWebControl
*/
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_posttagtext = TPropertyValue::ensureString($value);
}
-
-
+
+
/**
* @return TTemplate|null the template before the open tag in the TWebControl. Defaults to null.
*/
public function getPreTagTemplate() {
return $this->_pretagtemplate;
}
-
+
/**
* @param TTemplate sets the template before the open tag in the TWebControl
*/
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_pretagtemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template after the open tag in the TWebControl. Defaults to null.
*/
public function getPreContentsTemplate() {
return $this->_precontentstemplate;
}
-
+
/**
* @param TTemplate sets the template after the open tag in the TWebControl
*/
if(!$this->_control->getIsSkinApplied())
$this->_precontentstemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template before the close tag in the TWebControl. Defaults to null.
*/
public function getPostContentsTemplate() {
return $this->_postcontentstemplate;
}
-
+
/**
* @param TTemplate sets the template before the close tag in the TWebControl
*/
if(!$this->_control->getIsSkinApplied())
$this->_postcontentstemplate = $value;
}
-
-
+
+
/**
* @return TTemplate|null the template after the close tag in the TWebControl. Defaults to null.
*/
public function getPostTagTemplate() {
return $this->_posttagtemplate;
}
-
+
/**
* @param TTemplate sets the template before the close tag in the TWebControl
*/
if(!$this->_internalonly && !$this->_control->getIsSkinApplied())
$this->_posttagtemplate = $value;
}
-
+
/**
- * this is a framework call. The Text decoration can't
+ * this is a framework call. The Text decoration can't
* influence the object hierarchy because they are rendered into into the writer directly.
- * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so
+ * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so
* these controls don't have page states. This is as close to not influencing the page as possible.
*/
public function instantiate($outercontrol = null) {
- if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
+ if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
$this->getPostContentsTemplate() || $this->getPostTagTemplate()) {
-
+
$this->_outercontrol = $outercontrol;
if($this->getUseState())
$this->ensureTemplateDecoration();
$this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration');
}
}
-
-
+
+
/**
* This method places the templates around the open and close tag. This takes a parameter which is
* to specify the control to get the outer template decoration. If no outer control is specified
- * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's
+ * @param TComponent this indicates the component or control to get the outer tag elements, just in case it's
* different than attached TWebControl. If none is provided, the outer templates default to the attached
* control
* @return boolean returns true if the template decorations have been added
*/
public function ensureTemplateDecoration($sender=null, $param=null) {
-
+
$control = $this->_control;
$outercontrol = $this->_outercontrol;
if($outercontrol === null)
$outercontrol = $control;
-
+
if($this->_addedTemplateDecoration)
return $this->_addedTemplateDecoration;
-
+
$this->_addedTemplateDecoration = true;
-
+
if($this->getPreContentsTemplate())
{
$precontents = Prado::createComponent('TCompositeControl');
$this->getPreContentsTemplate()->instantiateIn($precontents);
$control->getControls()->insertAt(0, $precontents);
}
-
+
if($this->getPostContentsTemplate())
{
$postcontents = Prado::createComponent('TCompositeControl');
$this->getPostContentsTemplate()->instantiateIn($postcontents);
$control->getControls()->add($postcontents);
}
-
+
if(!$outercontrol->getParent())
return $this->_addedTemplateDecoration;
-
-
+
+
if($this->getPreTagTemplate())
{
$pretag = Prado::createComponent('TCompositeControl');
$this->getPreTagTemplate()->instantiateIn($pretag);
$outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag);
}
-
+
if($this->getPostTagTemplate())
{
$posttag = Prado::createComponent('TCompositeControl');
}
return true;
}
-
-
+
+
/**
* This method places the pre tag text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
public function renderPreTagText($writer) {
$writer->write($this->getPreTagText());
}
-
+
/**
* This method places the pre contents text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
public function renderPreContentsText($writer) {
$writer->write($this->getPreContentsText());
}
-
+
/**
* This method places the post contents text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
public function renderPostContentsText($writer) {
$writer->write($this->getPostContentsText());
}
-
+
/**
* This method places the post tag text into the {@link TTextWriter}
* @param {@link TTextWriter} the writer to which the text is written
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
* - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* set {@link setAllowReturn AllowReturn} to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* if the navigation template is not specified, default navigation will be used.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* by a {@link TWizard}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardSideBarTemplate class.
* TWizardSideBarTemplate is the default template for wizard sidebar.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardSideBarListItemTemplate class.
* TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardNavigationTemplate class.
* TWizardNavigationTemplate is the base class for various navigation templates.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardStartNavigationTemplate is the template used as default wizard start navigation panel.
* It consists of two buttons, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel.
* It consists of three buttons, Previous, Complete and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* TWizardStepNavigationTemplate is the template used as default wizard step navigation panel.
* It consists of three buttons, Previous, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* - Link: a hyperlink button
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
* - Finish: the last step before the Complete step.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id $
* @package System.Web.UI.WebControls
* Otherwise, {@link setButtonText ButtonText} will be displayed as the button caption.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizardNavigationButtonStyle.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Web.UI.WebControls
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: captcha.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Web.UI.WebControls.assets
*/
imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]);
imagecolordeallocate($image,$color);
}
-
+
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat
+ */
+
+Prado::using('System.Data.Common.TDbMetaData');
+
+class TWsatARGenerator
+{
+
+ /**
+ * @return TDbMetaData for retrieving metadata information, such as
+ * table and columns information, from a database connection.
+ */
+ private $_dbMetaData;
+
+ /**
+ * Output folder where AR classes will be saved.
+ */
+ private $_opFile;
+
+ /**
+ * Class name prefix
+ */
+ private $_clasPrefix;
+
+ /**
+ * Class name sufix
+ */
+ private $_classSufix;
+
+ /**
+ * all table relations array
+ */
+ private $_relations;
+
+ /**
+ * unquote chars
+ * @var array
+ */
+ private $uqChars = array('[', ']', '"', '`', "'");
+
+ function __construct()
+ {
+ if(!class_exists("TActiveRecordManager", false))
+ throw new Exception("You need to enable the ActiveRecord module in your application configuration file.");
+ $ar_manager = TActiveRecordManager::getInstance();
+ $_conn = $ar_manager->getDbConnection();
+ $_conn->Active = true;
+ $this->_dbMetaData = TDbMetaData::getInstance($_conn);
+ }
+
+ public function setOpFile($op_file_namespace)
+ {
+ $op_file = Prado::getPathOfNamespace($op_file_namespace);
+ if (empty($op_file))
+ throw new Exception("You need to fix your output folder namespace.");
+ if (!is_dir($op_file))
+ mkdir($op_file, 0777, true);
+ $this->_opFile = $op_file;
+ }
+
+ public function setClasPrefix($_clas_prefix)
+ {
+ $this->_clasPrefix = $_clas_prefix;
+ }
+
+ public function setClassSufix($_clas_sufix)
+ {
+ $this->_classSufix = $_clas_sufix;
+ }
+
+//-----------------------------------------------------------------------------
+ // <editor-fold defaultstate="collapsed" desc="Main APIs">
+ public function generate($tableName)
+ {
+ $tableInfo = $this->_dbMetaData->getTableInfo($tableName);
+ $this->_commonGenerate($tableName, $tableInfo);
+ }
+
+ public function generateAll()
+ {
+ foreach ($this->_dbMetaData->findTableNames() as $tableName)
+ {
+ if ($tableName == "pradocache")
+ continue;
+ $tableInfo = $this->_dbMetaData->getTableInfo($tableName);
+ if (!empty($this->_relations))
+ {
+ // Cancel generation of M-M relationships middle table
+ if (count($tableInfo->getPrimaryKeys()) === 2 && count($tableInfo->getColumns()) === 2)//M-M relationships
+ continue;
+ }
+ $this->_commonGenerate($tableName, $tableInfo);
+ }
+ }
+
+ public function buildRelations()
+ {
+ $this->_relations = array();
+ foreach ($this->_dbMetaData->findTableNames() as $table_name)
+ {
+ $tableInfo = $this->_dbMetaData->getTableInfo($table_name);
+ $pks = $tableInfo->getPrimaryKeys();
+ $fks = $tableInfo->getForeignKeys();
+
+ if (count($pks) === 2 && count($tableInfo->getColumns()) === 2)//M-M relationships
+ {
+ $table_name_mm = $fks[0]["table"];
+ $table_name_mm2 = $fks[1]["table"];
+
+ $this->_relations[$table_name_mm][] = array(
+ "prop_name" => strtolower($table_name_mm2),
+ "rel_type" => "self::MANY_TO_MANY",
+ "ref_class_name" => $this->_getProperClassName($table_name_mm2),
+ "prop_ref" => $table_name
+ );
+
+ $this->_relations[$table_name_mm2][] = array(
+ "prop_name" => strtolower($table_name_mm),
+ "rel_type" => "self::MANY_TO_MANY",
+ "ref_class_name" => $this->_getProperClassName($table_name_mm),
+ "prop_ref" => $table_name
+ );
+ continue;
+ }
+ foreach ($fks as $fk_data)//1-M relationships
+ {
+ $owner_table = $fk_data["table"];
+ $slave_table = $table_name;
+ $fk_prop = key($fk_data["keys"]);
+
+ $this->_relations[$owner_table][] = array(
+ "prop_name" => strtolower($slave_table),
+ "rel_type" => "self::HAS_MANY",
+ "ref_class_name" => $this->_getProperClassName($slave_table),
+ "prop_ref" => $fk_prop
+ );
+
+ $this->_relations[$slave_table][] = array(
+ "prop_name" => strtolower($owner_table),
+ "rel_type" => "self::BELONGS_TO",
+ "ref_class_name" => $this->_getProperClassName($owner_table),
+ "prop_ref" => $fk_prop
+ );
+ }
+ }
+ }
+
+// </editor-fold>
+//-----------------------------------------------------------------------------
+ // <editor-fold defaultstate="collapsed" desc="Common Methods">
+
+ private function _commonGenerate($tableName, $tableInfo)
+ {
+ if (count($tableInfo->getColumns()) === 0)
+ throw new Exception("Unable to find table or view $tableName in " . $this->_dbMetaData->getDbConnection()->getConnectionString() . ".");
+ else
+ {
+ $properties = array();
+ foreach ($tableInfo->getColumns() as $field => $column)
+ $properties[] = $this->generateProperty($field, $column);
+ $toString = $this->_buildSmartToString($tableInfo);
+ }
+
+ $clasName = $this->_getProperClassName($tableName);
+ $class = $this->generateClass($properties, $tableName, $clasName, $toString);
+ $output = $this->_opFile . DIRECTORY_SEPARATOR . $clasName . ".php";
+ file_put_contents($output, $class);
+ }
+
+ private function _getProperClassName($tableName)
+ {
+ $table_name_words = str_replace("_", " ", strtolower($tableName));
+ $final_conversion = str_replace(" ", "", ucwords($table_name_words));
+ return $this->_clasPrefix . $final_conversion . $this->_classSufix;
+ }
+
+ public function renderAllTablesInformation()
+ {
+ foreach ($this->_dbMetaData->findTableNames() as $table_name)
+ {
+ echo $table_name . "<br>";
+
+ $tableInfo = $this->_dbMetaData->getTableInfo($table_name);
+ echo "Table info:" . "<br>";
+ echo "<pre>";
+ var_dump($tableInfo);
+ echo "</pre>";
+ }
+ }
+
+//-----------------------------------------------------------------------------
+
+ protected function generateProperty($field, $column)
+ {
+ $prop = '';
+ $name = '$' . $field;
+
+ /* TODO use in version 2.0 */
+ // $type = $column->getPHPType();
+
+ $prop .= "\tpublic $name;";
+ return $prop;
+ }
+
+ private function _renderRelations($tablename)
+ {
+ if (!isset($this->_relations[$tablename]))
+ return "";
+
+ $code = "\tpublic static \$RELATIONS = array (";
+ foreach ($this->_relations[$tablename] as $rel_data)
+ $code .= "\n\t\t'" . $rel_data["prop_name"] . "' => array(" . $rel_data["rel_type"] . ", '" . $rel_data["ref_class_name"] . "', '" . $rel_data["prop_ref"] . "'),";
+
+ $code = substr($code, 0, -1);
+ $code .= "\n\t);";
+ return $code;
+ }
+
+ private function _buildSmartToString($tableInfo)
+ {
+ $code = "\tpublic function __toString() {";
+ $property = "throw new THttpException(500, 'Not implemented yet.');";
+ try
+ {
+ foreach ($tableInfo->getColumns() as $column)
+ {
+ if (isset($column->IsPrimaryKey) && $column->IsPrimaryKey)
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
+ elseif ($column->PdoType == PDO::PARAM_STR && $column->DBType != "date")
+ {
+ $property = str_replace($this->uqChars, "", $column->ColumnName);
+ break;
+ }
+ }
+ } catch (Exception $ex)
+ {
+ Prado::trace($ex->getMessage());
+ }
+ $code .= "\n\t\treturn \$this->$property;";
+ $code .= "\n\t}";
+ return $code;
+ }
+
+ protected function generateClass($properties, $tablename, $classname, $toString)
+ {
+ $props = implode("\n", $properties);
+ $relations = $this->_renderRelations($tablename);
+ $date = date('Y-m-d h:i:s');
+ $env_user = getenv("username");
+ return <<<EOD
+<?php
+/**
+ * Auto generated by PRADO - WSAT on $date.
+ * @author $env_user
+ */
+class $classname extends TActiveRecord
+{
+ const TABLE='$tablename';
+
+$props
+
+ public static function finder(\$className=__CLASS__) {
+ return parent::finder(\$className);
+ }
+
+$relations
+
+$toString
+}
+EOD;
+ }
+
+// </editor-fold>
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat
+ */
+
+/**
+ * TWsatService class
+ *
+ * Wsat is inspired in both Asp.Net - Web Site Administration Tool(WSAT) and Yii's Gii.
+ * Wsat enables you to generate code saving your time in too many tedious tasks in a GUI fashion.
+ *
+ * Current options:
+ * 1- Generate one or all Active Record Classes from your DataBase.
+ * 1.1- Automatically generate all relations between the AR Classes (new).
+ * 1.2- Automatically generate the __toString() magic method in a smart way (new).
+ *
+ * To use TWsatService, configure it in the application configuration file like following:
+ * <code>
+ * <services>
+ * ...
+ * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+ * </services>
+ * </code>
+ * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
+ * and generate code and configure your site.
+ *
+ * Warning: You should only use Wsat in development mode.
+ */
+class TWsatService extends TPageService
+{
+
+ private $_pass = '';
+
+ public function init($config)
+ {
+ if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal)
+ throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes.");
+
+ if (empty($this->_pass))
+ throw new TConfigurationException("You need to specify the Password attribute.");
+
+ $this->setDefaultPage("TWsatHome");
+ $this->_startThemeManager();
+ parent::init($config);
+ }
+
+ public function getBasePath()
+ {
+ $basePath = Prado::getPathOfNamespace("System.Wsat.pages");
+ return realpath($basePath);
+ }
+
+ private function _startThemeManager()
+ {
+ $themeManager = new TThemeManager;
+ $themeManager->BasePath = "System.Wsat.themes";
+ $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
+ $themeManager->BaseUrl = "$url/themes";
+
+ $themeManager->init(null);
+ $this->setThemeManager($themeManager);
+ }
+
+ public function getPassword()
+ {
+ return $this->_pass;
+ }
+
+ public function setPassword($_pass)
+ {
+ $this->_pass = $_pass;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<com:TContent ID="Content">
+ <div style="margin: 10px; font-size: 16px; font-weight: bold">Active Record Classes Generator</div>
+ <div class="green_panel" style="text-align: left; font-size: 14px; margin: 15px 5px">
+ <label>This generator generates an AR class for the specified database table.</label><br/>
+ <label>Fields with <b style="color: red">*</b> are required.</label>
+ <hr/>
+ <div style="font-size: 12px; font-style: italic">
+ <ul>
+ <li>If you want to generate all AR Classes, keep the "Table Name" field as appears by default.</li>
+ <li>"Output Folder" field refers to the directory that the new AR class file should be generated under... where Application refers to the protected folder of your project. You can let this default field value and PRADO will create the proper folders for you.</li>
+ </ul>
+ </div>
+ </div>
+
+ <div style="font-size: 14px">
+ <div class="form_row">
+ <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 24px" />
+ <com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="table_name" Text="Table name cannot be blank." Display="Dynamic" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Output Folder:" ForControl="output_folder" style="margin-right: 8px"/>
+ <com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
+ <label style="color: red">*</label>
+ <com:TRequiredFieldValidator ControlToValidate="output_folder" Text="Output folder cannot be blank." Display="Dynamic" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 25px"/>
+ <com:TTextBox ID="class_prefix" Text="AR_" CssClass="in_text" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Class Suffix:" ForControl="class_suffix" style="margin-right: 27px"/>
+ <com:TTextBox ID="class_suffix" CssClass="in_text" />
+ </div>
+
+ <div class="form_row">
+ <com:TLabel Text="Build Relations:" ForControl="build_rel"/>
+ <com:TCheckBox ID="build_rel" Checked="true" />
+ </div>
+
+ <com:TPanel ID="feedback_panel" Visible="false" style="width: 400px">
+ <com:TLabel ID="generation_msg" />
+ </com:TPanel>
+
+ <br/>
+ <div style="text-align: center; width: 400px">
+ <com:TButton Text="Preview" OnClick="preview" Visible="false" />
+ <com:TButton Text="Generate" OnClick="generate" />
+ </div>
+ </div>
+
+</com:TContent>
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatGenerateAR extends TPage
+{
+
+ public function generate($sender)
+ {
+ if ($this->IsValid)
+ {
+ $tableName = $this->table_name->Text;
+ $outputFolderNs = $this->output_folder->Text;
+ $classPrefix = $this->class_prefix->Text;
+ $classSuffix = $this->class_suffix->Text;
+
+ try
+ {
+ $ar_generator = new TWsatARGenerator();
+ $ar_generator->setOpFile($outputFolderNs);
+ $ar_generator->setClasPrefix($classPrefix);
+ $ar_generator->setClassSufix($classSuffix);
+
+ if ($this->build_rel->Checked)
+ $ar_generator->buildRelations();
+
+ if ($tableName != "*")
+ $ar_generator->generate($tableName);
+ else
+ $ar_generator->generateAll();
+
+ $this->feedback_panel->CssClass = "green_panel";
+ $this->generation_msg->Text = "The code has been generated successfully.";
+ } catch (Exception $ex)
+ {
+ $this->feedback_panel->CssClass = "red_panel";
+ $this->generation_msg->Text = $ex->getMessage();
+ }
+ $this->feedback_panel->Visible = true;
+ }
+ }
+
+ public function preview($sender)
+ {
+// throw new THttpException(500, "Not implemented yet.");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<com:TContent ID="Content">
+ <label style="font-size: 18px; font-weight: bold">Welcome to the Web Site Administration Tool</label>
+
+ <div style="margin-top: 25px"><b>Application Dir:</b> <%= Prado::getPathOfNamespace('Application') %></div>
+
+ <br/>
+ <table>
+ <tr style="background-color: #cccccc">
+ <td style="padding: 5px; width: 100px">
+ <com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" />
+ </td>
+ <td style="padding: 5px">
+ Enables you to generate all Active Record Classes with relations included.
+ </td>
+ </tr>
+ </table>
+</com:TContent>
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatHome extends TPage
+{
+
+}
\ No newline at end of file
--- /dev/null
+<%@ MasterClass="" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <com:THead Title="PRADO - WSAT">
+ <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" />
+ <com:TMetaTag HttpEquiv="Content-Language" Content="en" />
+ </com:THead>
+
+ <body>
+ <com:TForm>
+
+ <div id="header">
+ <a href="<%= $this->Service->DefaultPageUrl %>">
+ <div class="logo"></div>
+ <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div>
+ </a>
+ <div class="mantisbg"></div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="mainmenu">
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" /> | </div>
+ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" /> | </div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" /> | </div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="login_form">
+ <com:TLabel Text="Please enter your password:" ForControl="password"/><br/>
+ <com:TTextBox ID="password" TextMode="Password" style="margin: 5px" /><br/>
+ <com:TRequiredFieldValidator ControlToValidate="password" ValidationGroup="loginGroup" Text="Password cannot be blank." Display="Dynamic" /><br/>
+ <com:TCustomValidator ControlToValidate="password" ValidationGroup="loginGroup" OnServerValidate="validatePassword" Text="Incorrect password." Display="Dynamic" />
+
+ <div><com:TButton Text="Enter" ValidationGroup="loginGroup" OnClick="login" /></div>
+ </div>
+
+ <div id="footer">
+ Copyright © 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>.
+ <br/><br/>
+ <%= Prado::poweredByPrado() %>
+ </div>
+ </com:TForm>
+ </body>
+</html>
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+class TWsatLogin extends TPage
+{
+
+ public function login()
+ {
+ if ($this->IsValid)
+ {
+ $this->Session["wsat_password"] = $this->getService()->getPassword();
+
+ $url = $this->Service->constructUrl('TWsatHome');
+ $this->Response->redirect($url);
+ }
+ }
+
+ public function validatePassword($sender, $param)
+ {
+ $config_pass = $this->Service->Password;
+ $user_pass = $this->password->Text;
+ $param->IsValid = $user_pass === $config_pass;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<com:TContent ID="Content">
+ Scaffolding will be available in Prado 3.4
+</com:TContent>
--- /dev/null
+<?php
+
+/**
+ * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2013 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @since 3.3
+ * @package Wsat.pages
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatScaffolding extends TPage
+{
+
+}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration>
+ <modules>
+ <module id="session" class="THttpSession" CookieMode="Allow" UseCustomStorage="false"
+ AutoStart="true" GCProbability="1" UseTransparentSessionID="true" TimeOut="3600" />
+ </modules>
+ <pages Theme="PradoSoft" MasterClass="System.Wsat.pages.layout.TWsatLayout" />
+</configuration>
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * Description of MainLayout
+ *
+ * @author daniels
+ */
+class TWsatLayout extends TTemplateControl
+{
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ $this->validateSecurity();
+ }
+
+ private function validateSecurity()
+ {
+ if ($this->Session["wsat_password"] !== $this->getService()->getPassword())
+ {
+ if (!$this->getPage() instanceof TWsatLogin)
+ {
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+ }
+ }
+
+ public function logout()
+ {
+ $this->Session["wsat_password"] = "";
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <com:THead Title="PRADO - WSAT">
+ <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" />
+ <com:TMetaTag HttpEquiv="Content-Language" Content="en" />
+ </com:THead>
+
+ <body>
+ <com:TForm>
+
+ <div id="header">
+ <a href="<%= $this->Service->DefaultPageUrl %>">
+ <div class="logo"></div>
+ <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div>
+ </a>
+ <div class="mantisbg"></div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="mainmenu">
+ <div style="float: right"><com:TLinkButton Text="Logout" OnClick="logout" /></div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" /> | </div>
+ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" /> | </div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" /> | </div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="central_div">
+ <div id="toc">
+ <div class="topic">
+ <div>Code Generation</div>
+ <ul>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" /></li>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatScaffolding') %>" Text="Scaffolding" /></li>
+ </ul>
+ </div>
+ </div>
+
+ <div id="content">
+ <com:TContentPlaceHolder ID="Content" />
+ </div>
+
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="footer">
+ Copyright © 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>.
+ <br/><br/>
+ <%= Prado::poweredByPrado() %>
+ </div>
+ </com:TForm>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+allow from all
--- /dev/null
+html, body{
+ margin: 0px;
+ padding: 0px;
+ font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif;
+ font-weight: normal;
+}
+
+#header {
+ font-size:25px;
+ font-weight:bold;
+ color: #666;
+}
+
+.logo{
+ width: 204px;
+ height:100px;
+ background-image: url('imgs/pradologo.gif');
+ background-repeat: no-repeat;
+ float: left;
+}
+
+.mantisbg{
+ width: 221px;
+ height: 100px;
+ background-image: url('imgs/mantisbg.jpg');
+ background-repeat: no-repeat;
+ float: right;
+}
+
+.mainmenu {
+ padding:10px;
+ padding-right:10px;
+ background:#EDEDED;
+ border-bottom: 1px solid #A6A6A6;
+ border-top: 1px solid #DCDCDC;
+ color:white;
+ text-align:right;
+ font-size: 10pt;
+}
+
+.mainmenu a {
+ color:#737373;
+ text-decoration:none;
+}
+
+.mainmenu a:hover {
+ color: #FF0000;
+}
+
+#toc {
+ background-color: #F3F3F3;
+ width:220px;
+ padding:0px 10px 0px 10px;
+ float: left;
+}
+
+#content {
+ padding: 1em 1em 1em 1em;
+ line-height: 135%;
+ float: left;
+ width: 700px;
+}
+
+.topic {
+ font-size: 9pt;
+ padding: 0px 0px 0px 0px;
+}
+
+.topic div {
+ background-image: url('imgs/arrowdown.gif');
+ background-repeat: no-repeat;
+ background-position: left center;
+ margin: 0px;
+ font-size: 8pt;
+ font-weight:bold;
+ color:#2A480A;
+ padding: 5px;
+ padding-left: 15px;
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #E2E2E2;
+}
+
+.topic ul
+{
+ margin: 0px;
+ padding: 0px;
+}
+
+.topic ul li
+{
+ list-style: none;
+ margin: 0px;
+ padding: 5px;
+ padding-left: 15px;
+ border-bottom: 1px dotted #D8D8D8;
+}
+
+.topic a {
+ color:#4F811A;
+ font-size: 8pt;
+ text-decoration: none;
+}
+
+.topic a:hover {
+ color:#2A480A;
+}
+
+/* form styles */
+.form_row{
+ margin: 10px;
+}
+
+.in_text{
+ width: 250px;
+}
+
+.login_form{
+ text-align: center;
+ margin: 30px auto;
+ border: 1px solid red;
+ border-radius: 5px;
+ padding: 10px;
+ width: 250px;
+ font-size: 11px;
+}
+
+.green_panel{
+ background-color: #C5FBBD;
+ border: 1px solid #76C376;
+ padding: 10px;
+ margin: 10px 0;
+ border-radius: 5px;
+ text-align: center;
+}
+
+.red_panel{
+ background-color: #ff6666;
+ border: 1px solid red;
+ padding: 10px;
+ margin: 10px 0;
+ border-radius: 5px;
+ text-align: center;
+}
+
+#footer {
+ clear:both;
+ color: gray;
+ font-size:8pt;
+ text-align:center;
+ margin-top:25px;
+ padding:10px;
+}
\ No newline at end of file
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
*/
* TBD: xpath
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
* </code>
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
* @param DOMXmlNode the node to be converted
* @return TXmlElement the converted TXmlElement
*/
- private function buildElement($node)
+ protected function buildElement($node)
{
$element=new TXmlElement($node->tagName);
$element->setValue($node->nodeValue);
* You may manipulate the collection with the operations defined in {@link TList}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TXmlDocument.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System.Xml
* @since 3.0
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* This interface must be implemented by application modules.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface must be implemented by services.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface must be implemented by writers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface must be implemented by user objects.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* {@link TPageStatePersister}, {@link TApplicationStatePersister}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface must be implemented by cache managers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* Classes implementing this interface must support serialization and unserialization.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* to end-users.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface must be implemented by classes that are capable of performing databinding.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
* This interface should be implemented by classes that support CSS styles.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1.0
*/
* Active controls must implement IActiveControl interface.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
* interface.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
* this interface must be implemented.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: interfaces.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.1
*/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2013 PradoSoft
+ * @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
*/
* Prado class.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: prado.php 3245 2013-01-07 20:23:32Z ctrlaltca $
* @package System
* @since 3.0
*/
<?php
/**
* File Name: pradolite.php
- * Last Update: 2013/11/26 10:10:17
+ * Last Update: 2014/08/26 16:45:28
* Generated By: buildscripts/phpbuilder/build.php
*
* This file is used in lieu of prado.php to boost PRADO application performance.
protected static $classExists = array();
public static function getVersion()
{
- return '3.2.3';
+ return '3.2.4';
}
public static function initErrorHandlers()
{
$this->write($str."\n");
}
}
-class TPriorityList extends TList
+class TPriorityList extends TList
{
private $_d=array();
private $_o=false;
foreach($this->_d as $priority=>$items) {
if(($index=array_search($item,$items,true))!==false) {
$absindex+=$index;
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
} else
$absindex+=count($items);
if($index>=($c=count($items)))
$index-=$c;
else
- return $withindex?array($priority,$index,$absindex,
+ return $withindex?array($priority,$index,$absindex,
'priority'=>$priority,'index'=>$index,'absindex'=>$absindex):$priority;
}
return false;
{
return $this->saveToString();
}
- private function buildElement($node)
+ protected function buildElement($node)
{
$element=new TXmlElement($node->tagName);
$element->setValue($node->nodeValue);
}
public static function jsonEncode($value, $options = 0)
{
- if (is_string($value) &&
- ($g=Prado::getApplication()->getGlobalization(false))!==null &&
- strtoupper($enc=$g->getCharset())!='UTF-8')
- $value=iconv($enc, 'UTF-8', $value);
+ if (($g=Prado::getApplication()->getGlobalization(false))!==null &&
+ strtoupper($enc=$g->getCharset())!='UTF-8') {
+ self::convertToUtf8($value, $enc);
+ }
$s = @json_encode($value,$options);
self::checkJsonError();
return $s;
}
+ private static function convertToUtf8(&$value, $sourceEncoding) {
+ if(is_string($value))
+ $value=iconv($sourceEncoding, 'UTF-8', $value);
+ else if (is_array($value))
+ {
+ foreach($value as &$element)
+ self::convertToUtf8($element, $sourceEncoding);
+ }
+ }
public static function jsonDecode($value, $assoc = false, $depth = 512)
{
$s= @json_decode($value, $assoc, $depth);
if($this->getEnableCache())
{
$cache = $this->getApplication()->getCache();
- if($cache !== null)
+ if($cache !== null)
{
$dependencies = null;
if($this->getApplication()->getMode() !== TApplicationMode::Performance)
$this->_posttagtemplate = $value;
}
public function instantiate($outercontrol = null) {
- if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
+ if($this->getPreTagTemplate() || $this->getPreContentsTemplate() ||
$this->getPostContentsTemplate() || $this->getPostTagTemplate()) {
$this->_outercontrol = $outercontrol;
if($this->getUseState())
$decorator->renderPostContentsText($writer);
$writer->renderEndTag();
$decorator->renderPostTagText($writer);
- } else
+ } else
$writer->renderEndTag($writer);
}
}
if($target instanceof TControl)
$target=$target->getClientID();
$id = TJavaScript::quoteString($target);
- $this->_endScripts['prado:focus'] = 'new Effect.ScrollTo('.$id.'); Prado.Element.focus('.$id.');';
+ $this->_endScripts['prado:focus'] = 'Prado.Element.focus('.$id.');';
$params=func_get_args();
$this->_page->registerCachingAction('Page.ClientScript','registerFocusControl',$params);
}
}
public function flushScriptFiles($writer, $control=null)
{
- $this->_page->ensureRenderInForm($control);
- $this->renderAllPendingScriptFiles($writer);
+ if(!$this->_page->getIsCallback())
+ {
+ $this->_page->ensureRenderInForm($control);
+ $this->renderAllPendingScriptFiles($writer);
+ }
}
protected function renderHiddenFieldsInt($writer, $initial)
{
if($str!=='')
$writer->write("<div style=\"visibility:hidden;\">\n".$str."</div>\n");
}
- public function getHiddenFields()
+ public function getHiddenFields()
{
return $this->_hiddenFields;
}
{
Prado::using('System.Web.UI.ActiveControls.TActivePageAdapter');
$this->setAdapter(new TActivePageAdapter($this));
+ $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
+ if(strlen($callbackEventParameter) > 0)
+ $this->_postData[TPage::FIELD_CALLBACK_PARAMETER]=TJavaScript::jsonDecode((string)$callbackEventParameter);
if (($g=$this->getApplication()->getGlobalization(false))!==null &&
strtoupper($enc=$g->getCharset())!='UTF-8')
foreach ($this->_postData as $k=>$v)
$this->loadFromPhp($fcontent,dirname($fname),$configPagePath);
}
else
- {
+ {
$dom=new TXmlDocument;
if($dom->loadFromFile($fname))
$this->loadFromXml($dom,dirname($fname),$configPagePath);
if(isset($page['properties']))
{
$properties=$page['properties'];
- unset($page['properties']);
+ unset($page['properties']);
}
$matching=false;
$id=($configPagePath==='')?$id:$configPagePath.'.'.$id;
const STATE_PERFORMANCE='Performance';
const PAGE_SERVICE_ID='page';
const CONFIG_FILE_XML='application.xml';
- const CONFIG_FILE_EXT_XML='.xml';
+ const CONFIG_FILE_EXT_XML='.xml';
const CONFIG_TYPE_XML = 'xml';
const CONFIG_FILE_PHP='application.php';
const CONFIG_FILE_EXT_PHP='.php';
$this->_properties[$name]=$value;
}
$this->_empty = false;
- }
+ }
if(isset($config['paths']) && is_array($config['paths']))
$this->loadPathsPhp($config['paths'],$configPath);
if(isset($config['modules']) && is_array($config['modules']))
$properties['id'] = $id;
$this->_modules[$id]=array($type,$properties,$module);
$this->_empty=false;
- }
+ }
}
protected function loadModulesXml($modulesNode,$configPath)
{
$properties['id'] = $id;
$this->_services[$id] = array($type,$properties,$service);
$this->_empty = false;
- }
+ }
}
protected function loadServicesXml($servicesNode,$configPath)
{