You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(361) |
Oct
(65) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(798) |
Feb
(694) |
Mar
(586) |
Apr
(145) |
May
(24) |
Jun
(24) |
Jul
(56) |
Aug
(11) |
Sep
(138) |
Oct
(107) |
Nov
(58) |
Dec
(39) |
| 2004 |
Jan
(157) |
Feb
(24) |
Mar
(13) |
Apr
(14) |
May
(73) |
Jun
(106) |
Jul
(217) |
Aug
(91) |
Sep
(116) |
Oct
(357) |
Nov
(27) |
Dec
(272) |
| 2005 |
Jan
(97) |
Feb
(40) |
Mar
(167) |
Apr
(365) |
May
(344) |
Jun
(357) |
Jul
(407) |
Aug
(529) |
Sep
(204) |
Oct
(52) |
Nov
(80) |
Dec
(1) |
| 2006 |
Jan
(2) |
Feb
(1) |
Mar
(11) |
Apr
(112) |
May
(121) |
Jun
(86) |
Jul
(51) |
Aug
(48) |
Sep
(107) |
Oct
(20) |
Nov
(50) |
Dec
(11) |
| 2007 |
Jan
(7) |
Feb
(11) |
Mar
(8) |
Apr
(11) |
May
(2) |
Jun
(25) |
Jul
(67) |
Aug
(134) |
Sep
(54) |
Oct
(69) |
Nov
(10) |
Dec
(74) |
| 2008 |
Jan
(73) |
Feb
(81) |
Mar
(64) |
Apr
(98) |
May
(157) |
Jun
(68) |
Jul
(80) |
Aug
(108) |
Sep
(176) |
Oct
(107) |
Nov
(265) |
Dec
(60) |
| 2009 |
Jan
(149) |
Feb
(140) |
Mar
(195) |
Apr
(141) |
May
(53) |
Jun
(45) |
Jul
(98) |
Aug
(153) |
Sep
(160) |
Oct
(138) |
Nov
(139) |
Dec
(104) |
| 2010 |
Jan
(188) |
Feb
(259) |
Mar
(133) |
Apr
(104) |
May
(42) |
Jun
(121) |
Jul
(38) |
Aug
(223) |
Sep
(259) |
Oct
(255) |
Nov
(106) |
Dec
(157) |
| 2011 |
Jan
(202) |
Feb
(110) |
Mar
(261) |
Apr
(272) |
May
(218) |
Jun
(108) |
Jul
(141) |
Aug
(205) |
Sep
(326) |
Oct
(279) |
Nov
(368) |
Dec
(238) |
| 2012 |
Jan
(239) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
(3) |
Aug
(6) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
(3) |
Mar
(9) |
Apr
(10) |
May
|
Jun
(1) |
Jul
(3) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
|
4
|
|
5
|
6
|
7
(1) |
8
|
9
|
10
|
11
|
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
|
29
|
30
(2) |
31
(8) |
|
|
From: <sk...@us...> - 2006-03-31 23:51:28
|
Revision: 282 Author: skalpa Date: 2006-03-31 15:51:17 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=282&view=rev Log Message: ----------- Added a simple list view widget, that mimics the behavior of desktop OS file managers lists (items are displayed with an icon and a name below or on the right). Used inline-block rules to ensure the list will re-arrange itself when people resize the browser window, and put all the display handling in the CSS (so people can switch from one view type to another one by changing the widget <div> class using javascript). Added Paths: ----------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/listwidget.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/default.css XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/xo-info.php Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/listwidget.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/listwidget.php (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/listwidget.php 2006-03-31 23:51:17 UTC (rev 282) @@ -0,0 +1,88 @@ +<?php + + + + + + +class xoops_pyro_ListWidget extends xoops_opal_Widget { + var $tagName = 'ul'; + var $stylesheet = 'www/default.css'; + + /** + * Items to display + * @var array + */ + var $sourceData = array(); + /** + * Path to the key containing an item 'name' + * @var string + */ + var $nameKey = ''; + /** + * Path to the key containing an item URI (if non empty, a link is generated) + * @var string + */ + var $linkKey = ''; + /** + * Path to the keys containing additional items fields to be displayed + * @var string + */ + var $descKeys = ''; + /** + * Path to the key containing an item icon/image + * @var string + */ + var $imageKey = ''; + /** + * How items icons should be displayed (background or inline) + * @var string + */ + var $imageMode = 'inline'; + + function xoInit( $options = array() ) { + parent::xoInit( $options ); + if ( $this->descKeys && !is_array( $this->descKeys ) ) { + $this->descKeys = explode( ' ', $this->descKeys ); + } + array_unshift( $this->elementClasses, 'pyro_ListWidget' ); + return true; + } + + function render() { + XOS::import( 'xoops_core_KeyPath' ); + if ( $this->elementClasses && !is_array( $this->elementClasses ) ) { + $this->elementClasses = explode( ' ', $this->elementClasses ); + } + $items = array(); + foreach ( $this->sourceData as $item ) { + $items[] = $this->renderItem( $item ); + } + return $this->renderTag() . implode( "\n", $items ) . "</$this->tagName>"; + } + + function renderItem( $item ) { + $str = '<span class="name">' . xoops_core_KeyPath::getValue( $item, $this->nameKey ) . '</span>'; + if ( $this->linkKey && $link = xoops_core_KeyPath::getValue( $item, $this->linkKey ) ) { + $str = '<a href="' . htmlspecialchars( $link, ENT_QUOTES ) . '">' . $str . '</a>'; + } + if ( !empty( $this->descKeys ) ) { + foreach ( $this->descKeys as $key ) { + $str .= '<span class="' . $key . '">' . xoops_core_KeyPath::getValue( $item, $key ) . '</span>'; + } + } + $itemTag = ( $this->tagName == 'ul' || $this->tagName == 'ol' ) ? 'li' : 'div'; + $image = xoops_core_KeyPath::getValue( $item, $this->imageKey ); + if ( !$image ) { + $str = "<$itemTag class=\"item\">$str</$itemTag>"; + } elseif ( $this->imageMode == 'background' ) { + $str = "<$itemTag class=\"item\" style=\"background-image:url($image)\">$str</$itemTag>"; + } else { + $str = "<$itemTag class=\"item\"><img src=\"$image\" class=\"$this->imageKey\" />$str</$itemTag>"; + } + return $str; + } + +} + +?> \ No newline at end of file Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/listwidget.php ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Date Id Rev URL" Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/default.css =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/default.css (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/default.css 2006-03-31 23:51:17 UTC (rev 282) @@ -0,0 +1,58 @@ + +.pyro_ListWidget { + margin: 0px; + padding: .2em; +} + +.pyro_ListWidget .item { + border: 0px solid none; + list-style: none; + margin: 2px; + padding: 6px; + background-repeat: no-repeat; + background-position: left center; +} + +.pyro_ListWidget .item:hover { + background-color: #ccc; +} + +.pyro_ListWidget a { + display: block; + color: #000000; + font-weight: bold; + text-decoration: none; +} +.pyro_ListWidget .name { + font-size: 125%; + display: block; +} + +.pyro_ListWidget.list-icons_view { + text-align: center; +} +.pyro_ListWidget.list-icons_view .item { + display: -moz-inline-box; + -moz-box-pack: center; + display: inline-block; + background-position: center top; + width: 9em; + padding: 70px 6px 6px 6px; + height: auto; + vertical-align: top; + text-align: center; +} + +.pyro_ListWidget.list-icons_view span { + display: none; +} + +.pyro_ListWidget.list-icons_view .item { + display: expression('inline'); +} +.pyro_ListWidget.list-icons_view .item .name { + display: block; +} +.pyro_ListWidget.list-icons_view .item .name { + font-size: 100%; +} Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/www/default.css ___________________________________________________________________ Name: svn:keywords + "Author Date Id Rev URL" Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/xo-info.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/xo-info.php (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/xo-info.php 2006-03-31 23:51:17 UTC (rev 282) @@ -0,0 +1,23 @@ +<?php +/** + * xoops_pyro_ListWidget bundle information file + * + * See the enclosed file LICENSE for licensing information. + * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html + * + * @copyright The XOOPS project http://www.xoops.org/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @since 2.3.0 + * @version $Id$ + * @author Skalpa Keo <sk...@xo...> + * @package xoops_pyro + * @subpackage xoops_pyro_ListWidget + */ + +return array( + 'xoBundleDisplayName' => 'Pyro list widget', + 'xoBundleIdentifier' => 'xoops_pyro_ListWidget', + 'xoClassPath' => '/listwidget.php', +); + +?> \ No newline at end of file Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/ListWidget.xoobj/xo-info.php ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Date Id Rev URL" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-31 23:32:38
|
Revision: 281 Author: skalpa Date: 2006-03-31 15:32:22 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=281&view=rev Log Message: ----------- Added a new breadcrumbs path widget. Tried to make it flexible enough so it can handle path information provided in several formats (so you don't have to "prepare" the data, but just pass it and tells the widget how it is structured). Check the doc provided in the source files for further infos. This one is a bit old, so rendering is done "traditionnally", but would be nice to refactor it using php generation as done in newer widgets later on. Added Paths: ----------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/breadcrumbs.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/breadcrumbs_bg.png XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/default.css XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/xo-info.php Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/breadcrumbs.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/breadcrumbs.php (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/breadcrumbs.php 2006-03-31 23:32:22 UTC (rev 281) @@ -0,0 +1,162 @@ +<?php +/** + * xoops_pyro_Breadcrumbs component class file + * + * @copyright The Xoops project http://www.xoops.org/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Skalpa Keo <sk...@xo...> + * @since 2.3.0 + * @version $Id$ + * @package xoops_pyro + * @subpackage xoops_pyro_Breadcrumbs + */ + +XOS::import( 'xoops_opal_Widget' ); + +/** + * Widget rendering a breadcrumbs navigation tool + * + * The breadcrumbs widget can use flat data (an array containing the folders information) + * or extract its data from any structured data. + * + * Display breadcrumbs using a flat data source + * <code> + * $data = array( + * array( 'name' => 'root', 'link' => 'a.html' ), + * array( 'name' => 'child', 'link' => 'b.html' ), + * array( 'name' => 'current', 'link' => 'c.html' ), + * ); + * $widget = XOS::create( 'xoops_pyro_Breadcrumbs', array( + * 'sourceData' => $data, + * 'sourceType' => 'flat', + * 'nameKey' => 'name', + * 'linkKey' => 'link', + * ) ); + * $widget->render(); + * // root > child > current + * </code> + * + * Display breadcrumbs using a structured data source + * <code> + * $data = array( + * 'name' => 'something', + * 'children' => array( + * 'folder1' => array( 'name' => 'folder 1', 'url' => 'a.html' ), + * 'folder2' => array( + * 'name' => 'folder 2', + * 'url' => 'b.html', + * 'children' => array( + * 'sub1' => array( + * 'name' => 'subfolder 1', + * 'url' => 'sub1.html', + * ), + * ), + * ), + * ), + * ); + * $widget = XOS::create( 'xoops_pyro_Breadcrumbs', array( + * 'sourceData' => $data, + * 'sourceType' => 'tree', + * 'currentPath' => 'folder2/sub1', + * 'nameKey' => 'name', + * 'linkKey' => 'url', + * 'childrenKey' => 'children', + * ) ); + * $widget->render(); + * // folder 2 > subfolder 1 + *</code> + * + * + * @author Skalpa Keo + * @package xoops_pyro + * @subpackage xoops_pyro_Breadcrumbs + * @since 2.3.0 + */ +class xoops_pyro_Breadcrumbs extends xoops_opal_Widget { + // xoops_opal_Widget properties + var $stylesheet = 'www/default.css'; + var $templateString = ''; + + // xoops_pyro_Breadcrumbs properties + /** + * $sourceData property content type (flat or tree) + * @var string + */ + var $sourceType = 'tree'; + /** + * Data structure holding folders information + * @var mixed + */ + var $sourceData = false; + /** + * Name of the attribute for folders display name + * @var string + */ + var $nameKey = ''; + /** + * Name of the attribute for folders URI + * @var string + */ + var $linkKey = ''; + /** + * Name of the attribute for folders children (when using tree structure) + * @var string + */ + var $childrenKey = ''; + /** + * Path to the current folder (when using tree structure) + * @var string + */ + var $currentPath = ''; + /** + * Separator string inserted between links + * @var string + */ + var $separatorString = ' > '; + + var $tplFolder='<a href="{link}">{name}</a>'; + + + function xoInit( $options = array() ) { + array_unshift( $this->elementClasses, 'pyro_Breadcrumbs' ); + return true; + } + + function render() { + XOS::import( 'xoops_core_KeyPath' ); + if ( empty( $this->currentPath ) ) { + return ''; + } + $strings = array(); + if ( $this->sourceType == 'flat' ) { + foreach ( $this->sourceData as $folder ) { + $strings[] = $this->renderFolder( $folder ); + } + } else { + $loc = ( substr( $this->currentPath, 0, 1 ) == '/' ) ? substr( $this->currentPath, 1 ) : $this->currentPath; + $folders = explode( '/', $loc ); + $currentNode =& $this->sourceData; + foreach ( $folders as $folder ) { + $currentNode =& xoops_core_KeyPath::getProperty( $currentNode, $folder, $this->childrenKey ); + if ( isset( $currentNode ) ) { + $strings[] = $this->renderFolder( $currentNode ); + } else break; + } + } + $strings = implode( $this->separatorString, $strings ); + //return $strings; + return $this->renderTag() . $strings . "</$this->tagName>"; + } + function renderFolder( $node ) { + $patterns = array( '{name}', '{link}' ); + $repl = array( + xoops_core_KeyPath::getProperty( $node, $this->nameKey ), + xoops_core_KeyPath::getProperty( $node, $this->linkKey ) + ); + return str_replace( $patterns, $repl, $this->tplFolder ); + } + +} + + +?> \ No newline at end of file Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/breadcrumbs.php ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Date Id Rev URL" Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/breadcrumbs_bg.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/breadcrumbs_bg.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/default.css =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/default.css (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/default.css 2006-03-31 23:32:22 UTC (rev 281) @@ -0,0 +1,11 @@ + +.pyro_Breadcrumbs { + border-bottom: 1px solid #999; + padding: .2em .5em; + background: #E5E6EC url(breadcrumbs_bg.png) repeat-x left bottom; + color: #000; +} +.pyro_Breadcrumbs a { + padding: 0px .5em; + color: #000; +} Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/www/default.css ___________________________________________________________________ Name: svn:keywords + "Author Date Id Rev URL" Added: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/xo-info.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/xo-info.php (rev 0) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/xo-info.php 2006-03-31 23:32:22 UTC (rev 281) @@ -0,0 +1,23 @@ +<?php +/** + * xoops_pyro_Breadcrumbs bundle information file + * + * See the enclosed file LICENSE for licensing information. + * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html + * + * @copyright The XOOPS project http://www.xoops.org/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @since 2.3.0 + * @version $Id$ + * @author Skalpa Keo <sk...@xo...> + * @package xoops_pyro + * @subpackage xoops_pyro_BreadCrumbs + */ + +return array( + 'xoBundleDisplayName' => 'Pyro breadcrumbs widget', + 'xoBundleIdentifier' => 'xoops_pyro_Breadcrumbs', + 'xoClassPath' => '/breadcrumbs.php', +); + +?> \ No newline at end of file Property changes on: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Breadcrumbs.xoobj/xo-info.php ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Date Id Rev URL" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-31 23:09:59
|
Revision: 280 Author: skalpa Date: 2006-03-31 15:09:44 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=280&view=rev Log Message: ----------- Generic refactoring of the form elements classes. Form elements are now able to render themselves as PHP code that will be inserted inside the compiled template file. This way, there is no class or whatever to load during runtime. I've tried to handle how dynamic/static parameters are handled as much as possible, even if it's not perfect yet. For instance, a 'select' element supposed to show a dynamic set of options (passed through a template variable) will generate a 'foreach' php snippet, while another 'select' element showing a static set of options will generate a simple 'echo "<option>......</option>"' The idea is to have widget components generate the code one developer would write if he was doing everything manually. Additional feature: the text input element supports autocomplete, using prototype/scriptaculous (for the moment only autocomplete from a specified set of items has been implemented, but it can be further enhanced later to support ajax-based autocomplete input elements). Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/element.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/range.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/select.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/text.php XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/textarea.php Removed Paths: ------------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/form.php Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/element.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/element.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/element.php 2006-03-31 23:09:44 UTC (rev 280) @@ -56,10 +56,12 @@ var $renderAsHtml = true; function xoInit( $options = array(), $attributes = array() ) { - if ( $this->refPath && !$this->name ) { - $this->name = $this->refPath; + parent::xoInit( $options, $attributes ); + + if ( $this->ref && !$this->name ) { + $this->name = $this->ref; } - return parent::xoInit( $options, $attributes ); + return true; } /** Deleted: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/form.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/form.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/form.php 2006-03-31 23:09:44 UTC (rev 280) @@ -1,90 +0,0 @@ -<?php -/** - * xoops_pyro_Form component main class file - * - * See the enclosed file LICENSE for licensing information. - * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html - * - * @copyright The XOOPS project http://www.xoops.org/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @since 2.3.0 - * @version $Id$ - * @author Skalpa Keo <sk...@xo...> - * @package xoops_pyro - * @subpackage xoops_pyro_Forms - */ - -XOS::import( 'xoops_opal_Widget' ); - -/** - * Pyro form widget - * - * The form widgets have been modelled after the XForms specification. - * When rendered as HTML form elements, some of the features (like support for multiple submission locations) - * are emulated using javascript, so you should restrict yourself to the features set supported - * by HTML forms if you don't want your forms to rely on client scripting. - * @package xoops_pyro - * @subpackage xoops_pyro_Forms - */ -class xoops_pyro_Form extends xoops_opal_Widget { - - /** - * The different locations where this form can be submitted - * @var array - */ - var $submissions = array(); - /** - * Default submission id (used when rendering as HTML) - * @var string - */ - var $defaultSubmission = ''; - - var $tagName = 'form'; - var $renderAsHtml = true; - - function xoInit( $options = array(), $attributes = array() ) { - $attributes = array_merge( array( 'method' => 'post', 'action' => $_SERVER['REQUEST_URI'] ), $attributes ); - parent::xoInit( $options, $attributes ); - - //$this->xoElements =& $GLOBALS['xoops2']->create( 'xoops.form.group' ); - //$this->elements =& $this->xoElements->elements; - return true; - } - - /** - * Add a submission URI to this form - * - * As XForms, pyro forms let you specify several submission locations. When a form accepting more than - * one submission location is rendered as HTML, this functionality will be emulated by adding javascript - * event handlers to the submit buttons. Thus, you should not add more than one submission location if - * you want your form to work with Javascript disabled. - * - * The submission method should be specified using valid XForms submission methods: - * - get (transformed to get in HTML) - * - urlencoded-post (post + application/x-www-form-urlencoded in HTML) - * - form-post-data (post + multipart/form-data in HTML) - * - * @param string $id ID of this submission - * @param string $action Location to submit this form data to - * @param string $method Method used - */ - function addSubmission( $id, $action = '', $method = 'get' ) { - if ( empty( $this->submissions ) ) { - $this->defaultSubmission = $id; - } - $this->submissions[$id] = array( empty($action) ? $_SERVER['REQUEST_URI'] : $action, $method ); - } - - - function addElement( &$elt ) { - $elt->ownerForm =& $this; - $this->elements[] =& $elt; - } - - function renderdTag() { - - } - -} - -?> \ No newline at end of file Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/range.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/range.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/range.php 2006-03-31 23:09:44 UTC (rev 280) @@ -25,7 +25,7 @@ * @package xoops_pyro * @subpackage xoops_pyro_Forms */ -class xoops_pyro_FormRange extends xoops_pyro_FormElement { +class xoops_pyro_RangeField extends xoops_pyro_FormElement { var $tagName = 'range'; @@ -45,8 +45,42 @@ */ var $step = 10; + var $dynamicProperties = array( 'start', 'end', 'step' ); + + var $attributes = array(); + /** + * Render this widget as html+php code + * + * @param xoops_opal_SmartyCompiler $c + * @return string + */ + function renderCode( &$c ) { + /**@var xoops_pyro*/ + $pyro =& $c->template_engine->extensions['xoops_pyro']; + + $attrs = array(); + $str = "<?php\n"; + if ( $this->ref ) { + $attrs['name'] = $pyro->currentForm->htmlFieldName( $this->ref ); + $str .= "\$currentValue = " . $pyro->formVarCode( $this->ref ) . ";\n"; + $ref = '$currentValue'; + } elseif ( isset( $this->value ) ) { + $ref = var_export( $this->value, true ); + } + $str .= '?>' . $this->renderTag( 'select', $attrs ) . "\n"; + $str .= "<?php for ( \$cur = $this->start; \$cur < $this->end; \$cur += $this->step ) { + echo '<option value=\"' . intval( \$cur ) . '\"';\n"; + if ( isset( $ref ) ) { + $str .= "if ( \$cur == $ref ) echo ' selected=\"selected\"';\n"; + } + $str .= "echo '>' . htmlspecialchars(\$cur) . '</option>';\n}\n?>"; + $str .= "\n</select>"; + + return $str; + } + function renderControl() { $attributes = $this->attributes; if ( $this->renderAsHtml ) { Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/select.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/select.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/select.php 2006-03-31 23:09:44 UTC (rev 280) @@ -25,20 +25,108 @@ * @package xoops_pyro * @subpackage xoops_pyro_Forms */ -class xoops_pyro_FormSelect extends xoops_pyro_FormElement { +class xoops_pyro_SelectField extends xoops_pyro_FormElement { - var $tagName = 'select'; + var $tagName = 'select1'; var $appearance = 'minimal'; + var $multiple = false; + var $dynamicProperties = array( 'options' ); + + + function xoInit() { + parent::xoInit(); + $this->multiple = ( $this->tagName != 'select1' ); + $this->elementClasses[] = 'pyro_SelectField'; + return true; + } + + function renderCode( &$c ) { + $pyro =& $c->template_engine->extensions['xoops_pyro']; + + $code = ''; + $fieldName = $this->ref ? $pyro->currentForm->htmlFieldName( $this->ref ) : ''; + + if ( $this->appearance == 'full' ) { + $code = $this->renderTag( 'span' ); + $inputType = $this->multiple ? 'checkbox' : 'radio'; + $fieldName = $fieldName ? " name=\"$fieldName\"" : ''; + } else { + $attrs = array(); + if ( $this->multiple ) { + $attrs['multiple'] = 'multiple'; + } + if ( $this->appearance == 'minimal' && !$this->multiple ) { + $attrs['size'] = 1; + } elseif ( @is_array( $this->options ) ) { + $attrs['size'] = max( 2, min( 10, count( $this->options ) ) ) . '"'; + } else { + $attrs['size'] = 5; + } + if ( $fieldName ) { + $attrs['name'] = $fieldName; + } + $code = $this->renderTag( 'select', $attrs ); + } + $code .= "\n"; + + // Output options + $checkAttrib = ( $this->appearance == 'full' ) ? 'checked' : 'selected'; + + if ( $this->ref ) { + $checkCode = "<?php if ( \$currentValue == \$val ) echo ' $checkAttrib=\"$checkAttrib\"'; ?>"; + } elseif ( isset( $this->value ) ) { + $code .= "\$currentValue = " . var_export( $this->value ) . ";\n"; + } + if ( !is_array( $this->options ) ) { + $code .= "<?php \$currentValue = " . ( $this->ref ? $pyro->formVarCode($this->ref) : $this->value ) . ";\n"; + $code .= "foreach ( $this->options as \$k => \$val ) { ?>"; + if ( $this->appearance == 'full' ) { + $code .= + "<input type=\"$inputType\"$fieldName " . + "value=\"<?php echo htmlspecialchars(\$k,ENT_QUOTES); ?>\"$checkCode />" . + "<?php echo htmlspecialchars(\$val); ?>\n"; + } else { + $code .= + "<option value=\"<?php echo htmlspecialchars(\$k,ENT_QUOTES); ?>\"$checkCode>" . + "<?php echo htmlspecialchars(\$val); ?></option>\n"; + } + $code .= "<?php } ?>"; + } else { + if ( $this->ref ) { + $code .= "<?php \$fieldValue = " . $pyro->formVarCode( $this->ref ) . "; ?>"; + } + foreach ( $this->options as $key => $value ) { + $value = $c->eval_quoted( $value ); + if ( $this->ref ) { + $checkCode = "<?php if ( \$fieldValue == " . var_export( $key, true ) . " ) echo ' $checkAttrib=\"$checkAttrib\"'; ?>"; + } elseif ( isset( $this->value ) ) { + $checkCode = ( $this->value == $value ) ? " $checkAttrib=\"$checkAttrib\"" : ''; + } + if ( $this->appearance == 'full' ) { + $code .= "<input type=\"$inputType\"$fieldName value=\"$key\"$checkCode />$value<br />\n"; + } else { + $code .= "<option value=\"$key\"$checkCode>$value</option>\n"; + } + } + } + $code .= ( $this->appearance == 'full' ) ? '</span>' : '</select>'; + return $code; + } + function renderControl() { if ( $this->renderAsHtml ) { if ( $this->appearance != 'full' ) { if ( $this->name ) { $attributes['name'] = $this->name; } - $attributes['size'] = ( $this->appearance == 'minimal' ) ? 1 : max( 1, count( $this->options ) ); + if ( $this->isMultiple ) { + $attributes['multiple'] = 'multiple'; + $attributes['name'] .= '[]'; + } + $attributes['size'] = ( $this->appearance == 'minimal' ) ? 1 : max( 2, count( $this->options ) ); $str = $this->renderTag( 'select', $attributes ); foreach ( $this->options as $val => $label ) { $str .= '<option value="' . htmlspecialchars( $val, ENT_QUOTES ) . '"'; @@ -58,7 +146,7 @@ if ( isset( $this->value ) && $this->value == $val ) { $str .= ' checked="checked"'; } - $str .= ' />' . $label . '</div>'; + $str .= ' /><br />' . $label . '</div>'; } return $str; } @@ -68,22 +156,4 @@ } -/** - * Form widget for the XForms 'select1' element - * - * When rendered as an XForms element, this widget will display a range control and - * degrade gracefully to a select element when using HTML. - * @package xoops_pyro - * @subpackage xoops_pyro_Forms - */ -class xoops_pyro_FormSelect1 extends xoops_pyro_FormSelect { - - var $tagName = 'select1'; - - var $appearance = 'minimal'; - -} - - - ?> \ No newline at end of file Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/text.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/text.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/text.php 2006-03-31 23:09:44 UTC (rev 280) @@ -23,12 +23,62 @@ * @package xoops_pyro * @subpackage xoops_pyro_Forms */ -class xoops_pyro_FormText extends xoops_pyro_FormElement { +class xoops_pyro_InputField extends xoops_pyro_FormElement { var $tagName = 'input'; var $attributes = array(); + + var $secret = false; + + var $ref = ''; + var $hint = ''; + + function renderCode( &$c ) { + $pyro =& $c->template_engine->extensions['xoops_pyro']; + + $attrs = array(); + if ( $this->secret ) { + $attrs['type'] = 'password'; + } else { + $attrs['type'] = 'text'; + } + if ( $this->ref ) { + $attrs['name'] = $this->ref; + $attrs['value'] = '{value}'; + $code = $this->renderTag( 'input', $attrs, true ); + $code = str_replace( "{value}", '<?php echo htmlspecialchars( $this->_tpl_vars["form"]->valueFromPath( "' . $this->ref . '") ); ?>', $code ); + } else { + $code = $this->renderTag( 'input', $attrs, true ); + } + if ( $this->hint ) { + $code .= '<xopyro:hint for="' . htmlspecialchars( $this->elementId ) . '">' . htmlspecialchars( $this->hint ) . '</xopyro:hint>'; + } + return $code; + + if ( isset( $this->autoComplete ) ) { + if ( !is_array( $this->autoComplete ) ) { + $this->autoComplete = explode( ',', substr( $this->autoComplete, 1, -1 ) ); + } + $code .= ' autocomplete="off"'; + if ( !isset( $this->id ) ) { + $this->id = "'pyro_Input-" . $n++ . "'"; + } + } + + /* + if ( isset( $args['autoComplete'] ) ) { + $code .= + "\n" . '<div class="pyro_AutoComplete" id="{id}_AutoComplete"></div>' . + '<script type="text/javascript">' . "\n" . + 'new Autocompleter.Local( "{id}", "{id}_AutoComplete", ["' . implode( '", "', $args['autoComplete'] ) . '"], {} )' . + '</script>'; + }*/ + return $code; + } + + function renderControl() { $attrs = $this->attributes; if ( $this->renderAsHtml ) { @@ -47,18 +97,6 @@ } } -/** - * Form widget for the XForms 'secret' element - * - * @package xoops_pyro - * @subpackage xoops_pyro_Forms - */ -class xoops_pyro_FormSecret extends xoops_pyro_FormText { - var $attributes = array( 'type' => 'password' ); -} - - - ?> \ No newline at end of file Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/textarea.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/textarea.php 2006-03-31 13:20:48 UTC (rev 279) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/UserExperience/Pyro.xofrm/Forms/textarea.php 2006-03-31 23:09:44 UTC (rev 280) @@ -22,10 +22,26 @@ * @package xoops_pyro * @subpackage xoops_pyro_Forms */ -class xoops_pyro_FormTextarea extends xoops_pyro_FormElement { +class xoops_pyro_TextAreaField extends xoops_pyro_FormElement { var $tagName = 'textarea'; + + function renderCode( &$c ) { + /**@var xoops_pyro*/ + $pyro =& $c->template_engine->extensions['xoops_pyro']; + + $attrs = array(); + if ( $this->ref ) { + $attrs['name'] = $pyro->currentForm->htmlFieldName( $this->ref ); + } + $code = $this->renderTag( null, $attrs ); + $value = ( $this->ref ? $pyro->formVarCode($this->ref) : var_export( $this->value, true ) ); + + $code .= "<?php echo htmlspecialchars( $value ); ?></$this->tagName>"; + return $code; + } + function renderControl() { $attrs = $this->attributes; if ( $this->renderAsHtml ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-31 13:21:04
|
Revision: 279 Author: skalpa Date: 2006-03-31 05:20:48 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=279&view=rev Log Message: ----------- Added a new mechanism to load Smarty plug-ins. The problem: the Smarty plug-in loading mechanism is not flexible at all... all plug-ins have to be copied to a particular folder to be found, and the list of scanned folders are specified on the PHP side (so it's impossible to add 3rd party plug-ins without copying them to one of these folders, or hack something). The additional mechanism allows to override this and to dynamically load a set of plug-ins by just adding the correct instruction to templates. It works that way: - You can load a "smarty extension" by using the ([xoLoadExtension your_class_name]) instruction somewhere on top of your template - This class gets instanciated, and its extendTemplate() method is called - The extendTemplate() method then registers its plug-ins and makes them available to the tpl engine/compiler This duplicates a little some of the provided Smarty functionnality, but really brings some welcome flexibility and allows things that would not have been able by just making some kind of ([xoAddPluginsFolder /path/to/custom/plugins]) plug-in... also, as most of the things I'm doing to Smarty, the real logic is executed during the compilation phase and has no serious consequences on the runtime scalability/speed. Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/smarty.php Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/smarty.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/smarty.php 2006-03-31 12:54:07 UTC (rev 278) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/smarty.php 2006-03-31 13:20:48 UTC (rev 279) @@ -44,6 +44,8 @@ var $currentFile = ''; + var $extensions = array(); + /** * Theme to apply to this template (if any) * @@ -74,10 +76,39 @@ $this->register_prefilter( array( &$this, 'filterOldTemplates' ) ); + $this->register_compiler_function( 'xoLoadExtension', array( &$this, 'loadExtension' ) ); + $this->assign_by_ref( 'xoops', $xoops ); } + /** + * Load the specified template engine extension + * + * @param unknown_type $params + * @param unknown_type $tpl + */ + function loadExtension( $argString, &$compiler ) { + $bundleId = trim( $argString ); + if ( !isset( $this->extensions[$bundleId] ) ) { + $this->extensions[$bundleId] = XOS::create( $bundleId ); + if ( !$this->extensions[$bundleId] ) { + $this->trigger_error("unknown template extension '$bundleId'"); + } else { + return $this->extensions[$bundleId]->extendTemplate( $this, $compiler ); + } + } + return ''; + } + + function renderWidget( $widget ) { + + + + } + + + function display( $resource_name = null, $cache_id = null, $compile_id = null) { return $this->fetch( $resource_name, $cache_id, $compile_id, true ); } @@ -98,10 +129,17 @@ * @param bool $display If rendered text should be output or returned * @return string Rendered output if $display was false **/ - function fetchFromData( $tplSource, $display = false ) { + function fetchFromData( $tplSource, $display = false, $vars = null ) { if ( !function_exists('smarty_function_eval') ) { require_once SMARTY_DIR . '/plugins/function.eval.php'; } + if ( isset( $vars ) ) { + $oldVars = $this->_tpl_vars; + $this->assign( $vars ); + $out = smarty_function_eval( array('var' => $tplSource), $this ); + $this->_tpl_vars = $oldVars; + return $out; + } return smarty_function_eval( array('var' => $tplSource), $this ); } @@ -141,14 +179,6 @@ } return $_var; } - - - - - - - - } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-31 12:54:16
|
Revision: 278 Author: skalpa Date: 2006-03-31 04:54:07 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=278&view=rev Log Message: ----------- Added a few helper methods in the smarty compiler, for use by compiler plug-ins. I've refactored many classes (i.e: all the form elements) to compiler extensions, to prevent having to load these classes during runtime (this way the element rendering code is inserted inside the compiled template, and there is no need to load the class definition anymore when the template is displayed). Now, due to the way compiler extensions get their parameters, this was not particularly easy or looking nice, and the methods added here are meant to help a little. Nothing is documented, as this is still very unstable... at least it works, but it is still a bit too ugly to be something I can consider definitive for the moment. Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/compiler.php Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/compiler.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/compiler.php 2006-03-31 12:37:32 UTC (rev 277) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Smarty.xoobj/compiler.php 2006-03-31 12:54:07 UTC (rev 278) @@ -79,7 +79,7 @@ } $mods = $this->default_modifiers; $this->default_modifiers = array( '@htmlspecialchars:' . ENT_QUOTES ); - parent::_compile_file( $resource_name, $source_content, $compiled_content ); + $return = parent::_compile_file( $resource_name, $source_content, $compiled_content ); $this->default_modifiers = $mods; $prelude = ''; @@ -91,9 +91,11 @@ $prelude .= "\n?>"; } $compiled_content = $prelude . $compiled_content; - return true; - } - return parent::_compile_file( $resource_name, $source_content, $compiled_content ); + } else { + $return = parent::_compile_file( $resource_name, $source_content, $compiled_content ); + } + $compiled_content = preg_replace( '/<\?php(\s*)\?>/', '', $compiled_content ); + return $return; } /** @@ -196,7 +198,8 @@ if ( !empty( $args ) ) { $create .= ", array(\n"; foreach ( $args as $prop => $value ) { - $create .= "\t'$prop' => " . $value . ",\n"; + $create .= "\t'$prop' => " . + ( is_array( $value ) ? $this->var_export( $value ): $value ) . ",\n"; } $create .= ')'; } @@ -211,6 +214,44 @@ return $code; } + + function _compile_compiler_tag($tag_command, $tag_args, &$output) { + $this->currentTag = $tag_command; + return parent::_compile_compiler_tag( $tag_command, $tag_args, $output ); + } + + function export( $var, $code = true ) { + return var_export( $var, true ); + } + + + function var_export( $arr ) { + $str = 'array('; + foreach ( $arr as $k => $v ) { + $str .= "'$k' => "; + $str .= is_array($v) ? $this->var_export($v) : $v; + $str .= ','; + } + $str .= ')'; + return $str; + } + + function eval_quoted( $value ) { + if ( strpos( $value, '$' ) === false ) { + $value = substr( $value, 1, -1 ); + } else { + $value = "' . " . $value . " . '"; + } + return $value; + } + function replace_quoted( $string, $vars ) { + foreach ( $vars as $name => $value ) { + $value = $this->eval_quoted( $value ); + $string = str_replace( '{' . $name . '}', $value, $string ); + } + return $string; + } + // Fixes for some an original smarty misbehavior, that applies the default modifiers // on the foreach and if variables (making arrays content escaped twice) function _compile_foreach_start( $tag_args ) { @@ -230,14 +271,49 @@ function _parse_attrs( $tag_args, $use_mods = true ) { if ( $use_mods ) { - return parent::_parse_attrs( $tag_args ); + $out = parent::_parse_attrs( $tag_args ); + } else { + $mods = $this->default_modifiers; + $this->default_modifiers = array(); + $out = parent::_parse_attrs( $tag_args ); + $this->default_modifiers = $mods; } - $mods = $this->default_modifiers; - $this->default_modifiers = array(); - $out = parent::_parse_attrs( $tag_args ); - $this->default_modifiers = $mods; + foreach ( $out as $name => $value ) { + $parts = explode( '__', $name ); + if ( count($parts) > 1 ) { + $array =& $out; + foreach ( $parts as $part ) { + if ( !isset( $array[$part] ) ) { + $array[$part] = array(); + } + $array =& $array[$part]; + } + $array = $value; + unset( $out[$name] ); + } + } return $out; } + function _expand_quoted_text($var_expr) { + return is_array( $var_expr ) ? $var_expr : parent::_expand_quoted_text($var_expr); + } + + function _parse_var_props( $val, $use_mods = true ) { + if ( substr( $val, 0, 3 ) == '"_(' ) { + return var_export( XO_( substr( $val, 5, -4 ) ), true ); + } + + if ( $use_mods ) { + return parent::_parse_var_props( $val ); + } else { + $mods = $this->default_modifiers; + $this->default_modifiers = array(); + $out = parent::_parse_var_props( $val ); + $this->default_modifiers = $mods; + return $out; + } + } + function _parse_parenth_args( $parenth_args ) { $mods = $this->default_modifiers; $this->default_modifiers = array(); @@ -245,10 +321,6 @@ $this->default_modifiers = $mods; return $out; } - - - - } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-31 12:37:41
|
Revision: 277 Author: skalpa Date: 2006-03-31 04:37:32 -0800 (Fri, 31 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=277&view=rev Log Message: ----------- Refactored the theme metas rendering implementation, and re-added support for the xoops_slogan and xoops_footer variables. - Metas rendering is now done by a method of the theme class instead of a template. The point is that it may be a bit faster and that actually I didn't see any real benefit of doing that as I first did. People will always render the css metas with a <link> or <style> tag, and the scripts with a <script> tag... I don't think anybody will ever need to customize this... we can move this back to something more flexible if it's requested, but I guess it's ok like this right now. - The theme class has a new property allowing to specify a set of template variables that will be made available in every page, for every theme. By default the footer and slogan variables are here, but this will be configurable through a dedicated config panel. That's the best way I found to re-implement this feature. First thought about adding some kind of "site info" class with these variables as properties, but that was a bit pointless and not really pleasant. I guess it's ok like this, but if somebody reading has a better suggestion, feel very welcome to propose it... Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Theme.xoobj/theme.php Modified: XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Theme.xoobj/theme.php =================================================================== --- XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Theme.xoobj/theme.php 2006-03-30 23:03:20 UTC (rev 276) +++ XoopsCore/branches/tasks/123542-admin/XOOPS/Frameworks/XoopsCore/OutputRendering/Opal.xofrm/Theme.xoobj/theme.php 2006-03-31 12:37:32 UTC (rev 277) @@ -41,17 +41,19 @@ */ function &createInstance( $options = array(), $initArgs = array() ) { // Grab the theme folder from request vars if present - if ( @empty( $options['folderName'] ) && ( $req = @$_REQUEST['_xo_theme_name'] ) ) { - if ( $this->isThemeAllowed( $req ) ) { - $options['folderName'] = $req; - if ( isset( $_SESSION ) && $this->allowUserSelection ) { - $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme'] = $req; - } - } - } elseif ( isset( $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme'] ) ) { - $options['folderName'] = $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme']; - } elseif ( @empty( $options['folderName'] ) || !$this->isThemeAllowed( $options['folderName'] ) ) { - $options['folderName'] = $this->defaultTheme; + if ( @empty( $options['folderName'] ) ) { + if ( $req = @$_REQUEST['_xo_theme_name'] ) { + if ( $this->isThemeAllowed( $req ) ) { + $options['folderName'] = $req; + if ( isset( $_SESSION ) && $this->allowUserSelection ) { + $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme'] = $req; + } + } + } elseif ( isset( $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme'] ) ) { + $options['folderName'] = $_SESSION[ $this->xoBundleIdentifier ]['defaultTheme']; + } elseif ( @empty( $options['folderName'] ) || !$this->isThemeAllowed( $options['folderName'] ) ) { + $options['folderName'] = $this->defaultTheme; + } } // Retrieve the desired content-type from the request if ( @empty( $options['contentType'] ) && !empty($_REQUEST['_xo_mime_type']) ) { @@ -87,12 +89,13 @@ * @param boolean $allowed Whether to return the allowed themes, or all of them * @return array */ - function enumerate( $allowed = true ) { + function enumerate( $allowed = false ) { global $xoops; $themes = array(); - if ( $dh = opendir( $xoops->path('/themes/') ) ) { + $root = $xoops->path( '/themes/' ); + if ( $dh = opendir( $root ) ) { while ( $file = readdir($dh) ) { - if ( $file{0} != '.' && $file != 'CVS' ) { + if ( $file{0} != '.' && $file != 'CVS' && is_dir( "$root/$file" ) ) { $themes[] = $file; } } @@ -194,13 +197,43 @@ var $renderCount = 0; /** * Pointer to the theme template engine - * - * @var object + * @var xoops_opal_Smarty */ var $template = false; - var $metas = array( 'meta' => array(), 'link' => array() ); + /** + * Array containing the document meta-information + * @var array + */ + var $metas = array( + 'http' => array( + 'Content-Script-Type' => 'text/javascript', + 'Content-Style-Type' => 'text/css', + ), + 'meta' => array( + 'generator' => 'XOOPS', + 'robots' => 'index,follow', + 'copyright' => 'Copyright 2000-2006', + ), + 'link' => array(), + 'script' => array(), + ); + /** + * Array of strings to be inserted in the head tag of HTML documents + * @var array + */ + var $htmlHeadStrings = array(); + /** + * Custom variables that will always be assigned to the template + * @var array + */ + var $templateVars = array( + 'slogan' => 'Put a slogan if you wish', + 'footer' => 'Powered by XOOPS, the noosphere, and caffeine', + ); + + /**#@-*/ /**#@+ @tasktype 10 Initialization*/ @@ -332,8 +365,18 @@ } $this->setMeta( 'link', $rel, $attributes ); } - /** + * Set a meta http-equiv value + */ + function setHttpMeta( $name, $value = null ) { + if ( isset($value) ) { + return $this->setMeta( 'http', $name, $value ); + } + unset( $this->metas['http'][$name] ); + } + + + /** * Change output page meta-information */ function setMeta( $type = 'meta', $name = '', $value = '' ) { @@ -348,8 +391,16 @@ return $value; } + function headContent( $params, $content, &$smarty, &$repeat ) { + if ( !$repeat ) { + $this->htmlHeadStrings[] = $content; + } + } + + function setNamespace( $ns, $uri ) { + $this->namespaces[$ns] = $uri; + } - /** * Returns the document namespaces as an xmlns string that can be inserted in the main tag */ @@ -422,13 +473,16 @@ if ( !empty($contentTpl) ) { $this->contentTemplate = $contentTpl; } - $vars['xoTheme'] =& $this; + $this->template->assign_by_ref( 'xoModule', $xoops->currentModule ); + $this->template->register_object( 'xoModule', &$xoops->currentModule, null, false ); + $this->template->register_object( 'xoTheme', &$this, null, false, array( 'headContent' ) ); + /* this will be changed */ $vars['xoops_dirname'] = @!empty( $GLOBALS['xoopsModule'] ) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system'; $this->template->assign( $vars ); if ( $xoops->services['http'] ) { - $xoops->services['http']->setEntityInfo( $this->contentType, 'iso-8859-1' ); + //$xoops->services['http']->setEntityInfo( $this->contentType, 'iso-8859-1' ); $xoops->services['http']->addVariation( 'xo-theme', $this->xoBundleIdentifier ); } $this->renderZone( 'canvas' ); @@ -496,9 +550,60 @@ } return $tpl; } + + function renderMetas( $type = null ) { + if ( !isset($type) ) { + foreach ( array_keys($this->metas) as $type ) { + $this->renderMetas( $type ); + } + echo implode( "\n", $this->htmlHeadStrings ); + return; + } + switch ( $type ) { + case 'script': + foreach ( $this->metas[$type] as $attrs ) { + echo '<script' . $this->renderAttributes( $attrs ) . ">\n"; + if ( @$attrs['_'] ) { + echo "\n//<![CDATA[\n" . $attrs['_'] . "\n//]]>"; + } + echo "</script>\n"; + } + break; + case 'link': + foreach ( $this->metas[$type] as $rel => $attrs ) { + echo '<link rel="' . $rel . '"' . $this->renderAttributes( $attrs ) . " />\n"; + } + break; + case 'stylesheet': + foreach ( $this->metas[$type] as $attrs ) { + if ( @$attrs['_'] ) { + echo '<style' . $this->renderAttributes($attrs) . ">\n/* <![CDATA[ */\n" . $attrs['_'] . "\n/* //]]> */\n</style>"; + } else { + echo '<link rel="stylesheet"' . $this->renderAttributes($attrs) . " />\n"; + } + } + break; + case 'http': + foreach ( $this->metas[$type] as $name => $content ) { + echo '<meta http-equiv="' . htmlspecialchars( $name, ENT_QUOTES ) . '" content="' . htmlspecialchars( $content, ENT_QUOTES) . "\" />\n"; + } + break; + default: + foreach ( $this->metas[$type] as $name => $content ) { + echo '<meta name="' . htmlspecialchars( $name, ENT_QUOTES ) . '" content="' . htmlspecialchars( $content, ENT_QUOTES) . "\" />\n"; + } + break; + } + } + + function genElementId( $tagName = 'xos' ) { + static $cache = array(); + if ( !isset( $cache[ $tagName ] ) ) { + $cache[$tagName] = 1; + } + return $tagName . '-' . $cache[$tagName]++; + } - - function renderAttributes( $coll ) { $str = ''; foreach ( $coll as $name => $val ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: DAVID L. <dav...@bt...> - 2006-03-31 01:53:52
|
xoo...@li... register |
|
From: DAVID L. <dav...@bt...> - 2006-03-31 01:44:23
|
|
From: <sk...@us...> - 2006-03-30 23:03:27
|
Revision: 276 Author: skalpa Date: 2006-03-30 15:03:20 -0800 (Thu, 30 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=276&view=rev Log Message: ----------- Dummy commit to check the installation of the notification hook Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/docs/changelog.txt Modified: XoopsCore/branches/tasks/123542-admin/docs/changelog.txt =================================================================== --- XoopsCore/branches/tasks/123542-admin/docs/changelog.txt 2006-03-30 22:23:24 UTC (rev 275) +++ XoopsCore/branches/tasks/123542-admin/docs/changelog.txt 2006-03-30 23:03:20 UTC (rev 276) @@ -1,6 +1,5 @@ XOOPS 2 changelog - ============================ 2006/xx/xx: Version 2.3.0-alpha2 ============================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sk...@us...> - 2006-03-30 23:03:27
|
Revision: 276 Author: skalpa Date: 2006-03-30 15:03:20 -0800 (Thu, 30 Mar 2006) ViewCVS: http://svn.sourceforge.net/xoops/?rev=276&view=rev Log Message: ----------- Dummy commit to check the installation of the notification hook Modified Paths: -------------- XoopsCore/branches/tasks/123542-admin/docs/changelog.txt Modified: XoopsCore/branches/tasks/123542-admin/docs/changelog.txt =================================================================== --- XoopsCore/branches/tasks/123542-admin/docs/changelog.txt 2006-03-30 22:23:24 UTC (rev 275) +++ XoopsCore/branches/tasks/123542-admin/docs/changelog.txt 2006-03-30 23:03:20 UTC (rev 276) @@ -1,6 +1,5 @@ XOOPS 2 changelog - ============================ 2006/xx/xx: Version 2.3.0-alpha2 ============================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <hk1...@tb...> - 2006-03-07 11:57:40
|
幹事さん必見 ━━━[PR]━━━━━━━━━━━━━━━━━━━ 食べた分だけ得しちゃう インターネットで予約をすると幹事さんに最大15%キャッシュバックがあります。 友達の誕生日、結婚式、飲み会、忘年会などに ぜひぜひ使っちゃおヽ(`▽´)ノヽ(`▽´)ノ 無料登録はこちら http://iikannji.org/?ID=void お店一発検索 http://www.11kanji.com/?UID=9717 まだあまり提携数が少ないですがこれから多くなっていきますので、ご期待ください。 http://www2.tba.t-com.ne.jp/kamekame/014/014/enter.html ★★★★★★★★★★★★★★★★★★★ 配信不要の方はお手数ですが、こちらにそ のまま返信してください。 ★★★★★★★★★★★★★★★★★★★ |