Jump to content

Achievo/Howto/Developers/Create pim items: Difference between revisions

From NusaATK
No edit summary
Line 1: Line 1:
"Author": Sandy Pleyte
''Author'': Sandy Pleyte


"Last modified": 17 March 2006  
''Last modified'': 17 March 2006  


"Complexity": Easy  
''Complexity'': Easy  




== Intro ==
== Intro ==
In Achievo it's possible to create pim items in your own module. As of Achievo 1.2 it's possible for users to choose what pim items they want to show on they pim page. This howto explains how to accomplish this.
In Achievo it's possible to create [[pim]] items in your own module. As of Achievo 1.2 it's possible for users to choose what [[pim]] items they want to show on they [[pim]] page. This howto explains how to accomplish this.


== Achievo 1.1 and below ==
== Achievo 1.1 and below ==
If you want to add a pim item to your module, you should extend your module class with the following function:
If you want to add a [[pim]] item to your module, you should extend your module class with the following function:


<code>
<code>
Line 20: Line 20:
</code>
</code>


If you want more then 1 Pim item, you should collect the result and return it as one variable.
If you want more then 1 [[pim]] item, you should collect the result and return it as one variable.


<code>
<code>
Line 34: Line 34:
== Achievo 1.2 and above ==
== Achievo 1.2 and above ==


In Achievo 1.2 and above it's possible to specify 1 or more pim items for a module. To get this result you need to extend your module class with the following function:
In Achievo 1.2 and above it's possible to specify 1 or more [[pim]] items for a module. To get this result you need to extend your module class with the following function:


<code>
<code>
Line 54: Line 54:
</code>
</code>


As you can see in stead of returning the content for the pim page, we now return an array with the pim item name and the function to call.
As you can see in stead of returning the content for the [[pim]] page, we now return an array with the [[pim]] item name and the function to call.

Revision as of 21:05, 17 March 2006

Author: Sandy Pleyte

Last modified: 17 March 2006

Complexity: Easy


Intro

In Achievo it's possible to create pim items in your own module. As of Achievo 1.2 it's possible for users to choose what pim items they want to show on they pim page. This howto explains how to accomplish this.

Achievo 1.1 and below

If you want to add a pim item to your module, you should extend your module class with the following function:

   function getPimItems()
   {
     return "This is my Pim Item";
   }

If you want more then 1 pim item, you should collect the result and return it as one variable.

   function getPimItems()
   {
      $ret = "";
      $ret.= $this->getExample1();
      $ret.= $this->getExample2();
      return $ret;
   }

Achievo 1.2 and above

In Achievo 1.2 and above it's possible to specify 1 or more pim items for a module. To get this result you need to extend your module class with the following function:

   function getPimItems()
   {
     return array("example1"=>"getExample1",
                  "example2"=>"getExample2");
   }
   function getExample1()
   {
     return "Example 1 Pim item";
   }
   function getExample2()
   {
     return "Example 2 Pim item";
   }

As you can see in stead of returning the content for the pim page, we now return an array with the pim item name and the function to call.