1
irmtfan
help needed to add hegira calendar in xoops
  • 2006/11/23 6:40

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


i barely know about js code.
i try to add this hegira calendar in XOOPS but i failed.
http://hoomb.dnsalias.com
the sample html page works fine:
le="color: #000000"><?php <HTML> <HEAD> <TITLE>Persian Calendar Test</TITLE> </HEAD> <Script Language="JavaScript" Src="dateScript.js"></Script> <Script Language="JavaScript" Src="persianPopupCalendar.js"></Script> <BODY> <Form Name="myForm" Method="Post" Action=""> <input type="text" name="myFirstDate" size="30" Value=""> <a href="javascript:void(0)" onclick="showCal('calFirstDate'); return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="calbtn.gif" border="0" alt="Select Date"></a> <br> <input type="text" name="mySecondDate" size="30" Value=""> <a href="javascript:void(0)" onclick="showCal('calSecondDate'); return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="calbtn.gif" border="0" alt="Select Date"></a> </Form> <Script Language="JavaScript"> addCalendar("calFirstDate", "Select Date", "myFirstDate", "myForm"); addCalendar("calSecondDate", "Select Date", "mySecondDate", "myForm"); </Script> </BODY> </HTML>


but i dont know how to implement this in xoops.

in XOOPS 2.2 i think i find the correct line in this file:
class/xoopsform/formcalendar.php

line 119:
le="color: #000000"><?php $code = ( '<script type="text/javascript">Calendar.setup({' . $js_options . '});</script>' );

and i try to edit it like this but its not work:
le="color: #000000"><?php $code = ( ' <Script Language="JavaScript" Src="dateScript.js"></Script> <Script Language="JavaScript" Src="persianPopupCalendar.js"></Script> <script type="text/javascript">addCalendar({' . $js_options . '});</script>' );

i think there is an issue in $js_options

in XOOPS 2.0 i still dont know how and where to add.

any help/suggestion would be really appreciated.this is very needed for all Persian community

just follow me in a correct way if im totally wrong in this

2
m0nty
Re: help needed to add hegira calendar in xoops
  • 2006/11/23 7:04

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


i think but not certain.

Quote:

<Script Language="JavaScript" Src="dateScript.js"></Script>
<Script Language="JavaScript" Src="persianPopupCalendar.js"></Script>


needs to be place in the <head> tag of theme.html

then in the block/template you would have >

Quote:

<Form Name="myForm" Method="Post" Action="">

<input type="text" name="myFirstDate" size="30" Value="">
<a href="javascript:void(0)" onclick="showCal('calFirstDate'); return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="calbtn.gif" border="0" alt="Select Date"></a>

<br>

<input type="text" name="mySecondDate" size="30" Value="">
<a href="javascript:void(0)" onclick="showCal('calSecondDate'); return false;" HIDEFOCUS><img name="popcal" align="absmiddle" src="calbtn.gif" border="0" alt="Select Date"></a>

</Form>

<Script Language="JavaScript">
addCalendar("calFirstDate", "Select Date", "myFirstDate", "myForm");
addCalendar("calSecondDate", "Select Date", "mySecondDate", "myForm");
</Script>


replace (tammairanslip) with java script: (remove the space)

3
irmtfan
Re: help needed to add hegira calendar in xoops
  • 2006/11/23 7:09

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


yes but for example i want to add that to "news" module in submit.php and news module using the xoopsform and i cant put the code in any templates.

also i want a way to add that in XOOPS core and use it for any module

4
m0nty
Re: help needed to add hegira calendar in xoops
  • 2006/11/23 7:33

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


actually i think looking at it, i don't think it's that easy..

le="color: #000000"><?php $code = ( ' <Script Language="JavaScript" Src="dateScript.js"></Script> <Script Language="JavaScript" Src="persianPopupCalendar.js"></Script> <script type="text/javascript">addCalendar({' . $js_options . '});</script>' );


function addcalendar in persianPopupCalendar.js has options >

function addCalendar(name, title, field, form)

so you might need to make sure $js_options also uses those values.

they're defined in formcalendar.php

$js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));

which is where i got lost, so you'll definitely have to wait for someone with more knowledge than me that's for sure.. sorry i can't be of more help.

5
irmtfan
Re: help needed to add hegira calendar in xoops
  • 2006/11/23 20:17

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


m0nty you are so kind there is nothing for sorry
i still work on this but its so hard and far from my abilities.
anyone can help?

Who's Online

225 user(s) are online (174 user(s) are browsing Support Forums)


Members: 0


Guests: 225


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits