* @license PHP License * @package WB * @subpackage datasource */ /** * Datasource TreeMenu Child * * Base class for other TreeMenu children * * @version 1.0.0 * @package WB * @subpackage datasource */ class WBDatasource_TreeMenu_Child extends WBStdClass { /** * Prototype of configuration parameter * @var array */ protected $params = array( 'pathprefix' => '' ); /** * Prototype menu node * @array */ protected $nodePrototype = array( 'id' => 'child', 'menu' => '', 'path' => '', 'urlid' => 0, 'url' => '[[SERVICE_HTML]]', 'linktext' => 'Linktext', 'tooltip' => 'Tooltip', 'class' => '', 'requireuser' => 'anybody', 'requiregroup' => 0, 'position' => 0, 'created' => '1970-01-01 00:00:00', 'changed' => '1970-01-01 00:00:00', ); /** * Dictionary URL * @var WBDictionary_URL */ protected $url; /** * Constructor * * Init blog tool */ final public function __construct($parameters = array()) { $this->params = array_merge($this->params, $parameters); $this->url = WBClass::create('WBDictionary_URL'); $this->init(); } /** * 2nd Constructor */ protected function init() { } /** * Tell wheather URL is in path * * Use path prefix to find out, wheather this class is responsible for the curren path * * @param string * @return bool */ public function checkUrl($url) { $url = WBString::replaceSuperPlaceholders($url); $path = WBString::replaceSuperPlaceholders('[[SERVICE_HTML]]' . $this->params['pathprefix']); if (strncmp($url, $path, strlen($path)) == 0) { return true; } return false; } /** * Check URL dictionary record * * Return menu record * * @param string $urlid * @param string $url * @return array */ public function getNode($urlid, $url) { return array(); } /** * Get menu child nodes * * Return menu records * * @param string $url * @return array */ public function getChildren($url) { return array(); } /** * Get parent nodes until normal tree menu * * List parent nodes until normal (tree manu) parent nodes are reached. * The tree menu class will merge parents together * * @param array $child * @return array */ public function getParents($child) { return array(); } }