Calendar control?

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
idan sharon
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Mar 15, 2007 5:19 pm
Location: Israel

Calendar control?

Post by idan sharon » Tue Sep 04, 2007 11:51 am

Hi All,

I want to add a calendar control to my component, just like the one that is used in the "Add new content item" In J!1.5

Can someone point me in the right way?

Thanks,
Idan.

User avatar
ianmac
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 237
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Calendar control?

Post by ianmac » Tue Sep 04, 2007 7:38 pm

Take a look at the JParameter class and the JElementCalendar class.  This is probably the easiest way to do it (the easiest way I've found).

Ian
Help test my Component XML Generator Tool!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!

idan sharon
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Mar 15, 2007 5:19 pm
Location: Israel

Re: Calendar control?

Post by idan sharon » Wed Sep 05, 2007 8:29 am

Hi Ian,
I've found the JParameter class in the reference wiki, but the JElementCalendar doesn't exist there...
Can I get a link?
Is this the way it's done in the "Insert new content item" page in the administration?

Thanks again,
Idan.

User avatar
ianmac
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 237
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Calendar control?

Post by ianmac » Wed Sep 05, 2007 1:22 pm

Indeed you are right...  that class must have been created after I created the docs for the Parameter package.

It is still the same idea as the other ones.  If you look in the com_content admin directory, you will see a article.xml file in the models directory.  These is the parameters for articles.

So, you create a JParameter object something like:
$params = new JParameter( $row->params, JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'example.xml' );

And then: echo $params->render();

Ian
Help test my Component XML Generator Tool!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!


Post Reply