Commit 6075f215 by seldaek

cleanup of some \r\n's

git-svn-id: svn://dwoo.org/dwoo/trunk@206 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 7996536c
<?php <?php
/** /**
* <strong>Agavi specific plugin</strong> * <strong>Agavi specific plugin</strong>
* *
* uses AgaviTranslationManager to localize a string * uses AgaviTranslationManager to localize a string
* *
* <pre> * <pre>
* * string : the string to localize * * string : the string to localize
* </pre> * </pre>
* *
* Examples: * Examples:
* <code> * <code>
* {t "Hello"} * {t "Hello"}
* {t $header} * {t $header}
* </code> * </code>
* *
* This software is provided 'as-is', without any express or implied warranty. * This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software. * In no event will the authors be held liable for any damages arising from the use of this software.
* *
* This file is released under the LGPL * This file is released under the LGPL
* "GNU Lesser General Public License" * "GNU Lesser General Public License"
* More information can be found here: * More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html} * {@link http://www.gnu.org/copyleft/lesser.html}
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/ * @link http://dwoo.org/
* @version 1.0.0 * @version 1.0.0
* @date 2008-09-08 * @date 2008-09-08
* @package Dwoo * @package Dwoo
*/ */
function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string) function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string)
{ {
return '$this->data[\'tm\']->_('.$string.')'; return '$this->data[\'tm\']->_('.$string.')';
} }
\ No newline at end of file
<?php <?php
/** /**
* <strong>Agavi specific plugin</strong> * <strong>Agavi specific plugin</strong>
* *
* uses AgaviRouting to create an url * uses AgaviRouting to create an url
* *
* <pre> * <pre>
* * route : the route name, optional (by default the current url is returned) * * route : the route name, optional (by default the current url is returned)
* * params : an array with variables to build the route, optional * * params : an array with variables to build the route, optional
* * options : an array of options to pass to the routing object, optional * * options : an array of options to pass to the routing object, optional
* * rest : for convenience, you can just pass named parameters that will be used as * * rest : for convenience, you can just pass named parameters that will be used as
* the params array, but you must not provide the params array in this case * the params array, but you must not provide the params array in this case
* </pre> * </pre>
* *
* Examples: * Examples:
* <code> * <code>
* {a url("route.name" array(param="Value", param2=$otherVal))}Here is a link{/a} * {a url("route.name" array(param="Value", param2=$otherVal))}Here is a link{/a}
* <form action="{url}"> {* without any parameter it just returns the current url *} * <form action="{url}"> {* without any parameter it just returns the current url *}
* </code> * </code>
* *
* This software is provided 'as-is', without any express or implied warranty. * This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software. * In no event will the authors be held liable for any damages arising from the use of this software.
* *
* This file is released under the LGPL * This file is released under the LGPL
* "GNU Lesser General Public License" * "GNU Lesser General Public License"
* More information can be found here: * More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html} * {@link http://www.gnu.org/copyleft/lesser.html}
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/ * @link http://dwoo.org/
* @version 1.0.0 * @version 1.0.0
* @date 2008-09-08 * @date 2008-09-08
* @package Dwoo * @package Dwoo
*/ */
function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array()) function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array())
{ {
if ($params == 'null') { if ($params == 'null') {
if (count($rest)) { if (count($rest)) {
$params = array(); $params = array();
foreach ($rest as $k=>$v) { foreach ($rest as $k=>$v) {
if (is_numeric($k)) { if (is_numeric($k)) {
$params[] = $k.'=>'.$v; $params[] = $k.'=>'.$v;
} else { } else {
$params[] = '"'.$k.'"=>'.$v; $params[] = '"'.$k.'"=>'.$v;
} }
} }
$params = 'array('.implode(', ', $params).')'; $params = 'array('.implode(', ', $params).')';
} else { } else {
$params = 'array()'; $params = 'array()';
} }
} }
if ($options == 'null') { if ($options == 'null') {
$options = 'array()'; $options = 'array()';
} }
return '$this->data[\'ro\']->gen('.$route.', '.$params.', '.$options.')'; return '$this->data[\'ro\']->gen('.$route.', '.$params.', '.$options.')';
} }
\ No newline at end of file
<?php <?php
/** /**
* interface that represents a dwoo plugin proxy * interface that represents a dwoo plugin proxy
* *
* This software is provided 'as-is', without any express or implied warranty. * This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software. * In no event will the authors be held liable for any damages arising from the use of this software.
* *
* This file is released under the LGPL * This file is released under the LGPL
* "GNU Lesser General Public License" * "GNU Lesser General Public License"
* More information can be found here: * More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html} * {@link http://www.gnu.org/copyleft/lesser.html}
* *
* @author Denis Arh <denis@arh.cc> * @author Denis Arh <denis@arh.cc>
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano * @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/ * @link http://dwoo.org/
* @version 0.9.1 * @version 0.9.1
* @date 2008-05-30 * @date 2008-05-30
* @package Dwoo * @package Dwoo
*/ */
interface Dwoo_IPluginProxy interface Dwoo_IPluginProxy
{ {
/** /**
* returns true or false to say whether the given plugin is handled by this proxy or not * returns true or false to say whether the given plugin is handled by this proxy or not
* *
* @param string $name the plugin name * @param string $name the plugin name
* @return bool true if the plugin is known and usable, otherwise false * @return bool true if the plugin is known and usable, otherwise false
*/ */
public function handles($name); public function handles($name);
/** /**
* returns the code (as a string) to call the plugin * returns the code (as a string) to call the plugin
* (this will be executed at runtime inside the Dwoo class) * (this will be executed at runtime inside the Dwoo class)
* *
* @param string $name the plugin name * @param string $name the plugin name
* @param array $params a parameter array, array key "*" is the rest array * @param array $params a parameter array, array key "*" is the rest array
* @return string * @return string
*/ */
public function getCode($name, $params); public function getCode($name, $params);
/** /**
* returns a callback to the plugin, this is used with the reflection API to * returns a callback to the plugin, this is used with the reflection API to
* find out about the plugin's parameter names etc. * find out about the plugin's parameter names etc.
* *
* should you need a rest array without the possibility to edit the * should you need a rest array without the possibility to edit the
* plugin's code, you can provide a callback to some * plugin's code, you can provide a callback to some
* other function with the correct parameter signature, i.e. : * other function with the correct parameter signature, i.e. :
* <code> * <code>
* return array($this, "callbackHelper"); * return array($this, "callbackHelper");
* // and callbackHelper would be as such: * // and callbackHelper would be as such:
* public function callbackHelper(array $rest=array()){} * public function callbackHelper(array $rest=array()){}
* </code> * </code>
* *
* @param string $name the plugin name * @param string $name the plugin name
* @return callback * @return callback
*/ */
public function getCallback($name); public function getCallback($name);
/** /**
* returns some code that will check if the plugin is loaded and if not load it * returns some code that will check if the plugin is loaded and if not load it
* this is optional, if your plugins are autoloaded or whatever, just return an * this is optional, if your plugins are autoloaded or whatever, just return an
* empty string * empty string
* *
* @param string $name the plugin name * @param string $name the plugin name
* @return string * @return string
*/ */
public function getLoader($name); public function getLoader($name);
} }
\ No newline at end of file
<?php <?php
function dwooAutoload($class) function dwooAutoload($class)
{ {
if (substr($class, 0, 5) === 'Dwoo_') { if (substr($class, 0, 5) === 'Dwoo_') {
include strtr($class, '_', DIRECTORY_SEPARATOR).'.php'; include strtr($class, '_', DIRECTORY_SEPARATOR).'.php';
} }
} }
spl_autoload_register('dwooAutoload'); spl_autoload_register('dwooAutoload');
set_include_path(str_replace(PATH_SEPARATOR.dirname(__FILE__), '', get_include_path()) . PATH_SEPARATOR . dirname(__FILE__)); set_include_path(str_replace(PATH_SEPARATOR.dirname(__FILE__), '', get_include_path()) . PATH_SEPARATOR . dirname(__FILE__));
include 'Dwoo.php'; include 'Dwoo.php';
\ No newline at end of file
<?php <?php
function Dwoo_Plugin_loaderTest(Dwoo $dwoo) function Dwoo_Plugin_loaderTest(Dwoo $dwoo)
{ {
return 'Moo'; return 'Moo';
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment