Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 4 5 6 7 Next > End >>
Re:CB Helloworld Plugin (part 2)
Date: 2006/11/09 06:30 By: jmedina Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 15
graphgraph
Here is a working copy of the plug in with the zoom link. 2 Things.

1) It looks like the XML file is messed up some how.. You get error why you upload but it still works. You may want to clean that up before putting it in the 3PD Plug In section.

2) I assigned a class to the like "cbzoomlink" this obviously needs to be added to the CB template CSS.

The CSS that I am using is in a text file inside the zip. If you use the CSS then you will have to remove the IMG code from the cbzoomlink.php.

Let me know what you think.
File Attachment:
File name: plug_cbzoomlink.zip
File size:5666 bytes
Click here to see the profile of this user The administrator has disabled public write access.

Re:CB Helloworld Plugin (part 2)
Date: 2006/11/13 07:55 By: bjraines Status: User  
Karma: 3  
Expert Joomlapolitan

Posts: 155
graphgraph
have been reading several modules and plugins. I am trying to learn how to use the API correctly.

Now my question is
if you are pulling the message from the paramter why did you include it here. would it not pull the text of whatever was in the field in the plugin parameters? Also wouldnt it get the publish state. Why does it need to be stated?

Code:

    $is_helloworld_plug_enabled $params->get('hwPlugEnabled'"1"); $helloworld_tab_message $params->get('hwTabMessage'"Hello Joomlapolitans!"); 





also why is this needed at the beginning?

Code:

     $return null;


Joomla Community Builder Paginated Article Plugin

Chemistry Homework Help
Click here to see the profile of this user The administrator has disabled public write access.

Re:CB Helloworld Plugin (part 2)
Date: 2006/11/13 08:08 By: nant Status: Admin  
Karma: 462  
Admin

Posts: 5978
graph
bjraines wrote:
have been reading several modules and plugins. I am trying to learn how to use the API correctly.

Great!


Now my question is
if you are pulling the message from the paramter why did you include it here. would it not pull the text of whatever was in the field in the plugin parameters? Also wouldnt it get the publish state. Why does it need to be stated?

Code:

    $is_helloworld_plug_enabled $params->get('hwPlugEnabled'"1"); $helloworld_tab_message $params->get('hwTabMessage'"Hello Joomlapolitans!"); 



The actual code is executed because the plugin is published.
The $params->get function retrieves the plugin or tab parameter specified in its first argument and if its value is null, then it gives it the default value specified in the second paramater (e.g., "1" or "Hello Joomlapolitans"). The reason this is needed is that when a plugin is initially installed the parameters are not saved in the CB plugin table. The parameters are saved if the user clicks save in the plugin parameters backend. So in order for the plugin to be safe and have all parameters with real values, all plugins should use this function and have all default values specified in XML replicated in the code. (the entire design is meant to support CB upgrades without losing plugin parameter settings)



also why is this needed at the beginning?

Code:

     $return null;



I guess good practice. Always a good idea to initialize your variables.

Post edited by: nant, at: 2006/11/13 08:33
Nick A.
CB Core Team Member
Support CB Development and Get Detailed Documentation
Developer of Nant's Gallery plugin
CB Gallery Extensions Listing, Rate CB Gallery on Extensions Site
Developer of CB AutoWelcome Plugin
CB AutoWelcome Extensions Listing,Rate CB AutoWelcome on Extensions Site
People ignoring your call for help? Read this!
FAQ you
Joomlapolis Extensions Directory (new)- check it out!
Click here to see the profile of this user The administrator has disabled public write access.

Re:CB Helloworld Plugin (part 2)
Date: 2006/11/14 18:02 By: kmchen Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 12
graphgraph
Hi

Your help let me go nearly ending a reservation module for video-games based on jmoovies and it starts to look pretty good. Thanks again.

Now I'd like to have an icon in my edit reservation tab with a link that would end to my reservation plugin whitch would increment or decrement a field.

The best would be to place the icon near the interested field in the reservation tab but it looks difficult looking the architecture of the plugin system.

An other choice would be to have the icons in the tab's toolbar but I don' see to do it without patching CB's code. No need of plugins system for that.

Last choice I see is to publish the icons through the function getEditTab with href pointing directly on my plugin code. I did not choose that cause it's a little ugly and won't permit me to place the icons near the fields I want.

Any suggest ?
Click here to see the profile of this user The administrator has disabled public write access.

Re:CB Helloworld Plugin (part 2)
Date: 2006/11/14 20:53 By: nant Status: Admin  
Karma: 462  
Admin

Posts: 5978
graph
kmchen wrote:
Hi

Your help let me go nearly ending a reservation module for video-games based on jmoovies and it starts to look pretty good. Thanks again.

Now I'd like to have an icon in my edit reservation tab with a link that would end to my reservation plugin whitch would increment or decrement a field.

The best would be to place the icon near the interested field in the reservation tab but it looks difficult looking the architecture of the plugin system.

An other choice would be to have the icons in the tab's toolbar but I don' see to do it without patching CB's code. No need of plugins system for that.

Last choice I see is to publish the icons through the function getEditTab with href pointing directly on my plugin code. I did not choose that cause it's a little ugly and won't permit me to place the icons near the fields I want.

Any suggest ?


You can do all of this in your plugin code without hacking code. This is outside of the scope of the helloworld article.
Study the CB Gallery plugin and see the field handling portion. Not easy for beginers...
Nick A.
CB Core Team Member
Support CB Development and Get Detailed Documentation
Developer of Nant's Gallery plugin
CB Gallery Extensions Listing, Rate CB Gallery on Extensions Site
Developer of CB AutoWelcome Plugin
CB AutoWelcome Extensions Listing,Rate CB AutoWelcome on Extensions Site
People ignoring your call for help? Read this!
FAQ you
Joomlapolis Extensions Directory (new)- check it out!
Click here to see the profile of this user The administrator has disabled public write access.

Re:CB Helloworld Plugin (part 2)
Date: 2006/11/15 11:57 By: kmchen Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 12
graphgraph
Well I installed nant's cb gallery and I actually see some icons with links (delet, publish and revoke) that necessary go back to the plugin but when I open the getDisplayTab script I see this:

function getDisplayTab($tab,$user,$ui) {
global $my,$mainframe,$mosConfig_lang;

$this->_getLanguageFile();
$tabparams=$this->_pgGetTabParameters($user);

$htmltext1 = "";
if (!$tabparams["pgmanagementtabenabled"]) return $htmltext1;
// Is user a moderator?
$isModerator=isModerator($my->id);
if (!$isModerator) return $htmltext1;
if($tab->description != null) {
$htmltext1 .= "tt<div class="tab_Description">";
$htmltext1 .= unHtmlspecialchars(getLangDefinition($tab->description));
$htmltext1 .= "</div>n";
$htmltext1 .= "<br />n";
$htmltext1 .= "Feature not available yetn";
$htmltext1 .= "<br />n";
}
return $htmltext1;

Where are icons handling ?
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 1 2 3 4 5 6 7 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login