コード例 #1
0
ファイル: widgetkit.php プロジェクト: ziyou-liu/1line
 public function __construct()
 {
     parent::__construct();
     // load widgetkit
     require_once JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit.php';
     $this->widgetkit = Widgetkit::getInstance();
 }
コード例 #2
0
ファイル: path.php プロジェクト: knigherrant/decopatio
 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);
 }
コード例 #3
0
 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 '';
 }
コード例 #4
0
ファイル: accordion.php プロジェクト: kosmosby/medicine-prof
		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'));
コード例 #5
0
 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}");
 }
コード例 #6
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     // get widgetkit
     $widgetkit = Widgetkit::getInstance();
     return $widgetkit['field']->render('widget', $control_name . '[' . $name . ']', $value, null);
 }
コード例 #7
0
ファイル: system.php プロジェクト: nakamuraagatha/yooo
 public function __construct()
 {
     parent::__construct(false, 'Widgetkit - Twitter', array('description' => 'Lets you display your tweets'));
     // get widgetkit
     $this->widgetkit = Widgetkit::getInstance();
 }
コード例 #8
0
ファイル: widget.php プロジェクト: navetisyan/asatryans
 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;
 }
コード例 #9
0
ファイル: widget.php プロジェクト: ziyou-liu/1line
 function getInput()
 {
     // get widgetkit
     $widgetkit = Widgetkit::getInstance();
     return $widgetkit['field']->render('widget', $this->name, $this->value, null);
 }
コード例 #10
0
 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;
 }