diff --git a/profiles/02_content.yml b/profiles/02_content.yml index ddea440..c8cb350 100644 --- a/profiles/02_content.yml +++ b/profiles/02_content.yml @@ -4,7 +4,7 @@ objects: type: wiki_page ref: page_about data: - mode: create - name: About Tiki Addons + mode: create_or_update + name: About Tiki Addons content: wikicontent:page_about description: diff --git a/profiles/02_content/page_about.wiki b/profiles/02_content/page_about.wiki index af6579a..6d9ea0a 100644 --- a/profiles/02_content/page_about.wiki +++ b/profiles/02_content/page_about.wiki @@ -6,4 +6,4 @@ Tiki Addons is a way to deploy custom "apps" or other addons to Tiki. It support *Language Files *PHP Code in libs and views !Example of View -{addon package="tikiorg/helloworld" view="helloworld"} +{addon package="tikiorg/helloworld" view="helloworld" color="green"} diff --git a/templates/tikiorg-helloworld.tpl b/templates/tikiorg-helloworld.tpl index 28e5f53..b85c35e 100644 --- a/templates/tikiorg-helloworld.tpl +++ b/templates/tikiorg-helloworld.tpl @@ -1,4 +1,4 @@
-

{tr}Is it working?{/tr}

+

{tr}Is it working?{/tr}

{if $prefs.ta_tikiorg_helloworld_boldtext == 'y'}{/if}{$bar|escape}{if $prefs.ta_tikiorg_helloworld_boldtext == 'y'}{/if}

diff --git a/tikiaddon.json b/tikiaddon.json index 8dc0bfd..68d8c12 100644 --- a/tikiaddon.json +++ b/tikiaddon.json @@ -1,7 +1,7 @@ { "name": "Hello World", "package": "tikiorg/helloworld", - "version": "0.1", + "version": "0.1.1", "url": "http://dev.tiki.org/TikiAddonHelloWorld", "smarty": true, "tiki": ["14"], diff --git a/upgrade.json b/upgrade.json index 7a73a41..25acb30 100644 --- a/upgrade.json +++ b/upgrade.json @@ -1,2 +1,7 @@ { + "0.1": { + "remove": [], + "forget": ["02_content"], + "reapply": [] + } } \ No newline at end of file diff --git a/views/helloworld.php b/views/helloworld.php index 0dde0a9..310c0e0 100644 --- a/views/helloworld.php +++ b/views/helloworld.php @@ -2,6 +2,24 @@ namespace tikiaddon\tikiorg\helloworld; +function helloworld_info() +{ + return array( + 'name' => tra('Print Hello World'), + 'description' => tra('Display output of a Tiki Addon View'), + 'filter' => 'text', + 'params' => array( + 'color' => array( + 'required' => false, + 'name' => tra('Color of introductory text'), + 'description' => tra('The color to display the introductory text in'), + 'extraparams' => false, + 'filter' => 'text', + ), + ), + ); +} + function helloworld($data, $params) { // extracts parameters passed from wikiplugin_addon.php @@ -12,6 +30,10 @@ function helloworld($data, $params) $foo = $helloworld->lib('foo'); + if (!empty($color)) { + $helloworld->smarty->assign('color', $color); + } + // Warning: the following lines use the Tiki global smarty object, // which is *bad* practice as it can cause variables to be overwritten. // \TikiLib::lib('smarty')->assign('bar', $foo->hello());