How to make a module from a .php of a component form - Joomla! Forum - community, help and support
hi all,
i'm newbie in php, , trying built module js jobs component display 2 of research field in form instead of all.
the orginal source code in file /tmpl/jobsearch.php (that i've copy paste module .php file) below. i've gotmy variables not set in new php file (quicksearchjobs.php).
many in advance,
sphere369
i'm newbie in php, , trying built module js jobs component display 2 of research field in form instead of all.
the orginal source code in file /tmpl/jobsearch.php (that i've copy paste module .php file) below. i've gotmy variables not set in new php file (quicksearchjobs.php).
many in advance,
sphere369
code: select all
<?php
$option = jrequest :: getvar('option', 'com_jsjobs');
defined('_jexec') or die('restricted access');
jimport('joomla.html.pane');
$editor = & jfactory :: geteditor();
jhtml :: _('behavior.calendar');
global $mainframe;
$document = &jfactory::getdocument();
$width_big = 40;
$width_med = 25;
$width_sml = 15;
?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $mainframe->getbasepath(); ?>components/com_jsjobs/css/<?php echo $this->config['theme']; ?>" />
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr><td>
<?php
if (sizeof($this->joblinks) != 0){
foreach($this->joblinks $lnk) { ?>
<?php echo $lnk; ?>
<?php }
} ?>
</td>
</tr>
<tr><td height="1">
</td>
</tr>
<tr><td> <!--liens pour les recherches par categorie, recherche d'offre d'emploi, ma selection d'offre, curriculum vitae/profil personnel -->
<?php
if (sizeof($this->emplinks) != 0){
foreach($this->emplinks $lnk) { ?>
<?php echo $lnk; ?>
<?php }
}?>
</td>
</tr>
</table>
<!--<form action="index.php" method="post" name="adminform" enctype="multipart/form-data">-->
<form action="index.php?option=com_jsjobs&c=jsjobs&view=resume&layout=jobsearchresults&itemid=<?php echo $this->itemid; ?>" method="post" name="adminform" id="adminform">
<input type="hidden" name="isjobsearch" value="1" />
<table cellpadding="5" cellspacing="0" border="0" width="100%" class="adminform">
<tr>
<td width="20%" align="right"><?php echo jtext::_('mot cles'); ?></td> <!-- "titre de l'offre d'emploi:" -->
<td width="60%"><input class="inputbox" type="text" name="title" size="40" maxlength="50" /> <!-- champs mot cles pour l'offre d'emploi -->
</td>
<td align="right"><?php echo jtext::_('jp_city'); ?></td> <!-- "pays" -->
<td id="city">
<input class="inputbox" type="text" name="city" size="20" maxlength="30" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" class="button" name="submit_app" onclick="document.adminform.submit();" value="<?php echo jtext::_('rechercher'); ?>" />
</td>
</tr>
</table>
<input type="hidden" name="view" value="resume" />
<input type="hidden" name="layout" value="jobsearchresults" />
<input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task11" value="view" />
</form>
<script language=javascript>
function dochange(src, val){
var xhr;
try { xhr = new activexobject('msxml2.xmlhttp'); }
catch (e)
{
try { xhr = new activexobject('microsoft.xmlhttp'); }
catch (e2)
{
try { xhr = new xmlhttprequest(); }
catch (e3) { xhr = false; }
}
}
xhr.onreadystatechange = function(){
if(xhr.readystate == 4 && xhr.status == 200){
document.getelementbyid(src).innerhtml=xhr.responsetext; //retuen value
if(src=='state'){
countyhtml = "<input class='inputbox' type='text' name='county' size='40' maxlength='100' />";
cityhtml = "<input class='inputbox' type='text' name='city' size='40' maxlength='100' />";
document.getelementbyid('county').innerhtml=countyhtml; //retuen value
document.getelementbyid('city').innerhtml=cityhtml; //return value
}else if(src=='county'){
cityhtml = "<input class='inputbox' type='text' name='city' size='40' maxlength='100' />";
document.getelementbyid('city').innerhtml=cityhtml; //return value
}
}
}
xhr.open("get","index2.php?option=com_jsjobs&task=listsearchaddressdata&data="+src+"&val="+val,true);
xhr.send(null);
}
window.onload=dochange('country', -1); // value in first dropdown
</script>
</form>
the object $this cannot used in same way, need change that.
olaf
olaf
Comments
Post a Comment