function showChronoContact($rows, $pageNav, $option) { global $mainframe; $database =& JFactory::getDBO(); $query = "SELECT * FROM `#__components` WHERE `option` = 'com_chronocontact' AND parent='0' AND admin_menu_link='option=com_chronocontact'"; $database->setQuery($query); $result = $database->loadObject(); $configs = new JParameter($result->params); $showtipday = $configs->get('showtipoftheday', 1); if ($showtipday) { HTML_ChronoContact::showTipOfDay(); } HTML_ChronoContact::showLicenseStatus(); ?> <?php echo JHTML::_('behavior.tooltip'); ?> <script type="text/javascript"> function changetable(name){ document.getElementById('table').value = name; } </script> <form action="index2.php?option=com_chronocontact" method="post" name="adminForm"> <table class="adminlist"><tr><td width="130px" valign="top"> <table cellpadding="0" cellspacing="0" border="0" width="130px"> <tr> <td width="130px" valign="top"> <strong>Plugins</strong> </td> </tr> <tr> <td width="130px" valign="top"> <table width="130px" cellpadding="0" cellspacing="0"> <tbody> <?php $tooltips = "window.addEvent('domready', function() {"; $document =& JFactory::getDocument(); $directory = JPATH_SITE . '/components/com_chronocontact/plugins/'; $results = array(); $handler = opendir($directory); while ($file = readdir($handler)) { if ($file != '.' && $file != '..' && substr($file, -4) == '.php' && substr($file, 0, 3) == 'cf_') { $results[] = str_replace(".php", "", $file); } } closedir($handler); sort($results); foreach ($results as $result) { require_once JPATH_SITE . "/components/com_chronocontact/plugins/" . $result . ".php"; ${$result} = new $result(); ?> <tr><td> <a title="<?php echo ${$result}->result_TITLE; ?> :: <?php echo ${$result}->result_TOOLTIP; ?> " id="<?php echo ${$result}->plugin_name; ?> " style="display:block; " href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('Please make a selection from the list to <?php echo ${$result}->result_TITLE; ?> ');}else{submitbutton('<?php echo 'plugin_' . $result; ?> ')}"> <?php echo ${$result}->result_TITLE; ?> </a> </td></tr> <?php $tooltips .= "var Tip" . ${$result}->plugin_name . " = new Tips(\$('" . ${$result}->plugin_name . "'));"; } $tooltips .= "});"; $document->addScriptDeclaration($tooltips); ?> </tbody> </table> </td> </tr> </table> </td><td valign="top"> <table class="adminheading"> <tr> <th>Chrono Forms - Forms Manager</th> </tr> </table> <table class="adminlist"> <tr> <th width="20" class='title'>#</th> <th width="5%" class='title'>Form ID</th> <th width="20" class='title'><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?> );" /></th> <th width="20%" align="left" class='title'>Name</th> <th width="60%" align="left" class='title'>Link</th> <th width="20%" align="center" class='title'> <?php echo JHTML::_('tooltip', "To Enable Emails you need to :<br>1# Set Email Results to Yes in the General Tab<br>2# Set Enabled to Yes at every email area from the Email properties"); ?> Emails</th> <th width="20%" align="center" class='title'>Tables Connected</th> <th width="5%" align="right" class='title'>Publish</th> </tr> <?php $k = 0; for ($i = 0, $n = count($rows); $i < $n; $i++) { $row = $rows[$i]; $link = 'index2.php?option=com_chronocontact&task=editA&hidemainmenu=1&id=' . $row->id; ?> <tr class="<?php echo "row{$k}"; ?> "> <td width="20" align="center"><?php echo $i + $pageNav->limitstart + 1; ?> </td> <td width="20" align="center"><?php echo $row->id; ?> </td> <td width="20"><input type="checkbox" id="cb<?php echo $i; ?> " name="cid[]" value="<?php echo $row->id; ?> " onclick="isChecked(this.checked);" /></td> <td width="20%" align="left" ><a href="#edit" onclick="return listItemTask('cb<?php echo $i; ?> ','edit')"><?php echo $row->name; ?> </a></td> <td width="60%" align="left" ><a target="_blank" href="<?php echo $mainframe->getSiteURL(); ?> index.php?option=com_chronocontact&chronoformname=<?php echo $row->name; ?> ">index.php?option=com_chronocontact&chronoformname=<?php echo $row->name; ?> </a></td> <?php $database =& JFactory::getDBO(); $query = "SELECT * FROM #__chrono_contact_emails WHERE formid = '" . $row->id . "' ORDER BY emailid"; $database->setQuery($query); $emails = $database->loadObjectList(); $emails_enabled = 0; $emails_disabled = 0; if (!$row->emailresults) { $emails_enabled = '0'; $emails_disabled = count($emails); } else { foreach ($emails as $email) { $emailparams = new JParameter($email->params); if (trim($emailparams->get('enabled') == '1')) { $emails_enabled++; } else { $emails_disabled++; } } } ?> <td width="20%" align="center" ><a href="#edit" onclick="return listItemTask('cb<?php echo $i; ?> ','edit')">Enabled:<?php echo $emails_enabled; ?> <br>Disabled:<?php echo $emails_disabled; ?> </a> </td> <?php $paramsvalues = new JParameter($row->paramsall); if ($paramsvalues->get('tablenames')) { $tables = explode(",", $paramsvalues->get('tablenames')); } else { $tables = array(); } ?> <td width="20%" align="center" > <?php foreach ($tables as $table) { ?> <a href="index.php?option=com_chronocontact&table=<?php echo $table; ?> #show" onclick="changetable('<?php echo $table; ?> '); return listItemTask('cb<?php echo $i; ?> ','show')"><?php echo $table; ?> </a><br> <?php } ?> </td> <?php if ($row->published) { ?> <td width="5%" align="center" ><a href="#unpublish" onclick="return listItemTask('cb<?php echo $i; ?> ','unpublish')"><img border="0" alt="Published" src="images/tick.png"/></a></td> <?php } else { ?> <td width="5%" align="center" ><a href="#publish" onclick="return listItemTask('cb<?php echo $i; ?> ','publish')"><img border="0" alt="Unpublished" src="images/publish_x.png"/></a></td> <?php } ?> </tr> <?php $k = 1 - $k; } ?> <tr><td colspan="8" style="white-space:nowrap; " height="20px"><?php echo $pageNav->getListFooter(); ?> </td></tr> </table> </td></tr></table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="table" id="table" value="" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="hidemainmenu" value="0"> </form> <?php }