本文整理汇总了PHP中Widgetkit类的典型用法代码示例。如果您正苦于以下问题:PHP Widgetkit类的具体用法?PHP Widgetkit怎么用?PHP Widgetkit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Widgetkit类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// load widgetkit
require_once JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit.php';
$this->widgetkit = Widgetkit::getInstance();
}
示例2: getInstance
public static function getInstance()
{
// add instance, if not exists
if (!isset(self::$_instance)) {
self::$_instance = new Widgetkit();
}
return self::$_instance;
}
示例3: pathWK
public function pathWK($resource)
{
// load widgetkit
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit.php')) {
require_once JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit.php';
}
$widgetkit = Widgetkit::getInstance();
return $widgetkit['path']->path($resource);
}
示例4: onPrepareContent
public function onPrepareContent(&$article, &$params, $limitstart)
{
preg_match_all('#\\[widgetkit id=(\\d+)\\]#', $article->text, $matches);
if (count($matches[1])) {
// load widgetkit
require_once JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit.php';
// get widgetkit
$widgetkit = Widgetkit::getInstance();
// render output
foreach ($matches[1] as $i => $widget_id) {
$output = $widgetkit['widget']->render($widget_id);
$output = $output === false ? "Could not load widget with the id {$widget_id}." : $output;
$article->text = str_replace($matches[0][$i], $output, $article->text);
}
}
return '';
}
示例5: json_encode
echo json_encode($data);
}
/*
Function: docopy
Copy action
Returns:
Void
*/
public function docopy(){
if ($id = $this['request']->get('id', 'int')) {
$this['widget']->copy($id);
}
echo $this['template']->render('dashboard');
}
}
// bind events
$widgetkit = Widgetkit::getInstance();
$widgetkit['event']->bind('site', array($widgetkit['accordion'], 'site'));
$widgetkit['event']->bind('dashboard', array($widgetkit['accordion'], 'dashboard'));
$widgetkit['event']->bind('task:edit_accordion', array($widgetkit['accordion'], 'edit'));
$widgetkit['event']->bind('task:item_accordion', array($widgetkit['accordion'], 'item'));
$widgetkit['event']->bind('task:save_accordion', array($widgetkit['accordion'], 'save'));
$widgetkit['event']->bind('task:delete_accordion', array($widgetkit['accordion'], 'delete'));
$widgetkit['event']->bind('task:copy_accordion', array($widgetkit['accordion'], 'docopy'));
示例6: __construct
public function __construct()
{
// init vars
$this->widgetkit = Widgetkit::getInstance();
$this->type = strtolower(str_replace('Joomla', '', get_class($this)));
$this->options = $this->widgetkit['system']->options;
// bind events
$this->widgetkit['event']->bind('dashboard', array($this, 'dashboard'));
$this->widgetkit['event']->bind("render", array($this, 'render'));
$this->widgetkit['event']->bind("task:edit_{$this->type}_joomla", array($this, 'edit'));
$this->widgetkit['event']->bind("task:save_{$this->type}_joomla", array($this, 'save'));
// register path
$this->widgetkit['path']->register($this->widgetkit['path']->path('widgetkit_joomla.widgets:' . $this->type), "joomla{$this->type}");
}
示例7: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
// get widgetkit
$widgetkit = Widgetkit::getInstance();
return $widgetkit['field']->render('widget', $control_name . '[' . $name . ']', $value, null);
}
示例8: __construct
public function __construct()
{
parent::__construct(false, 'Widgetkit - Twitter', array('description' => 'Lets you display your tweets'));
// get widgetkit
$this->widgetkit = Widgetkit::getInstance();
}
示例9: __construct
public function __construct($id, $type, $style, $name, $content, $created, $modified)
{
$widgetkit = Widgetkit::getInstance();
// init vars
$this->id = $id;
$this->type = $type;
$this->name = $name;
$this->content = $widgetkit['data']->create($content);
$this->created = $created;
$this->modified = $modified;
if (is_null($style)) {
$settings = $this->content->get("settings", array());
$style = isset($settings["style"]) ? $settings["style"] : null;
}
if (is_null($style) || !$widgetkit["path"]->path("widgets:" . $this->type . "/styles/{$style}/config.xml")) {
$style = $widgetkit["widget"]->defaultStyle($this->type);
}
$this->style = $style;
}
示例10: getInput
function getInput()
{
// get widgetkit
$widgetkit = Widgetkit::getInstance();
return $widgetkit['field']->render('widget', $this->name, $this->value, null);
}
示例11: __construct
public function __construct($id, $type, $style, $name, $content, $created, $modified)
{
$widgetkit = Widgetkit::getInstance();
// init vars
$this->id = $id;
$this->type = $type;
$this->name = $name;
$this->content = $widgetkit["data"]->create($content);
$this->created = $created;
$this->modified = $modified;
}