------------------------------------------------------------
revno: 1035
committer: Jon Phillips <[email protected]>
branch nick: public
timestamp: Thu 2012-01-19 15:04:41 +0800
message:
* Added default assets/plugins folder
* changed the default location Plugins.php looks for plugins to assets/plugins
* Made sure all parts of Output.php (basically aiki's hardcoded html) is
overridable and documented it
* Added rg1024's setup_plugins.php script to root for now to enable any plugin
put into assets/plugins for the time being. It has to be called from browser
* Tested my header overrides and now committing code to http://aikilab.org
repo
added:
assets/plugins/
setup_plugin.php
modified:
libs/Output.php
libs/Plugins.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== added directory 'assets/plugins'
=== modified file 'libs/Output.php'
--- libs/Output.php 2012-01-18 09:10:39 +0000
+++ libs/Output.php 2012-01-19 07:04:41 +0000
@@ -116,8 +116,6 @@
* Returns the title and default meta tags as html
*
* @return string
- *
- * @todo title has a hardcoded default here, need to remove
*/
public function title_and_metas() {
global $aiki, $config;
@@ -142,9 +140,6 @@
*
* @global $aiki
* @return string
- *
- * @todo we really should have a default template for pages somewhere and
- * NOT have default doctype written directly inside of aiki!
*/
public function doctype() {
global $aiki;
@@ -157,9 +152,6 @@
$aiki->languages->language = "en";
$aiki->languages->dir = "ltr";
}
- /**
- * @todo this really needs to be abstracted? why just output xthml???
- */
$lang= $aiki->site->language();
$dir = $aiki->languages->dir;
@@ -191,6 +183,7 @@
public function headers() {
global $aiki, $db, $layout, $nogui, $config;
+ $header = '';
$aiki->Plugins->doAction("output_begin", $header);
$header = $this->doctype();
$head_tag = '<head>';
@@ -217,11 +210,9 @@
implode("_", $layout->widgets_css),
$language);
}
- // set favicon, but doesn't really check to see if it exists
$favicon =
'<link rel="icon" href="' . $config['url'] .
'assets/images/favicon.ico" type="image/x-icon" />';
-
$aiki->Plugins->doAction("output_head_favicon", $favicon);
$header .= $favicon;
}
@@ -233,7 +224,6 @@
$header .= $this->headers;
$head_tag_close = "</head>";
// Yes, the next two are the same.
- $aiki->Plugins->doAction("output_head", $head_tag_close);
$aiki->Plugins->doAction("output_head_end", $head_tag_close);
$header .= $head_tag_close;
=== modified file 'libs/Plugins.php'
--- libs/Plugins.php 2012-01-18 14:54:11 +0000
+++ libs/Plugins.php 2012-01-19 07:04:41 +0000
@@ -37,7 +37,7 @@
*
*/
-define ("AIKI_PLUGIN_DIR", "plugins");
+define ("AIKI_PLUGIN_DIR", "assets/plugins");
class Plugins {
@@ -303,8 +303,8 @@
* class MyPluginName extends plugin { ..here code }
*
* The code must contain the two functions:
- * - set_actions that must return a array of actions=>priorities
- * - do_action that receive two parameters action and &text ..
+ * - setActions that must return a array of actions=>priorities
+ * - action that receive two parameters action and &text ..
*
* You must not:
* - create a plugin object.
=== added file 'setup_plugin.php'
--- setup_plugin.php 1970-01-01 00:00:00 +0000
+++ setup_plugin.php 2012-01-19 07:04:41 +0000
@@ -0,0 +1,51 @@
+<html>
+<?php
+/**
+ * Aiki Framework (PHP)
+ *
+ * LICENSE
+ *
+ * This source file is subject to the AGPL-3.0 license that is bundled
+ * with this package in the file LICENSE.
+ *
+ * @author Aikilab http://www.aikilab.com
+ * @copyright (c) 2008-2011 Aiki Lab Pte Ltd
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @link http://www.aikiframework.org
+ * @category Aiki
+ * @package Aiki
+ * @filesource
+ */
+
+/*
+ * Provisional TEST for installing plugins
+ *
+ ****/
+
+include "bootstrap.php";
+
+$founded= plugins::search_plugins(AIKI_PLUGIN_DIR);
+
+echo "<pre>";
+echo "AIKI PLUGIN INSTALLATION pre-beta...\n";
+if ( $founded) {
+ echo "Plugins found: ", count($founded), "\n";
+ echo "Installed: ", plugins::available_plugins($founded), "\n";
+ echo "Activated: ";
+ global $db;
+ $ids= $db->get_results("SELECT plugin_name,plugin_id FROM aiki_plugins LEFT JOIN aiki_plugin_configurations ON plugin_id= plconf_plugin_id WHERE plconf_id is NULL");
+ if ( !is_array($ids) ){
+ echo "No plugins is found or all have configuration\n";
+ } else {
+ foreach ($ids as $id){
+ echo "lugin {$id->plugin_name} activated for *\n";
+ plugins::insert_plugin_configuration($id->plugin_id,"*");
+ }
+ }
+} else {
+ echo "No plugin found in ", AIKI_PLUGIN_DIR;
+
+}
+echo "</pre>";
+?>
+</html>
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp