function display($tpl = null) { $text_name = $this->param1; // param1 is the text name, 'top_text' or 'bottom_text' if ($text_name == 'top_text') { FCP_Admin::make_title('COM_FLEXICONTACT_V_TOP_TEXT', $this->config_data, $this->config_count); } else { FCP_Admin::make_title('COM_FLEXICONTACT_V_BOTTOM_TEXT', $this->config_data, $this->config_count); } JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // setup the wysiwg editor $editor = JFactory::getEditor(); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_text" /> <input type="hidden" name="param1" value="<?php echo $text_name; ?> " /> <?php echo $editor->display($text_name, htmlspecialchars($this->config_data->config_data->{$text_name}, ENT_QUOTES), '700', '350', '60', '20', array('pagebreak', 'readmore')); ?> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_IMPORT_TITLE'); JToolBarHelper::cancel(); // show the import screen ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="controller" value="log" /> <?php // show the information about the rows that will be imported echo '<h3>' . JText::sprintf('COM_FLEXICONTACT_IMPORT_ROWS', $this->free_log_info->count, $this->free_log_info->date_from, $this->free_log_info->date_to) . '</h3>'; // if there are already imported rows in the FlexiContactPlus log, they will be deleted if ($this->count_imported_rows > 0) { echo '<h3 style="color:red">' . JText::sprintf('COM_FLEXICONTACT_IMPORT_WARNING', $this->count_imported_rows) . '</h3>'; } // display the import button echo '<input type="submit" name="submit1" class="big_red_button" value="' . JText::_('COM_FLEXICONTACT_IMPORT') . '" onclick="this.form.task.value=' . "'import_confirmed'" . ';this.form.submit();" />'; echo '</form>'; }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_CONFIRM_NAME', $this->config_data, $this->config_count); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // setup the key panel $keypanel = FCP_Admin::make_key_panel($this->config_data->config_data); // setup the wysiwg editor $editor = JFactory::getEditor(); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_confirm" /> <?php echo "\n" . '<table><tr><td valign="top">' . "\n<table><tr><td>"; echo JText::_('COM_FLEXICONTACT_LINK'); echo '</td><td><input type="text" size="60" name="confirm_link" value="' . $this->config_data->config_data->confirm_link . '" /> '; echo FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_CONFIRM_LINK_DESC')); echo "</td></tr>\n<tr>"; echo '<td valign="top">' . JText::_('COM_FLEXICONTACT_TEXT'); echo '</td><td valign="top">' . $editor->display('confirm_text', htmlspecialchars($this->config_data->config_data->confirm_text, ENT_QUOTES), '700', '350', '60', '20', array('pagebreak', 'readmore')); echo "\n" . '</td></tr></table></td><td valign="top">'; echo $keypanel; echo "\n" . '</td></tr></table>'; ?> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_LOG'); JToolBarHelper::cancel('display'); // get the filter states $app = JFactory::getApplication(); $filter_date = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_date', 'filter_date', LAFC_LOG_ALL, 'int'); // make the filter lists $date_filters = array(LAFC_LOG_ALL => JText::_('COM_FLEXICONTACT_LOG_ALL'), LAFC_LOG_LAST_12_MONTHS => JText::_('COM_FLEXICONTACT_LOG_LAST_12_MONTHS')); $lists['date'] = FCP_Common::make_list('filter_date', $filter_date, $date_filters, 0, 'onchange="submitform( );"'); // show the chart ?> <form action="index.php" method="get" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="task" value="stats" /> <input type="hidden" name="controller" value="log" /> <table> <tr> <td align="left" width="100%"> <?php echo '<strong>' . $this->title . '</strong>'; ?> </td> <td nowrap="nowrap"> <?php echo $lists['date']; echo ' '; echo '<button class="fcp_button" onclick="' . "\n\t\t\t\t\tthis.form.getElementById('filter_date').value='" . LAFC_LOG_ALL . "';\n\t\t\t\t\tthis.form.submit();" . '">' . JText::_('COM_FLEXICONTACT_RESET') . '</button>'; ?> </td> </tr> </table> </form> <?php if (strpos($this->data, 'script type')) { $document = JFactory::getDocument(); $document->addScript("https://www.google.com/jsapi"); // load the Google jsapi $document->addCustomTag($this->data); // load the chart script echo '<div id="chart_1"></div>'; // create an element for the chart to be drawn in } else { echo $this->data; } echo '<h3>' . JText::sprintf('COM_FLEXICONTACT_LOG_ROWS', $this->num_rows) . '</h3>'; ?> <div align="right"><?php echo JText::_('COM_FLEXICONTACT_POWERED_BY') . ' ' . JHTML::link(PLOTALOT_LINK, "Plotalot", 'target="_blank"'); ?> </div> <?php }
function import() { FCP_Admin::addSubMenu('log'); $import_model = $this->getModel('import'); $free_log_info = $import_model->free_log_info(); $count_imported_rows = $import_model->count_imported_rows(); $view = $this->getView('log_import', 'html'); $view->free_log_info = $free_log_info; $view->count_imported_rows = $count_imported_rows; $view->display(); }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_LOG'); JToolBarHelper::cancel(); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="log" /> <input type="hidden" name="task" value="cancel" /> </form> <?php echo '<table class="fc_table">'; echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_DATE_TIME') . '</strong></td><td>' . $this->log_data->datetime . '</td></tr>'; // config_name and config_lang was only added to the log at version 7.03 so older logs have it blank - better not to show it if ($this->log_data->config_name != '') { echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_CONFIG_NAME') . '</strong></td><td>' . $this->log_data->config_name . '</td></tr>'; } if ($this->log_data->config_lang != '') { echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_LANGUAGE') . '</strong></td><td>' . $this->log_data->config_lang . '</td></tr>'; } echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_NAME') . '</strong></td><td>' . $this->log_data->name . '</td></tr>'; echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_EMAIL') . '</strong></td>'; if ($this->log_data->email != '') { $email_link = 'mailto:' . $this->log_data->email . '?Subject=' . $this->log_data->subject; echo '<td>' . JHTML::link($email_link, $this->log_data->email, 'target="_blank"') . '</td></tr>'; } else { echo '<td>' . $this->log_data->email . '</td></tr>'; } echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_SUBJECT') . '</strong></td><td>' . $this->log_data->subject . '</td></tr>'; // the main message echo "\n" . '<tr><td class="prompt" valign="top"><strong>' . JText::_('COM_FLEXICONTACT_OTHER_DATA') . '</strong></td>'; $message = nl2br($this->log_data->message); if (substr($message, 0, 6) == '<br />') { $message = substr($message, 6); } echo "\n" . '<td style="white-space: normal;">' . $message . '</td></tr>'; // admin_email was only added to the log at version 7.02 so older logs have it blank - better not to show it if ($this->log_data->admin_email != '') { echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_V_EMAIL_TO') . '</strong></td><td>' . $this->log_data->admin_email . '</td></tr>'; } echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_IP_ADDRESS') . '</strong></td><td>' . $this->log_data->ip . '</td></tr>'; echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_BROWSER') . '</strong></td><td>' . $this->log_data->browser_string . '</td></tr>'; echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_STATUS') . '</strong></td><td>' . $this->_status($this->log_data->status_main) . '</td></tr>'; echo "\n" . '<tr><td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_STATUS_COPY') . '</strong></td><td>' . $this->_status($this->log_data->status_copy) . '</td></tr>'; if ($this->log_data->imported) { echo "\n" . '<tr><td colspan="2">' . JText::_('COM_FLEXICONTACT_IMPORTED') . '</td><td></td></tr>'; } echo '</table>'; }
function display($tpl = null) { $template_name = $this->param1; // param1 is the template name, 'user_template' or 'admin_template' if ($template_name == 'user_template') { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_USER_EMAIL_NAME', $this->config_data, $this->config_count); } else { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_ADMIN_EMAIL_NAME', $this->config_data, $this->config_count); } JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // setup the key panel $keypanel = FCP_Admin::make_key_panel($this->config_data->config_data); // setup the wysiwg editor $editor = JFactory::getEditor(); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_template" /> <input type="hidden" name="param1" value="<?php echo $template_name; ?> " /> <?php echo "\n" . '<table><tr><td valign="top">'; echo "\n" . $editor->display($template_name, htmlspecialchars($this->config_data->config_data->{$template_name}, ENT_QUOTES), '700', '350', '60', '20', array('pagebreak', 'readmore', 'article', 'image')); echo "\n" . '</td><td valign="top">'; echo $keypanel; echo "\n" . '</td></tr></table>'; ?> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_TOOLBAR_HELP'); // we need a form for the trace controls ?> <form action="index.php" method="get" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="com_flexicontactplus" /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="help" /> </form> <?php // build the help screen $help['name'] = LAFC_COMPONENT_NAME; $help['prefix'] = 'COM_FLEXICONTACT'; $help['current_version'] = FCP_trace::getComponentVersion(); $help['reference'] = 'flexicontactplus'; $help['link_version'] = "http://www.lesarbresdesign.info/version-history/flexicontactplus"; $help['link_doc'] = "http://www.lesarbresdesign.info/extensions/flexicontactplus"; $help['link_rating'] = "http://extensions.joomla.org/extensions/contacts-and-feedback/contact-forms/20045"; $this->draw_help($help); echo '<p></p>'; echo FCP_trace::make_trace_controls('menu'); }
function display($tpl = null) { if ($this->new_flag == 1) { FCP_Admin::make_title('COM_FLEXICONTACT_NEW_CONFIG'); } else { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_EDIT', $this->config_data, $this->config_count); } JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); $langs = FCP_Admin::make_lang_list(); $cur_lang = JFactory::getLanguage(); $lang_text = JText::_('JFIELD_LANGUAGE_LABEL'); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="multiconfig" /> <input type="hidden" name="task" value="add" /> <input type="hidden" name="view" value="config_edit" /> <input type="hidden" name="new_flag" value="<?php echo $this->new_flag; ?> " /> <input type="hidden" name="copy_flag" value="<?php echo $this->copy_flag; ?> " /> <table class="fc_table"> <?php // if we are creating a new configuration, show the "base" config selector if ($this->new_flag == 1 and $this->copy_flag == 0) { echo '<tr><td class="prompt">' . JText::_('COM_FLEXICONTACT_BASE_CONFIG') . '</td>'; if ($this->config_count > 1) { $config_list = FCP_Common::make_list('config_id', $this->config_data->id, $this->config_names); $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_BASE_CONFIG_DESC')); echo '<td>' . $config_list . ' ' . $info . '</td></tr>'; } else { echo '<input type="hidden" name="config_id" value="0" />'; echo '<td>' . JText::_('COM_FLEXICONTACT_DEFAULT') . '</td></tr>'; } echo '<tr><td colspan="2"><h3>' . JText::_('COM_FLEXICONTACT_NEW_CONFIG') . '</h3></td></tr>'; } else { echo '<input type="hidden" name="config_id" value="' . $this->config_data->id . '" />'; } // edit mode // the new configuration name echo '<tr><td class="prompt">' . JText::_('COM_FLEXICONTACT_CONFIG_NAME') . '</td>'; if ($this->copy_flag == 1) { echo '<input type="hidden" name="name" value="' . $this->config_data->name . '" />'; echo '<td>' . $this->config_data->name . '</td></tr>'; } else { echo '<td><input type="text" size="40" name="name" value = "' . $this->config_data->name . '" /></td></tr>'; } // the new configuration language echo '<tr><td class="prompt">' . $lang_text . '</td>'; if (count($langs) > 1) { $lang_list = FCP_Common::make_list('config_lang', $this->config_data->language, $langs); echo '<td>' . $lang_list . '</td></tr>'; } else { echo '<input type="hidden" name="config_lang" value="' . $cur_lang->getTag() . '" />'; echo '<td>' . $cur_lang->getTag() . '</td></tr>'; } // a description for the new config echo '<tr><td class="prompt">' . JText::_('COM_FLEXICONTACT_CONFIG_DESC') . '</td>'; echo '<td><input type="text" size="120" name="description" value = "' . $this->config_data->description . '" /></td></tr>'; echo '</table>'; echo '</form>'; }
function apply() { $app = JFactory::getApplication(); $config_id = $app->getUserState(LAFC_COMPONENT . "_current_config", 0); $config_model = $this->getModel('config'); $config_model->getOneById($config_id); $config_count = $config_model->countConfig(); $config_model->getPostData('config_field'); // get the field data from the post data if ($config_model->store('config_field')) { $jinput = JFactory::getApplication()->input; $task = $jinput->get('task', '', 'STRING'); // 'save_field' or 'apply_field' // Check White List if field = file attachment! if (empty($config_model->_data->config_data->white_list) and $config_model->_data->config_data->all_fields[$config_model->_data->field_index]->field_type == LAFC_FIELD_ATTACHMENT) { $app->enqueueMessage(JText::_('COM_FLEXICONTACT_NO_WHITE_LIST'), 'notice'); } if ($task == 'apply') { $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=field&task=edit&cid[]=" . $config_model->_data->field_index); } else { $this->setRedirect(LAFC_COMPONENT_LINK . "&controller=field&task=display"); } } else { FCP_Admin::addSubMenu('config'); $view = $this->getView('config_field', 'html'); $view->config_data = $config_model->_data; $view->config_count = $config_count; $view->new_flag = $config_model->_data->new_flag; $view->field = $config_model->_data->config_data->all_fields[$config_model->_data->field_index]; $view->field_index = $config_model->_data->field_index; $view->display(); } }
function check($view) { $ret = true; switch ($view) { case 'config_confirm': if ($this->_data->config_data->confirm_link == '' and $this->_data->config_data->confirm_text == '') { $msg = JText::_('COM_FLEXICONTACT_ALL_BLANK'); $this->_app->enqueueMessage($msg, 'error'); return false; } break; // case 'config_confirm' // case 'config_confirm' case 'config_text': if (stristr($this->_data->config_data->top_text, "{flexicontactplus") != false) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' - {flexicontactplus...}'; $this->_app->enqueueMessage($msg, 'error'); return false; } if (stristr($this->_data->config_data->bottom_text, "{flexicontactplus") != false) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' - {flexicontactplus...}'; $this->_app->enqueueMessage($msg, 'error'); return false; } break; // case 'config_text' if ($this->_data->config_data->confirm_link == '' and $this->_data->config_data->confirm_text == '') { $msg = JText::_('COM_FLEXICONTACT_ALL_BLANK'); $this->_app->enqueueMessage($msg, 'error'); return false; } break; // case 'config_text' // case 'config_text' case 'config_edit': FCP_Common::strip_quotes($this->_data->name); if (!FCP_Common::clean_string($this->_data->name, false)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' (' . JText::_('COM_FLEXICONTACT_CONFIG_NAME') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } if (strstr($this->_data->name, ' ') != false) { $msg = JText::_('COM_FLEXICONTACT_NO_SPACE') . ' (' . JText::_('COM_FLEXICONTACT_CONFIG_NAME') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } if ($this->_exists($this->_data->name, $this->_data->language, $this->_data->id)) { $msg = JText::_('COM_FLEXICONTACT_CONFIG_DUP'); $this->_app->enqueueMessage($msg, 'error'); return false; } break; // case 'config_edit' // case 'config_edit' case 'config_general': $msg = JText::_('COM_FLEXICONTACT_INVALID'); if (!FCP_Common::clean_string($this->_data->config_data->send_text)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_SEND_TEXT') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->email_from)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_FIELD_FROM_ADDRESS') . ')'; $ret = false; } else { $check_msg = FCP_Admin::validate_email_address($this->_data->config_data->email_from, true); if ($check_msg != '') { $msg .= ' (' . JText::_('COM_FLEXICONTACT_FIELD_FROM_ADDRESS') . ' ' . $check_msg . ')'; $ret = false; } } if (!FCP_Common::clean_string($this->_data->config_data->email_to)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_TO') . ')'; $ret = false; } else { $check_msg = FCP_Admin::validate_email_address($this->_data->config_data->email_to, false); if ($check_msg != '') { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_TO') . ' ' . $check_msg . ')'; $ret = false; } } if (!FCP_Common::clean_string($this->_data->config_data->email_cc)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_CC') . ')'; $ret = false; } else { $check_msg = FCP_Admin::validate_email_list($this->_data->config_data->email_cc); if ($check_msg != '') { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_CC') . ' ' . $check_msg . ')'; $ret = false; } } if (!FCP_Common::clean_string($this->_data->config_data->email_bcc)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_BCC') . ')'; $ret = false; } else { $check_msg = FCP_Admin::validate_email_list($this->_data->config_data->email_bcc); if ($check_msg != '') { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_EMAIL_BCC') . ' ' . $check_msg . ')'; $ret = false; } } if (!FCP_Common::clean_string($this->_data->config_data->email_from_name)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_FIELD_FROM_NAME') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->agreement_prompt)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_AGREEMENT_REQUIRED') . ' ' . JText::_('COM_FLEXICONTACT_V_PROMPT') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->agreement_name)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_AGREEMENT_REQUIRED') . ' ' . JText::_('COM_FLEXICONTACT_NAME') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->white_list)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_ATTACHMENT_WHITE_LIST') . ' (' . $this->_data->config_data->white_list . ')'; $ret = false; } if (!FCP_Common::is_posint($this->_data->config_data->max_file_size) or $this->_data->config_data->max_file_size == 0) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_ATTACHMENT_MAX_SIZE') . ' (' . $this->_data->config_data->max_file_size . ')'; $ret = false; } $max_size = FCP_Admin::get_max_file_size(); if ($max_size > LAFC_MAX_FILE_SIZE) { // Maximum file size must be the lesser of our constant or PHP INI setting $max_size = LAFC_MAX_FILE_SIZE; } if ($this->_data->config_data->max_file_size > $max_size) { $msg .= ' (' . JText::sprintf('COM_FLEXICONTACT_MAX_SIZE_EXCEEDED', $max_size) . ' (' . $this->_data->config_data->max_file_size . ')'; $ret = false; } if (!$ret) { $this->_app->enqueueMessage($msg, 'error'); return false; } break; // case 'config_general' // case 'config_general' case 'config_captcha': $ret = true; $check_string = JText::_('COM_FLEXICONTACT_INVALID'); $msg = $check_string; if (!FCP_Common::clean_string($this->_data->config_data->magic_word)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_MAGIC_WORD') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->magic_word_prompt)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_MAGIC_WORD_LABEL') . ')'; $ret = false; } if ($this->_data->config_data->magic_word != '' and $this->_data->config_data->magic_word_prompt == '') { $this->_app->enqueueMessage(JText::_('COM_FLEXICONTACT_REQUIRED') . ' (' . JText::_('COM_FLEXICONTACT_MAGIC_WORD_LABEL') . ')', 'error'); $ret = false; } if (!FCP_Common::is_posint($this->_data->config_data->num_images)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_CAPTCHA_NUMBER') . ')'; $ret = false; } if (!FCP_Common::is_posint($this->_data->config_data->image_height, true)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_HEIGHT') . ')'; $ret = false; } elseif ($this->_data->config_data->image_height > 150) { $this->_data->config_data->image_height = 150; } if (!FCP_Common::is_posint($this->_data->config_data->image_width, true)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_V_WIDTH') . ')'; $ret = false; } elseif ($this->_data->config_data->image_width > 150) { $this->_data->config_data->image_width = 150; } if (!FCP_Common::is_posint($this->_data->config_data->captcha_height, true)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_SECURE_CAPTCHA') . ' ' . JText::_('COM_FLEXICONTACT_V_HEIGHT') . ')'; $ret = false; } if (!FCP_Common::is_posint($this->_data->config_data->captcha_width, true)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_SECURE_CAPTCHA') . ' ' . JText::_('COM_FLEXICONTACT_V_WIDTH') . ')'; $ret = false; } if (!FCP_Common::clean_string($this->_data->config_data->secure_captcha_prompt)) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_SECURE_CAPTCHA_LABEL') . ')'; $ret = false; } if ($this->_data->config_data->recaptcha_theme != 0) { if (strlen($this->_data->config_data->recaptcha_public_key) != 40) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_RECAPTCHA') . ' ' . JText::_('COM_FLEXICONTACT_RECAPTCHA_PUBLIC_KEY') . ')'; $ret = false; } if (strlen($this->_data->config_data->recaptcha_private_key) != 40) { $msg .= ' (' . JText::_('COM_FLEXICONTACT_RECAPTCHA') . ' ' . JText::_('COM_FLEXICONTACT_RECAPTCHA_PRIVATE_KEY') . ')'; $ret = false; } } if (!$ret) { if ($msg != $check_string) { $this->_app->enqueueMessage($msg, 'error'); } return false; } break; // case 'config_captcha' // case 'config_captcha' case 'config_field': $field =& $this->_data->config_data->all_fields[$this->_data->field_index]; if ($field->field_type == LAFC_FIELD_CHECKBOX_H) { $msg = JText::sprintf('COM_FLEXICONTACT_FIELD_TYPE_DEPRECATED', JText::_('COM_FLEXICONTACT_FIELD_CHECKBOX_M')); $this->_app->enqueueMessage($msg, 'error'); return false; } if ($field->field_type == LAFC_FIELD_NONE) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' (' . JText::_('COM_FLEXICONTACT_FIELD_TYPE') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } if (!FCP_Common::clean_string($field->prompt)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' (' . JText::_('COM_FLEXICONTACT_V_PROMPT') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } if (strlen($field->prompt) > LAFC_MAX_PROMPT_LENGTH) { $msg = JText::_('COM_FLEXICONTACT_MAX_LENGTH') . ' (' . JText::_('COM_FLEXICONTACT_V_PROMPT') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } if (!FCP_Common::clean_string($field->css_class)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' (' . JText::_('COM_FLEXICONTACT_CSS_CLASS') . ')'; $this->_app->enqueueMessage($msg, 'error'); return false; } // Default value does not need to be verified at all since this allows for default to be a POST data variable // If the subject contains a variable, then the subject MUST be invisible. if ($field->field_type == LAFC_FIELD_SUBJECT) { $num_vars = substr_count(strtoupper($field->default_value), "%V_"); $ret_title = true; // Visible? if ($num_vars > 0 and $field->visible == 1) { $ret_title = false; } if (!$ret_title) { $msg = JText::_('COM_FLEXICONTACT_PAGE_TITLE_ERROR'); $this->_app->enqueueMessage($msg, 'error'); return false; } } if ($field->field_type == LAFC_FIELD_SUBJECT or $field->field_type == LAFC_FIELD_FROM_NAME or $field->field_type == LAFC_FIELD_FROM_ADDRESS or $field->field_type == LAFC_FIELD_RECIPIENT) { $count = 0; foreach ($this->_data->config_data->all_fields as $one_field) { if ($one_field->field_type == $field->field_type) { $count++; } } if ($count > 1) { switch ($field->field_type) { case LAFC_FIELD_SUBJECT: $fieldname = JText::_('COM_FLEXICONTACT_FIELD_SUBJECT'); break; case LAFC_FIELD_FROM_NAME: $fieldname = JText::_('COM_FLEXICONTACT_FIELD_FROM_NAME'); break; case LAFC_FIELD_FROM_ADDRESS: $fieldname = JText::_('COM_FLEXICONTACT_FIELD_FROM_ADDRESS'); break; case LAFC_FIELD_RECIPIENT: $fieldname = JText::_('COM_FLEXICONTACT_FIELD_RECIPIENT'); break; default: $fieldname = ''; } $msg = JText::sprintf('COM_FLEXICONTACT_ONLY_ONE_FIELD', $fieldname); $this->_app->enqueueMessage($msg, 'error'); return false; } } if ($field->field_type == LAFC_FIELD_LIST) { if ($field->delimiter == '') { $field->delimiter = ','; } return true; } if ($field->field_type == LAFC_FIELD_RECIPIENT) { $list_array = FCP_Common::split_list($field->list_list, ';', $field->delimiter); foreach ($list_array['RAW'] as $raw_string) { if (substr_count($raw_string, ',') != 1) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ': ' . htmlentities($raw_string); $this->_app->enqueueMessage($msg, 'error'); return false; // must return here to avoid "Undefined offset" errors } } foreach ($list_array['LEFT'] as $recipient_name) { if (!FCP_Common::clean_string($recipient_name, false)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_NAME') . ': ' . $recipient_name; $this->_app->enqueueMessage($msg, 'error'); $ret = false; } } foreach ($list_array['RIGHT'] as $email_address) { $check_msg = FCP_Admin::validate_email_address($email_address, false); if ($check_msg != '') { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_EMAIL') . ': ' . htmlentities($email_address); $this->_app->enqueueMessage($msg, 'error'); $ret = false; } } if (!$ret) { return false; } } if ($field->field_type == LAFC_FIELD_RADIO_V or $field->field_type == LAFC_FIELD_RADIO_H) { if ($field->delimiter == '') { $field->delimiter = ','; } $list_array = FCP_Common::split_list($field->list_list, ';', $field->delimiter); foreach ($list_array['RAW'] as $raw_string) { if (substr_count($raw_string, $field->delimiter) > 1) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ': ' . htmlentities($raw_string); $this->_app->enqueueMessage($msg, 'error'); return false; // must return here to avoid "Undefined offset" errors } } foreach ($list_array['RIGHT'] as $description) { if (!FCP_Common::clean_string($description)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_TEXT') . ': ' . htmlentities($description); $this->_app->enqueueMessage($msg, 'error'); $ret = false; } } $num_buttons = count($list_array['LEFT']); if (!FCP_Common::is_posint($field->default_button) or $field->default_button > $num_buttons) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_DEFAULT_BUTTON') . ' (' . $field->default_button . ')'; $this->_app->enqueueMessage($msg, 'error'); $ret = false; } if (!$ret) { return false; } } if ($field->field_type == LAFC_FIELD_CHECKBOX_M) { if ($field->delimiter == '') { $field->delimiter = ','; } } if ($field->field_type == LAFC_FIELD_ADVANCED) { if (!empty($field->regex)) { if (@preg_match($field->regex, 'x') === false) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_REGEX'); $this->_app->enqueueMessage($msg, 'error'); return false; } } if (!empty($field->sql)) { $result = $this->ladb_loadResult($field->sql); if ($result === false) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_SQL_QUERY') . '<br />' . $this->ladb_error_text; $this->_app->enqueueMessage($msg, 'error'); return false; } if (!is_numeric($result)) { $msg = JText::_('COM_FLEXICONTACT_INVALID') . ' ' . JText::_('COM_FLEXICONTACT_SQL_QUERY') . '<br />' . JText::_('COM_FLEXICONTACT_SQL_NUMERIC'); $this->_app->enqueueMessage($msg, 'error'); return false; } } } // Visible property ONLY applies to the Subject field if ($field->field_type != LAFC_FIELD_SUBJECT) { $field->visible = 1; } if ($field->height < LAFC_FIELD_HEIGHT_MIN) { $field->height = LAFC_FIELD_HEIGHT_MIN; } if ($field->height > LAFC_FIELD_HEIGHT_MAX) { $field->height = LAFC_FIELD_HEIGHT_MAX; } // don't allow the tooltip field to include double quotes - change them to single quotes $field->tooltip = str_replace('"', "'", $field->tooltip); // don't allow the default_value field to include double quotes - change them to single quotes $field->default_value = str_replace('"', "'", $field->default_value); break; //case 'config_field' } return true; }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_GENERAL_NAME', $this->config_data, $this->config_count); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // setup the three pre-populate options $options = array(); $options['off'] = JText::_('COM_FLEXICONTACT_V_NO'); $options['username'] = JText::_('COM_FLEXICONTACT_V_AUTOFILL_USERNAME'); $options['name'] = JText::_('COM_FLEXICONTACT_NAME'); $autofill_list = FCP_Common::make_list('autofill', $this->config_data->config_data->autofill, $options, 0, 'style="margin-bottom:0"'); // setup the "copy me" options $copy_options = array(); $copy_options[LAFC_COPYME_NEVER] = JText::_('COM_FLEXICONTACT_COPYME_NEVER'); $copy_options[LAFC_COPYME_CHECKBOX] = JText::_('COM_FLEXICONTACT_COPYME_CHECKBOX'); $copy_options[LAFC_COPYME_ALWAYS] = JText::_('COM_FLEXICONTACT_COPYME_ALWAYS'); // setup the date format list $date_format_list = array(); $date_format_list[1] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT1'); $date_format_list[2] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT2'); $date_format_list[3] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT3'); $date_format_list[4] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT4'); $date_format_list[5] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT5'); $date_format_list[6] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT6'); $date_format_list[7] = JText::_('COM_FLEXICONTACT_DATE_FORMAT_OPT7'); // setup the days list $days_list = FCP_Common::makeDayNames(0); // setup the date picker list require_once LAFC_HELPER_PATH . '/date_pickers.php'; $date_picker_onchange = 'onchange="fcp_date_fields(this.value)"'; $date_picker_list = FCP_date_picker::date_picker_list(); // make the Javascript that hides and enables the date format and start day when the date picker is HTML5 // it is called by the 'domready' function and the 'onchange' function of the date picker list selector $js = "function fcp_date_fields(picker_type) {\n\t\tif (picker_type == '001')\n\t\t\t{\n\t\t\tdocument.getElementById('date_format').selectedIndex = 0;\n\t\t\tdocument.getElementById('date_format').disabled=true;\n\t\t\tdocument.getElementById('start_day').disabled=true;\n\t\t\tdocument.getElementById('start_day').selectedIndex = 1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tdocument.getElementById('date_format').disabled=false;\n\t\t\tdocument.getElementById('start_day').disabled=false;\n\t\t\t}}"; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); $dom_ready = "\nwindow.addEvent('domready', function() {fcp_date_fields(" . $this->config_data->config_data->date_picker . ");});\n"; $document->addScriptDeclaration($dom_ready); // setup the css files list $css_list = FCP_Admin::get_css_list(); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_general" /> <?php echo "\n" . '<table class="fc_table">'; // css files selector echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_CSS_FILE') . '</td>'; if ($css_list == false) { echo '<td>' . JText::_('COM_FLEXICONTACT_NO_CSS'); } else { echo '<td>' . FCP_Common::make_list('css_file', $this->config_data->config_data->css_file, $css_list, 0, 'style="margin-bottom:0"'); } echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_CSS_FILE_DESC')) . '</td>'; echo "\n</tr>"; // Send button text echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_SEND_TEXT') . '</td>'; echo '<td><input type="text" size="50" name="send_text" value="' . $this->config_data->config_data->send_text . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_SEND_TEXT_DESC')) . '</td>'; echo "\n</tr>"; // email From (name) echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_FIELD_FROM_NAME') . '</td>'; echo '<td><input type="text" size="50" name="email_from_name" value="' . $this->config_data->config_data->email_from_name . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_EMAIL_FROM_NAME_DESC')) . '</td>'; echo "\n</tr>"; // email From (address) echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_FIELD_FROM_ADDRESS') . '</td>'; echo '<td><input type="text" size="50" name="email_from" value="' . $this->config_data->config_data->email_from . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_EMAIL_FROM_ADDRESS_DESC')) . '</td>'; echo "\n</tr>"; // email To echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_EMAIL_TO') . '</td>'; echo '<td><input type="text" size="50" name="email_to" value="' . $this->config_data->config_data->email_to . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_EMAIL_TO_ADDRESS_DESC')) . '</td>'; echo "\n</tr>"; // email CC echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_EMAIL_CC') . '</td>'; echo '<td><input type="text" size="50" name="email_cc" value="' . $this->config_data->config_data->email_cc . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_EMAIL_DESC')) . '</td>'; echo "\n</tr>"; // email Bcc echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_EMAIL_BCC') . '</td>'; echo '<td><input type="text" size="50" name="email_bcc" value="' . $this->config_data->config_data->email_bcc . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_EMAIL_DESC')) . '</td>'; echo "\n</tr>"; echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; // Date picker echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_DATE_PICKER') . '</td>'; echo '<td>' . FCP_Common::make_list('date_picker', $this->config_data->config_data->date_picker, $date_picker_list, 0, 'style="margin-bottom:0"' . $date_picker_onchange) . '</td>'; echo "\n</tr>"; // Input date format echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_DATE_FORMAT') . '</td>'; echo '<td>' . FCP_Common::make_list('date_format', $this->config_data->config_data->date_format, $date_format_list, 0, 'style="margin-bottom:0"') . '</td>'; echo "\n</tr>"; // Start day of week echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_STARTDAY') . '</td>'; echo '<td>' . FCP_Common::make_list('start_day', $this->config_data->config_data->start_day, $days_list, 0, 'style="margin-bottom:0"') . '</td>'; echo "\n</tr>"; // logging echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_LOGGING') . '</td>'; echo '<td>' . FCP_Common::make_radio('logging', $this->config_data->config_data->logging) . '</td>'; echo "\n</tr>"; // send html, yes/no echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_HTML') . '</td>'; echo '<td>' . FCP_Common::make_radio('email_html', $this->config_data->config_data->email_html) . '</td>'; echo "\n</tr>"; // auto fill echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_AUTOFILL') . '</td>'; echo '<td>' . $autofill_list . ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_AUTOFILL_DESC')) . '</td>'; echo "\n</tr>"; // send a copy to the user choices echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_CONFIG_USER_EMAIL_NAME') . '</td>'; echo '<td colspan="3">' . FCP_Common::make_list('show_copy', $this->config_data->config_data->show_copy, $copy_options, 0, 'style="margin-bottom:0"') . '</td>'; echo "\n</tr>"; // agreement required echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_AGREEMENT_REQUIRED') . '<br />' . JText::_('COM_FLEXICONTACT_V_PROMPT') . '</td>'; echo '<td><input type="text" size="40" name="agreement_prompt" value="' . $this->config_data->config_data->agreement_prompt . '" /></td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_NAME') . '</td>'; echo '<td><input type="text" size="40" name="agreement_name" value="' . $this->config_data->config_data->agreement_name . '" /></td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_LINK') . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_AGREEMENT_REQUIRED_DESC')); echo '<td><input type="text" size="60" name="agreement_link" value="' . $this->config_data->config_data->agreement_link . '" /> ' . $info . '</td>'; echo "\n</tr>"; // white list for attachment field type echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; echo "\n" . "<tr>"; echo ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_ATTACHMENT_WHITE_LIST') . '</td>'; echo ' <td valign="top"><textarea rows="2" cols="50" name="white_list">' . $this->config_data->config_data->white_list . '</textarea>'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_ATTACHMENT_WHITE_LIST_DESC')) . '</td>'; // echo "\n".' <td valign="top">'.$info.'</td>'; echo "\n" . "</tr>"; // max file size for attachment field type echo "\n" . "<tr>"; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_ATTACHMENT_MAX_SIZE') . '</td>'; echo '<td><input type="text" size="50" name="max_file_size" value="' . $this->config_data->config_data->max_file_size . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_ATTACHMENT_MAX_SIZE_DESC')) . '</td>'; echo "\n" . "</tr>"; echo '</table></form>'; }
static function init_trace($config_model, $config_id) { self::delete_trace_file(); @file_put_contents(LAFC_TRACE_FILE_PATH, LAFC_UTF8_HEADER . date("d/m/y H:i") . ' Tracing Initialised' . "\n"); $locale = setlocale(LC_ALL, 0); $locale_string = print_r($locale, true); $langObj = JFactory::getLanguage(); $language = $langObj->get('tag'); $php_version = phpversion(); $app = JFactory::getApplication(); $session_lifetime = $app->getCfg('lifetime'); // session lifetime in seconds $live_site = $app->getCfg('live_site'); $caching = $app->getCfg('caching'); self::trace(LAFC_COMPONENT_NAME . ' version ' . self::getComponentVersion()); self::trace('FCP Plugin : ' . self::getPluginStatus()); self::trace("PHP version : " . $php_version); self::trace("PHP Locale : " . $locale_string); self::trace("Server : " . PHP_OS); self::trace("Joomla Version : " . JVERSION); self::trace("Joomla Language : " . $language); self::trace("Session Lifetime : " . $session_lifetime . ' minutes'); self::trace("JURI::root() : " . JURI::root()); self::trace("Config live_site : " . $live_site); self::trace("Config caching : " . $caching); jimport('joomla.plugin.plugin'); if (JPluginHelper::isEnabled('system', 'cache')) { self::trace("Sys Cache Plugin : Enabled"); } else { self::trace("Sys Cache Plugin : Not enabled"); } if (function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc()) { self::trace("Magic Quotes : ON"); } $tmp_dir = $app->getCfg('tmp_path'); if (is_writable($tmp_dir)) { self::trace("Temp directory is writeable: " . $tmp_dir); } else { self::trace("Temp directory is not writeable: " . $tmp_dir); } self::trace("Installed languages:"); $language_list = FCP_Admin::make_lang_list(); foreach ($language_list as $tag => $name) { self::trace(" {$tag} => {$name}"); } $config_list = $config_model->getList(); $num_configs = count($config_list); self::trace("There are {$num_configs} configuration(s)"); foreach ($config_list as $config) { if ($config->default_config) { self::trace(' ' . $config->name . ' (' . $config->language . ') ** DEFAULT **'); } else { self::trace(' ' . $config->name . ' (' . $config->language . ')'); } } // $config_data = $config_model->getOneById($config_id); // $config_text = print_r($config_data,true); // self::trace("The current back-end configuration is $config_id: ".$config_data->name." [".$config_data->language."]:"); // self::trace($config_text); // self::trace(str_repeat('=',80)); self::trace('********** End of header **********'); // self::trace(str_repeat('=',80)); }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_TOOLBAR_IMAGES'); if (JFactory::getUser()->authorise('core.admin', 'com_flexicontactplus')) { JToolBarHelper::deleteList('', 'delete_image'); } // Get the list of themes $app = JFactory::getApplication(); $filter_theme = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_theme', 'filter_theme', THEME_ALL, 'word'); $theme_list = FCP_Admin::make_theme_list(); $theme_list_html = FCP_Common::make_list('filter_theme', $filter_theme, $theme_list, 0, 'onchange="submitform( );"'); // load the front end Flexicontact language file for the current language $lang = JFactory::getLanguage(); $language = $lang->get('tag'); if (file_exists(JPATH_SITE . '/language/' . $language . '/' . $language . '.com_flexicontact_captcha.ini')) { $lang->load('com_flexicontact_captcha', JPATH_SITE); } else { $lang->load('com_flexicontactplus', JPATH_SITE); } // get an array of filenames $imageFiles = array(); // create array $handle = opendir(LAFC_SITE_IMAGES_PATH); if (!$handle) { echo JText::_('COM_FLEXICONTACT_NO_IMAGES_DIRECTORY'); return; } while (($filename = readdir($handle)) != false) { if ($filename == '.' or $filename == '..') { continue; } $imageInfo = @getimagesize(LAFC_SITE_IMAGES_PATH . '/' . $filename); if ($imageInfo === false) { continue; } // not an image if ($imageInfo[3] > 3) { // only support gif, jpg or png continue; } if ($imageInfo[0] > 150) { // if X size > 150 pixels .. continue; } // .. it's too big so skip it // Do we display it? $prefix = substr($filename, 0, 2); switch ($filter_theme) { case THEME_ALL: $imageFiles[] = $filename; break; case THEME_STANDARD: if (substr($prefix, 0, 1) == '0') { $imageFiles[] = $filename; } break; case THEME_TOYS: if ($prefix == 'A_' or $prefix == 'B_') { $imageFiles[] = $filename; } break; case THEME_NEON: if ($prefix == 'C_') { $imageFiles[] = $filename; } break; case THEME_WHITE: if ($prefix == 'D_') { $imageFiles[] = $filename; } break; case THEME_BLACK: if ($prefix == 'E_') { $imageFiles[] = $filename; } break; } } closedir($handle); if (empty($imageFiles) and $filter_theme == THEME_ALL) { echo JText::_('COM_FLEXICONTACT_NO_IMAGES'); return; } $image_count = count($imageFiles); sort($imageFiles); // start the form echo '<form action="index.php" method="post" name="adminForm" id="adminForm" >'; echo '<input type="hidden" name="option" value="com_flexicontactplus" />'; echo '<input type="hidden" name="controller" value="menu" />'; echo '<input type="hidden" name="task" value="" />'; echo '<input type="hidden" name="view" value="config_images" />'; echo '<input type="hidden" name="boxchecked" value="0" />'; echo '<input type="hidden" name="hidemainmenu" value="0" />'; // filters echo "\n" . '<div>'; echo $image_count . ' ' . JText::_('COM_FLEXICONTACT_IMAGES') . ' '; // Joomla 3.0 took away the Javascript checkAll() function. Joomla.checkAll() first appeared in 1.7 $check_all = 'onclick="Joomla.checkAll(this);"'; echo '<input type="checkbox" name="toggle" value="" ' . $check_all . ' /> '; echo $theme_list_html; echo "\n</div>"; // draw the images $i = 0; foreach ($imageFiles as $filename) { $imageInfo = getimagesize(LAFC_SITE_IMAGES_PATH . '/' . $filename); if ($imageInfo !== false) { $imageX = $imageInfo[0]; $imageY = $imageInfo[1]; } $text_name = 'COM_FLEXICONTACT_IMAGE_' . strtoupper($filename); $description = JText::_($text_name); // resolved by front end language file if ($text_name == $description) { // highlight if not resolved $description = '<span style="color: red">' . self::max_length($description, 17) . '</span>'; } echo "\n" . '<div style="display:inline-block;width:190px;border:1px solid gray;margin:1px;padding:5px;">'; echo "\n" . ' <img src="' . JURI::root() . 'components/com_flexicontactplus/images/' . $filename . '" alt="" style="float:left; border:none; margin:0 5px 0 0;"/>'; echo "\n" . '<b>' . utf8_encode($filename) . '</b><br />'; echo $description . '<br />'; echo $imageX . 'x' . $imageY . '<br />'; echo "\n" . JHTML::_('grid.id', $i++, $filename); echo '</div>'; } echo '</form>'; }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIGURATION', $this->config_data, $this->config_count); if (JFactory::getUser()->authorise('core.admin', 'com_flexicontactplus')) { JToolBarHelper::preferences('com_flexicontactplus'); } // Set up the configuration links $config_table = array(array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_general', 'icon' => 'config_general.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_GENERAL_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_GENERAL_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_template¶m1=admin_template', 'icon' => 'config_email_a.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_ADMIN_EMAIL_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_ADMIN_EMAIL_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_template¶m1=user_template', 'icon' => 'config_email_u.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_USER_EMAIL_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_USER_EMAIL_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_confirm', 'icon' => 'config_text.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_CONFIRM_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_CONFIRM_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_field_list', 'icon' => 'config_fields.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_FIELDS_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_FIELDS_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_text¶m1=top_text', 'icon' => 'config_text_top.gif', 'name' => 'COM_FLEXICONTACT_V_TOP_TEXT', 'desc' => 'COM_FLEXICONTACT_CONFIG_TEXT_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_text¶m1=bottom_text', 'icon' => 'config_text_bottom.gif', 'name' => 'COM_FLEXICONTACT_V_BOTTOM_TEXT', 'desc' => 'COM_FLEXICONTACT_CONFIG_TEXT_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=menu&task=display&view=config_captcha&', 'icon' => 'config_captcha.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_CAPTCHA_NAME', 'desc' => 'COM_FLEXICONTACT_CONFIG_CAPTCHA_DESC'), array('link' => LAFC_COMPONENT_LINK . '&controller=multiconfig&task=config_list&view=config_list', 'icon' => 'config_list.gif', 'name' => 'COM_FLEXICONTACT_CONFIG_MANAGE', 'desc' => 'COM_FLEXICONTACT_CONFIG_MANAGE_DESC')); // show the list ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="display" /> <input type="hidden" name="view" value="config_menu" /> <?php if (count($this->config_names) > 1) { $config_name_list = FCP_Common::make_list('current_config', $this->current_config, $this->config_names, 0, 'onchange="submitform( );"'); } else { $config_name_list = ''; } ?> <table class="adminlist table table-striped"> <thead> <tr> <th width = "5%"></th> <th width = "20%" nowrap="nowrap"><?php echo JText::_('COM_FLEXICONTACT_CONFIG_NAME'); ?> </th> <th width = "80%" nowrap="nowrap"> <?php echo JText::_('COM_FLEXICONTACT_CONFIG_DESC'); if ($config_name_list != '') { echo '<span style="float:right">' . JText::_('COM_FLEXICONTACT_CONFIGURATION') . ': ' . $config_name_list . '</span>'; } ?> </th> </tr> </thead> <?php $k = 0; foreach ($config_table as $config) { $link = JRoute::_($config['link']); echo "\n" . '<tr class="row' . $k . '"> <td><img src="' . LAFC_ADMIN_ASSETS_URL . $config['icon'] . '" alt="" /></td> <td>' . JHTML::link($link, JText::_($config['name'])) . '</td> <td>' . JText::_($config['desc']) . '</td> </tr>'; $k = 1 - $k; } ?> </table> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_MANAGE'); if ($this->count_unique < LAFC_MAX_CONFIGS) { JToolBarHelper::custom('add', 'new.png', 'new.png', JText::_('COM_FLEXICONTACT_TOOLBAR_NEW_CONFIG'), false); } JToolBarHelper::custom('copy', 'new.png', 'new.png', JText::_('COM_FLEXICONTACT_TOOLBAR_NEW_LANG'), true); JToolBarHelper::editList(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::deleteList(); JToolBarHelper::cancel(); $lang_text = JText::_('JFIELD_LANGUAGE_LABEL'); $check_all = 'onclick="Joomla.checkAll(this);"'; ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="multiconfig" /> <input type="hidden" name="task" value="display" /> <input type="hidden" name="view" value="config_list" /> <input type="hidden" name="boxchecked" value="0" /> <table class="adminlist table table-striped"> <thead> <th width="20"> <input type="checkbox" name="toggle" value="" <?php echo $check_all; ?> /> </th> <th width="20"> <?php echo JText::_('COM_FLEXICONTACT_PUBLISHED'); ?> </th> <th nowrap="nowrap"> <?php echo JText::_('COM_FLEXICONTACT_CONFIG_NAME'); ?> </th> <th width="5%" nowrap="nowrap"> <?php echo $lang_text; ?> </th> <th nowrap="nowrap"> <?php echo JText::_('COM_FLEXICONTACT_CONFIG_DESC'); ?> </th> </tr> </thead> <?php $k = 0; if (!empty($this->config_list)) { $numrows = count($this->config_list); for ($i = 0; $i < $numrows; $i++) { $config = $this->config_list[$i]; $checked = JHTML::_('grid.id', $i, $config->id); if ($config->default_config) { $published = '<img src="' . LAFC_ADMIN_ASSETS_URL . 'default-16.png" border="0" alt="" />'; } else { $published = JHTML::_('grid.published', $config, $i); } $link = JRoute::_(LAFC_COMPONENT_LINK . '&controller=multiconfig&task=edit&cid[]=' . $config->id); echo "<tr class='row{$k}'>"; echo ' <td align="center">' . $checked . '</td>'; echo ' <td align="center">' . $published . '</td>'; echo ' <td>' . JHTML::link($link, $config->name) . '</td>'; echo ' <td>' . JHTML::link($link, $config->language) . '</td>'; echo ' <td>' . $config->description . '</td>'; echo '</tr>'; $k = 1 - $k; } } ?> </table> </form> <?php }
function display($tpl = null) { $order_text = ucfirst(JText::_('JFIELD_ORDERING_LABEL')); $id_text = ucfirst(JText::_('JGLOBAL_FIELD_ID_LABEL')); $yes_text = ucfirst(JText::_('JYES')); $no_text = ucfirst(JText::_('JNO')); FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_FIELDS_NAME', $this->config_data, $this->config_count); JToolBarHelper::custom('add_default_fields', 'default.png', 'default_f2.png', 'COM_FLEXICONTACT_RESTORE_DEFAULT_FIELDS', false); $num_fields = count($this->config_data->config_data->all_fields); if ($num_fields < LAFC_MAX_FIELDS) { JToolBarHelper::addNew(); } JToolBarHelper::editList(); JToolBarHelper::deleteList(); JToolBarHelper::cancel(); $field_types = FCP_Admin::make_field_type_list(); require_once LAFC_HELPER_PATH . '/date_pickers.php'; $validation_types = FCP_date_picker::validation_type_list(); $pagination = new JPagination($num_fields, 0, 1000); // we don't actually use pagination but we need this for the ordering tools // Joomla 3.0 took away the Javascript checkAll() function. Joomla.checkAll() first appeared in 1.7 $check_all = 'onclick="Joomla.checkAll(this);"'; // draw the form ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="field" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_field_list" /> <input type="hidden" name="boxchecked" value="0" /> <?php echo '<table>'; echo '<table class="adminlist table table-striped">'; echo '<thead>'; echo ' <th width="1">' . $id_text . '</th>'; echo ' <th width="1"><input type="checkbox" name="toggle" value="" ' . $check_all . ' /></th>'; echo ' <th width="1"></th>'; echo ' <th width="1"></th>'; echo ' <th width="1" nowrap="nowrap">' . $order_text . ' ' . JHTML::_('grid.order', $this->config_data->config_data->all_fields) . '</th>'; echo ' <th nowrap="nowrap" width="20%">' . JText::_('COM_FLEXICONTACT_V_PROMPT') . '</th>'; echo ' <th nowrap="nowrap" width="10%" colspan="2">' . JText::_('COM_FLEXICONTACT_FIELD_TYPE') . '</th>'; echo ' <th nowrap="nowrap" width="5%" >' . JText::_('COM_FLEXICONTACT_V_MANDATORY') . '</th>'; echo ' <th nowrap="nowrap" width="5%" >' . JText::_('COM_FLEXICONTACT_V_WIDTH') . '</th>'; echo ' <th nowrap="nowrap" width="5%" >' . JText::_('COM_FLEXICONTACT_V_HEIGHT') . '</th>'; echo ' <th nowrap="nowrap">' . JText::_('COM_FLEXICONTACT_DETAILS') . '</th>'; echo ' </tr>'; echo '</thead>'; for ($i = 0; $i < $num_fields; $i++) { $field =& $this->config_data->config_data->all_fields[$i]; $field_type_name = $field_types[$field->field_type]; $checked = JHTML::_('grid.id', $i, $i); if ($field->mandatory == 1) { $mandatory = $yes_text; } else { $mandatory = $no_text; } if ($field->visible == 1) { $visible = $yes_text; } else { $visible = $no_text; } $width = ''; $height = ''; $details = ''; switch ($field->field_type) { case LAFC_FIELD_FROM_ADDRESS: $width = $field->width; break; case LAFC_FIELD_FROM_NAME: case LAFC_FIELD_TEXT: case LAFC_FIELD_PASSWORD: case LAFC_FIELD_TEXT_NUMERIC: case LAFC_FIELD_FIELDSET_START: $width = $field->width; if ($field->default_value != '') { $details = JText::_('COM_FLEXICONTACT_DEFAULT') . ': ' . $field->default_value; } break; case LAFC_FIELD_SUBJECT: $width = $field->width; if ($field->default_value != '') { $details = JText::_('COM_FLEXICONTACT_DEFAULT') . ': ' . $field->default_value . ', ' . JText::_('COM_FLEXICONTACT_VISIBLE') . ': ' . $visible; } else { $details = JText::_('COM_FLEXICONTACT_VISIBLE') . ': ' . $visible; } break; case LAFC_FIELD_TEXTAREA: $width = $field->width; $height = $field->height; break; case LAFC_FIELD_LIST: $list_array = FCP_Common::split_list($field->list_list, $field->delimiter); $field_id = sprintf('field%03d', $i); $list_html = FCP_Common::make_list($field_id, 0, $list_array['LEFT']); $details = $list_html; break; case LAFC_FIELD_FIXED_TEXT: $details = $field->default_value; break; case LAFC_FIELD_ADVANCED: $width = $field->width; $details = $field->regex; if (!empty($field->sql)) { if (!empty($details)) { $details .= '<br />'; } $details .= $field->sql; } if ($field->error_msg != '') { $details .= ' [' . $field->error_msg . ']'; } break; case LAFC_FIELD_RECIPIENT: $list_array = FCP_Common::split_list($field->list_list, ';', $field->delimiter); $field_id = sprintf('field%03d', $i); $list_html = FCP_Common::make_list($field_id, 0, $list_array['LEFT']); $details = $list_html; break; case LAFC_FIELD_RADIO_V: case LAFC_FIELD_RADIO_H: $list_array = FCP_Common::split_list($field->list_list, ';', $field->delimiter); $details = implode(", ", $list_array['RIGHT']); break; case LAFC_FIELD_CHECKBOX_M: $list_array = FCP_Common::split_list($field->list_list, $field->delimiter); $details = implode(", ", $list_array['LEFT']); break; case LAFC_FIELD_DATE: $details = $validation_types[$field->validation_type]; } $image = FCP_Admin::get_icon_image($field->field_type); $link = JRoute::_(LAFC_COMPONENT_LINK . '&controller=field&task=edit&cid[]=' . $i); $field_id = sprintf('%02d', $i + 1); echo "\n<tr>"; echo ' <td>' . JHTML::link($link, $field_id) . '</td>'; echo ' <td align="center">' . $checked . '</td>'; echo ' <td>' . $pagination->orderUpIcon($i, true) . '</td>'; echo ' <td>' . $pagination->orderDownIcon($i, true) . '</td>'; echo ' <td><input type="text" name="order[]" size="5" value="' . ($i + 1) . '" class="text_area" style="text-align: center" /></td>'; echo ' <td nowrap="nowrap">' . JHTML::link($link, $field->prompt) . '</td>'; echo ' <td align="center">' . $image . '</td>'; echo ' <td nowrap="nowrap">' . $field_type_name . '</td>'; echo ' <td align="center">' . $mandatory . '</td>'; echo ' <td align="center">' . $width . '</td>'; echo ' <td align="center">' . $height . '</td>'; echo ' <td align="left">' . $details . '</td>'; echo "\n</tr>"; } echo '</table></form>'; }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_CSS_NAME'); JToolBarHelper::apply('apply_css'); JToolBarHelper::save('save_css'); JToolBarHelper::cancel(); $css_files = FCP_Admin::get_css_list(); if ($css_files == false) { $app = JFactory::getApplication(); $app->redirect(LAFC_COMPONENT_LINK . '&task=display', JText::sprintf('COM_FLEXICONTACT_NO_CSS', LAFC_SITE_ASSETS_PATH), 'error'); return; } $fail = false; $path = LAFC_SITE_ASSETS_PATH . '/'; $css_file_name = $this->config_data->config_data->css_file; // set the css name to be used by the view. Assume that the specified one is ok // Check the current CSS file if (!file_exists($path . $css_file_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('COM_FLEXICONTACT_CSS_MISSING') . ' (' . $path . $css_file_name . ')', 'error'); FCP_trace::trace("Config_CSS View: " . $path . $css_file_name . " missing"); $fail = true; } else { if (!is_readable($path . $css_file_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('COM_FLEXICONTACT_CSS_NOT_READABLE') . ' (' . $path . $css_file_name . ')', 'error'); FCP_trace::trace("Config_CSS View: " . $path . $css_file_name . " not readable"); $fail = true; } if (!is_writable($path . $css_file_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('COM_FLEXICONTACT_CSS_NOT_WRITEABLE') . ' (' . $path . $css_file_name . ')', 'error'); FCP_trace::trace("Config_CSS View: " . $path . $css_file_name . " not writeable"); $fail = true; } } // Do we have a problem with the selected CSS file? If so, try the default if ($fail) { if ($css_file_name !== LAFC_FRONT_CSS_NAME) { $fail = false; $css_file_name = LAFC_FRONT_CSS_NAME; FCP_trace::trace("-------------------->: Attempting to use default CSS file"); if (!file_exists($path . $css_file_name)) { FCP_trace::trace("-------------------->: " . $path . $css_file_name . " missing"); $fail = true; } else { if (!is_readable($path . $css_file_name)) { FCP_trace::trace("-------------------->: " . $path . $css_file_name . " not readable"); $fail = true; } if (!is_writable($path . $css_file_name)) { FCP_trace::trace("-------------------->: " . $path . $css_file_name . " not writeable"); $fail = true; } } } } // If we still have a problem, find the first valid css file in the files list if ($fail) { foreach ($css_files as $key => $value) { $css_file_name = $key; $fail = false; if (!file_exists($path . $css_file_name)) { $fail = true; } if (!$fail and !is_readable($path . $css_file_name)) { $fail = true; } if (!$fail and !is_writable($path . $css_file_name)) { $fail = true; } if (!$fail) { // Found a functioning css file break; } } } // Still got a problem? if ($fail) { $app = JFactory::getApplication(); $app->redirect(LAFC_COMPONENT_LINK . '&task=display', JText::sprintf('COM_FLEXICONTACT_NO_VALID_CSS', LAFC_SITE_ASSETS_PATH), 'error'); return; } $css_contents = @file_get_contents($path . $css_file_name); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_css" /> <?php echo '<table>'; echo '<tr><td>' . FCP_Common::make_list('css_file_name', $css_file_name, $css_files, 0, 'onchange="submitform( );"') . '</td></tr>'; echo '<tr><td class="css_file_path">' . JText::_('COM_FLEXICONTACT_CSS_FILE'), ': (' . $path . $css_file_name . ')'; echo '<tr><td>'; echo '<textarea name="css_contents" rows="25" cols="125" style="width:auto;">' . $css_contents . '</textarea>'; echo '</td><td valign="top">'; echo FCP_Admin::make_info('www.w3schools.com/css', 'http://www.w3schools.com/css/default.asp'); echo '</td></tr></table>'; ?> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_FIELDS_NAME', $this->config_data, $this->config_count); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // make the Javascript that hides and enables the fcp_divs for the current field type // it is called by the 'domready' function and the 'onchange' function of the field type list selector $js = self::javascript(); $document = JFactory::getDocument(); $document->addScriptDeclaration($js); $dom_ready = "\nwindow.addEvent('domready', function() {fcp_show_fields(" . $this->field->field_type . ");});\n"; $document->addScriptDeclaration($dom_ready); // make the field type list $field_types = FCP_Admin::make_field_type_list(); $field_type_list = FCP_Common::make_list('field_type', $this->field->field_type, $field_types, 0, 'class="field_type" onchange="fcp_show_fields(this.value)"'); // make the validation type list require_once LAFC_HELPER_PATH . '/date_pickers.php'; $validation_types = FCP_date_picker::validation_type_list(); $validation_type_list = FCP_Common::make_list('validation_type', $this->field->validation_type, $validation_types); // setup the key panel $keypanel = FCP_Admin::make_key_panel($this->config_data->config_data); // draw the form ?> <div style="float:left"> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="field" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_field" /> <input type="hidden" name="field_index" value="<?php echo $this->field_index; ?> " /> <?php if (!isset($this->new_flag)) { echo '<input type="hidden" name="new_flag" value="0" />'; } else { echo '<input type="hidden" name="new_flag" value="' . $this->new_flag . '" />'; } echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt"><strong>' . JText::_('COM_FLEXICONTACT_FIELD_TYPE') . '</strong></td>'; echo "\n" . ' <td>' . $field_type_list; echo "\n" . '<img src="' . LAFC_ADMIN_ASSETS_URL . 'blank.gif" id="field_type_img" border="0" style="vertical-align:middle;padding:0 0 3px 15px;" alt="" />'; echo "\n" . "</td></tr>"; echo "\n" . '</table>'; // prompt echo "\n" . '<div class="fcp_div" id="fcp_prompt">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_V_PROMPT') . '</td>'; echo "\n" . ' <td><input type="text" size="40" name="prompt" value="' . $this->field->prompt . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // placeholder echo "\n" . '<div class="fcp_div" id="fcp_placeholder">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_V_PLACEHOLDER') . '</td>'; echo "\n" . ' <td><input type="text" size="40" name="placeholder" value="' . $this->field->placeholder . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // delimeter echo "\n" . '<div class="fcp_div" id="fcp_delim">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td valign="top" class="prompt">' . JText::_('COM_FLEXICONTACT_DELIMITER') . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_DELIMITER_DESC')); echo "\n" . ' <td><input type="text" size="2" name="delimiter" value="' . $this->field->delimiter . '" /> ' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // width echo "\n" . '<div class="fcp_div" id="fcp_width">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_V_WIDTH') . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_WIDTH_DESC')); echo "\n" . ' <td><input type="text" size="6" name="width" value="' . $this->field->width . '" /> ' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // height echo "\n" . '<div class="fcp_div" id="fcp_height">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_V_HEIGHT') . '</td>'; echo "\n" . ' <td><input type="text" size="6" name="height" value="' . $this->field->height . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // default value (text) echo "\n" . '<div class="fcp_div" id="fcp_default">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_DEFAULT') . '</td>'; echo "\n" . ' <td><input type="text" size="80" name="default_value" value="' . $this->field->default_value . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // validation type (date picker only) echo "\n" . '<div class="fcp_div" id="fcp_validation">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_VALIDATION') . '</td>'; echo "\n" . ' <td>' . $validation_type_list . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // default button (radio buttons only) echo "\n" . '<div class="fcp_div" id="fcp_default_button">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_DEFAULT_BUTTON') . '</td>'; echo "\n" . ' <td><input type="text" size="2" name="default_button" value="' . $this->field->default_button . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // fixed text echo "\n" . '<div class="fcp_div" id="fcp_fixed_text">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_FIELD_FIXED_TEXT') . '</td>'; echo "\n" . ' <td><input type="text" size="80" name="fixed_text" value="' . $this->field->default_value . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // list items echo "\n" . '<div class="fcp_div" id="fcp_list">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td valign="top" class="prompt">' . JText::_('COM_FLEXICONTACT_V_LIST_ITEMS') . '</td>'; echo "\n" . ' <td valign="top"><textarea rows="10" cols="80" name="list_list">' . $this->field->list_list . '</textarea>' . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_LIST_ITEMS_DESC')); echo "\n" . ' <td valign="top">' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; // echo '<pre>'.htmlentities(print_r(FCP_Common::split_list($this->field->list_list, $this->field->delimiter),true)).'</pre>'; echo "\n" . '</div>'; // radio buttons echo "\n" . '<div class="fcp_div" id="fcp_radio">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td valign="top" class="prompt">' . JText::_('COM_FLEXICONTACT_BUTTON_TEXTS') . '</td>'; echo "\n" . ' <td valign="top"><textarea rows="10" cols="80" name="radio_list">' . $this->field->list_list . '</textarea>' . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_RADIO_LIST_DESC1') . ' :: ' . JText::_('COM_FLEXICONTACT_RADIO_LIST_DESC2') . JText::_('COM_FLEXICONTACT_RADIO_LIST_DESC3')); echo "\n" . ' <td valign="top">' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; // echo '<pre>'.htmlentities(print_r(FCP_Common::split_list($this->field->list_list, ';', $this->field->delimiter),true)).'</pre>'; echo "\n" . '</div>'; // multiple checkboxes echo "\n" . '<div class="fcp_div" id="fcp_checkbox_m">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td valign="top" class="prompt">' . JText::_('COM_FLEXICONTACT_CHECKBOX_TEXTS') . '</td>'; echo "\n" . ' <td valign="top"><textarea rows="10" cols="80" name="checkbox_list">' . $this->field->list_list . '</textarea>' . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_CHECKBOX_LIST_DESC')); echo "\n" . ' <td valign="top">' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; // echo '<pre>'.htmlentities(print_r(FCP_Common::split_list($this->field->list_list, ';', $this->field->delimiter),true)).'</pre>'; echo "\n" . '</div>'; // recipient list echo "\n" . '<div class="fcp_div" id="fcp_recipient">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td valign="top" class="prompt">' . JText::_('COM_FLEXICONTACT_RECIPIENTS') . '</td>'; echo "\n" . ' <td valign="top"><textarea rows="10" cols="80" name="recipient_list">' . $this->field->list_list . '</textarea>' . '</td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_RECIPIENTS_DESC') . " :: Name1, email1@x.com;<br>Name2, email2@y.com;<br>Name3, email3@z.com"); echo "\n" . ' <td valign="top">' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; // echo '<pre>'.htmlentities(print_r(FCP_Common::split_list($this->field->list_list, ';', $this->field->delimiter),true)).'</pre>'; echo "\n" . '</div>'; // mandatory echo "\n" . '<div class="fcp_div" id="fcp_mandatory">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_V_MANDATORY') . '</td>'; echo "\n" . ' <td>' . FCP_Common::make_radio('mandatory', $this->field->mandatory) . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // visible echo "\n" . '<div class="fcp_div" id="fcp_visible">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_VISIBLE') . '</td>'; echo "\n" . ' <td>' . FCP_Common::make_radio('visible', $this->field->visible) . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // advanced validation fields echo "\n" . '<div class="fcp_div" id="fcp_advanced">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_REGEX') . '</td>'; echo "\n" . ' <td><input type="text" size="80" name="regex" value="' . $this->field->regex . '" /></td>'; echo "\n" . "</tr>"; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_SQL_NUMERIC')); echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_SQL_QUERY') . '</td>'; echo "\n" . ' <td><input type="text" size="80" name="sql" value="' . $this->field->sql . '" /> ' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // error message echo "\n" . '<div class="fcp_div" id="fcp_errormsg">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_ERRORMSG') . '</td>'; echo "\n" . ' <td><input type="text" size="80" name="error_msg" value="' . $this->field->error_msg . '" /></td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // tooltip echo "\n" . '<div class="fcp_div" id="fcp_tooltip">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_TOOLTIP') . '</td>'; echo "\n" . ' <td><textarea rows="3" cols="80" name="tooltip">' . htmlspecialchars($this->field->tooltip) . '</textarea>'; echo "\n" . ' ' . JText::_('COM_FLEXICONTACT_TOOLTIP_TYPE') . ' '; echo "\n" . FCP_Common::make_radio('tooltip_type', $this->field->tooltip_type) . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; // CSS Class echo "\n" . '<div class="fcp_div" id="fcp_css_class">'; echo "\n" . '<table class="fc_table">'; echo "\n" . "<tr>"; echo "\n" . ' <td class="prompt">' . JText::_('COM_FLEXICONTACT_CSS_CLASS') . '</td>'; echo "\n" . ' <td><input type="text" size="40" name="css_class" value="' . $this->field->css_class . '" /></td>'; $info = FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_CSS_CLASS_INFO')); echo "\n" . ' <td valign="top">' . $info . '</td>'; echo "\n" . "</tr>"; echo "\n" . '</table>'; echo "\n" . '</div>'; echo "\n" . '</form>'; echo "\n" . '</div>'; // float:left // Key Panel echo "\n" . '<div class="fcp_div" id="fcp_keypanel_class" style="float:left">'; echo $keypanel; echo "\n" . '</div>'; }
function _allLang($name) { $langs = FCP_Admin::make_lang_list(); $config_model = $this->getModel('config'); foreach ($langs as $key => $value) { $ret = $config_model->_exists($name, $key); // Config does not exist in this language if (!$ret) { return false; } } return true; }
function help() { FCP_Admin::addSubMenu('help'); $app = JFactory::getApplication(); $config_id = $app->getUserState(LAFC_COMPONENT . "_current_config", 0); $config_model = $this->getModel('config'); $config_names = $config_model->getListNames(); // Multiple configurations? $config_data = $config_model->getOneById($config_id); // gets the default config if $config_id = 0 FCP_Admin::environment_check(); $view = $this->getView('help', 'html'); $view->config_id = $config_id; $view->config_data = $config_data; $view->config_names = $config_names; $view->display(); }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_LOG'); JToolBarHelper::deleteList('', 'delete_log'); JToolBarHelper::custom('stats', 'chart.png', 'chart.png', JText::_('COM_FLEXICONTACT_STATS'), false); if ($this->free_log_info != null and $this->free_log_info->count > 0) { JToolBarHelper::custom('import', 'upload.png', 'upload.png', JText::_('COM_FLEXICONTACT_IMPORT'), false); } JToolBarHelper::custom('download', 'download.png', 'download.png', JText::_('COM_FLEXICONTACT_DOWNLOAD'), false); // get the order states $app = JFactory::getApplication(); $filter_order = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_order', 'filter_order', 'date_time'); $filter_order_Dir = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_order_Dir', 'filter_order_Dir', 'desc'); $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $search = $app->getUserStateFromRequest(LAFC_COMPONENT . '.search', 'search', '', 'string'); $lists['search'] = JString::strtolower($search); // get the current filters $filter_date = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_date', 'filter_date', LAFC_LOG_LAST_28_DAYS, 'int'); $filter_config = $app->getUserStateFromRequest(LAFC_COMPONENT . '.filter_config', 'filter_config', 'all', 'string'); // make the filter lists $date_filters = array(LAFC_LOG_ALL => JText::_('COM_FLEXICONTACT_LOG_ALL'), LAFC_LOG_LAST_7_DAYS => JText::_('COM_FLEXICONTACT_LOG_LAST_7_DAYS'), LAFC_LOG_LAST_28_DAYS => JText::_('COM_FLEXICONTACT_LOG_LAST_28_DAYS'), LAFC_LOG_LAST_12_MONTHS => JText::_('COM_FLEXICONTACT_LOG_LAST_12_MONTHS')); $lists['date_filters'] = FCP_Common::make_list('filter_date', $filter_date, $date_filters, 0, 'onchange="this.form.task.value=\'log_list\';submitform( );"'); $lists['config_filters'] = FCP_Common::make_list('filter_config', $filter_config, $this->config_list, ' ', 'onchange="this.form.task.value=\'log_list\';submitform( );"'); // Joomla 3.0 took away the Javascript checkAll() function. Joomla.checkAll() first appeared in 1.7 $numrows = count($this->log_list); $check_all = 'onclick="Joomla.checkAll(this);"'; // Show the list ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="log" /> <input type="hidden" name="task" value="log_list" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="view" value="log_list" /> <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?> " /> <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?> " /> <table> <tr> <td align="left" width="100%"> <?php echo ' ' . JText::_('COM_FLEXICONTACT_SEARCH') . ':'; echo '<input type="text" size="60" name="search" id="search" value="'; echo $lists['search']; echo '" class="text_area" />'; echo ' <button class="fcp_button" onclick="this.form.task.value=\'log_list\';this.form.submit();">' . JText::_('COM_FLEXICONTACT_GO') . '</button>'; ?> </td> <td nowrap="nowrap"> <?php echo JText::_('COM_FLEXICONTACT_CONFIGURATION') . $lists['config_filters'] . ' '; echo $lists['date_filters']; echo ' '; echo '<button class="fcp_button" onclick="' . "\n\t\t\t\t\tthis.form.filter_date.value='" . LAFC_LOG_LAST_28_DAYS . "';\n\t\t\t\t\tthis.form.search.value='';\n\t\t\t\t\tthis.form.filter_config.value='all';\n\t\t\t\t\tthis.form.task.value='log_list';\n\t\t\t\t\tthis.form.submit();" . '">' . JText::_('COM_FLEXICONTACT_RESET') . '</button>'; ?> </td> </tr> </table> <table class="adminlist table table-striped"> <thead> <tr> <th width="20"><input type="checkbox" name="toggle" value="" <?php echo $check_all; ?> /></th> <th class="title" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'COM_FLEXICONTACT_DATE_TIME', 'datetime', $lists['order_Dir'], $lists['order']); ?> </th> <th class="title" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'COM_FLEXICONTACT_NAME', 'name', $lists['order_Dir'], $lists['order']); ?> </th> <th class="title" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'COM_FLEXICONTACT_EMAIL', 'email', $lists['order_Dir'], $lists['order']); ?> </th> <th class="title" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'COM_FLEXICONTACT_SUBJECT', 'subject', $lists['order_Dir'], $lists['order']); ?> </th> <th class="title" nowrap="nowrap"><?php echo JText::_('COM_FLEXICONTACT_OTHER_DATA'); ?> </th> <th class="title" nowrap="nowrap"><?php echo JText::_('COM_FLEXICONTACT_STATUS'); ?> </th> </tr> </thead> <tfoot> <tr> <td colspan="15"> <?php echo $this->pagination->getListFooter(); ?> </td> </tr> </tfoot> <tbody> <?php $k = 0; for ($i = 0; $i < $numrows; $i++) { $row = $this->log_list[$i]; $link = JRoute::_(LAFC_COMPONENT_LINK . '&controller=log&task=log_detail&log_id=' . $row->id); $checked = JHTML::_('grid.id', $i, $row->id); $date = JHTML::link($link, $row->datetime); $name = preg_replace('/[^(a-zA-Z \\x27)]*/', '', $row->name); // remove all except a-z, A-Z, and ' $subject = preg_replace('/[^(a-zA-Z1-9 \\x27)]*/', '', $row->subject); $other_data = str_replace('<br />', ' ', $row->short_message); // $other_data = preg_replace('/[^(a-zA-Z1-9 :\x27)]*/','', $other_data); $status_main = $this->_status($row->status_main); $status_copy = $this->_status($row->status_copy); $attachment = $this->_attachment($row->attached_file); echo "\n" . '<tr class="row' . $k . '">'; echo "\n " . '<td align="center">' . $checked . '</td>'; echo "\n " . '<td nowrap="nowrap">' . $date . '</td>'; echo "\n " . '<td>' . $name . '</td>'; if ($row->email != '') { $email_link = 'mailto:' . $row->email . '?Subject=' . $subject; echo "\n " . '<td>' . JHTML::link($email_link, $row->email, 'target="_blank"') . '</td>'; } else { echo "\n " . '<td>' . $row->email . '</td>'; } echo "\n " . '<td>' . $subject . '</td>'; echo "\n " . '<td>' . $other_data . '</td>'; echo "\n " . '<td>' . $status_main . ' ' . $status_copy . ' ' . $attachment . '</td>'; echo "\n" . '</tr>'; $k = 1 - $k; } ?> </tbody> </table> </form> <?php }
function display($tpl = null) { FCP_Admin::make_title('COM_FLEXICONTACT_CONFIG_CAPTCHA_NAME', $this->config_data, $this->config_count); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel(); // load the colour picker $document = JFactory::getDocument(); $document->addScript(LAFC_ADMIN_ASSETS_URL . 'jscolor.js'); // setup the captcha types $none_text = JText::_('JNONE'); $noise_types = array(); $noise_types[NOISE_NO] = JText::_('COM_FLEXICONTACT_NOISE_NO'); $noise_types[NOISE_1] = JText::_('COM_FLEXICONTACT_NOISE_MODE') . ' 1'; $noise_types[NOISE_2] = JText::_('COM_FLEXICONTACT_NOISE_MODE') . ' 2'; $noise_types[NOISE_3] = JText::_('COM_FLEXICONTACT_NOISE_MODE') . ' 3'; $noise_types[NOISE_4] = JText::_('COM_FLEXICONTACT_NOISE_MODE') . ' 4'; $noise_types[NOISE_5] = JText::_('COM_FLEXICONTACT_NOISE_MODE') . ' 5'; $noise_types[NOISE_RAW] = JText::_('COM_FLEXICONTACT_NOISE_RAW'); $captcha_types = array(); $captcha_types[CAPTCHA_NONE] = $none_text; $captcha_types[CAPTCHA_WORDS_EASY] = JText::_('COM_FLEXICONTACT_CAPTCHA_WORDS_EASY'); $captcha_types[CAPTCHA_WORDS_HARD] = JText::_('COM_FLEXICONTACT_CAPTCHA_WORDS_HARD'); $captcha_types[CAPTCHA_MATHS_EASY] = JText::_('COM_FLEXICONTACT_CAPTCHA_MATHS_EASY'); $captcha_types[CAPTCHA_MATHS_HARD] = JText::_('COM_FLEXICONTACT_CAPTCHA_MATHS_HARD'); $recaptcha_themes = array(); $recaptcha_themes[RECAPTCHA_NONE] = $none_text; $recaptcha_themes[RECAPTCHA_RED] = JText::_('COM_FLEXICONTACT_RECAPTCHA_RED'); $recaptcha_themes[RECAPTCHA_WHITE] = JText::_('COM_FLEXICONTACT_RECAPTCHA_WHITE'); $recaptcha_themes[RECAPTCHA_BLACKGLASS] = JText::_('COM_FLEXICONTACT_RECAPTCHA_BLACKGLASS'); $recaptcha_themes[RECAPTCHA_CLEAN] = JText::_('COM_FLEXICONTACT_RECAPTCHA_CLEAN'); ?> <form action="index.php" method="post" name="adminForm" id="adminForm" > <input type="hidden" name="option" value="<?php echo LAFC_COMPONENT; ?> " /> <input type="hidden" name="controller" value="menu" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="view" value="config_captcha" /> <?php // Show Captcha if User Logged In echo "\n" . '<table class="fc_table">'; echo "\n<tr>"; echo '<td colspan="2" class="prompt">' . JText::_('COM_FLEXICONTACT_SHOW_CAPTCHA') . '</td>'; echo '<td>' . FCP_Common::make_radio('show_captcha', $this->config_data->config_data->show_captcha) . '</td>'; echo "\n</tr>"; echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; // Magic Word echo "\n<tr>"; echo '<td><img src="' . LAFC_ADMIN_ASSETS_URL . 'captcha3.gif" alt="" style="vertical-align:middle;" /></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_MAGIC_WORD') . '</td>'; echo '<td><input type="text" size="30" name="magic_word" value="' . $this->config_data->config_data->magic_word . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_MAGIC_WORD_DESC')) . '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_MAGIC_WORD_LABEL') . '</td>'; echo '<td><input type="text" size="40" name="magic_word_prompt" value="' . $this->config_data->config_data->magic_word_prompt . '" /></td>'; echo "\n</tr>"; echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; // Our Image Captcha $noise_type_list = FCP_Common::make_list('noise', $this->config_data->config_data->noise, $noise_types); echo "\n<tr>"; echo '<td><img src="' . LAFC_ADMIN_ASSETS_URL . 'captcha2.gif" alt="" style="vertical-align:middle;" /></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_V_CAPTCHA_NUMBER') . '</td>'; echo '<td>'; echo '<input type="text" size="4" name="num_images" value="' . $this->config_data->config_data->num_images . '" />'; echo ' ' . FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_V_CAPTCHA_DESC')); echo ' ' . JText::_('COM_FLEXICONTACT_V_HEIGHT'); echo ' <input type="text" size="4" name="image_height" value="' . $this->config_data->config_data->image_height . '" />'; echo ' ' . JText::_('COM_FLEXICONTACT_V_WIDTH'); echo ' <input type="text" size="4" name="image_width" value="' . $this->config_data->config_data->image_width . '" />'; echo '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_CONFIG_NOISE') . '</td>'; echo '<td>' . $noise_type_list . '</td>'; echo "\n</tr>"; if (!function_exists('imagecreate')) { echo "\n" . '<tr><td colspan="3" class="fcp_error">' . JText::_('COM_FLEXICONTACT_ENV_GD_LIBRARY') . '</td></tr>'; } echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; // SecureImage Captcha $captcha_type_list = FCP_Common::make_list('secure_captcha', $this->config_data->config_data->secure_captcha, $captcha_types); echo "\n<tr>"; echo '<td><img src="' . LAFC_ADMIN_ASSETS_URL . 'captcha1.gif" alt="" style="vertical-align:middle;" /></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_SECURE_CAPTCHA') . '</td>'; echo '<td>'; echo $captcha_type_list; echo ' ' . JText::_('COM_FLEXICONTACT_V_HEIGHT'); echo ' <input type="text" size="4" name="captcha_height" value="' . $this->config_data->config_data->captcha_height . '" />'; echo ' ' . JText::_('COM_FLEXICONTACT_V_WIDTH'); echo ' <input type="text" size="4" name="captcha_width" value="' . $this->config_data->config_data->captcha_width . '" />'; echo '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_COLOURS') . '</td>'; echo '<td>'; echo JText::_('COM_FLEXICONTACT_TEXT'); echo ' <input type="text" class="color {required:false}" size="6" name="captcha_colour_text" value="' . $this->config_data->config_data->captcha_colour_text . '" />'; echo ' ' . JText::_('COM_FLEXICONTACT_LINES'); echo ' <input type="text" class="color {required:false}" size="6" name="captcha_colour_lines" value="' . $this->config_data->config_data->captcha_colour_lines . '" />'; echo ' ' . JText::_('COM_FLEXICONTACT_BACKGROUND'); echo ' <input type="text" class="color {required:false}" size="6" name="captcha_colour_background" value="' . $this->config_data->config_data->captcha_colour_background . '" />'; echo '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_SECURE_CAPTCHA_LABEL') . '</td>'; echo '<td><input type="text" size="40" name="secure_captcha_prompt" value="' . $this->config_data->config_data->secure_captcha_prompt . '" /></td>'; echo "\n</tr>"; if (!function_exists('imagecreate')) { echo "\n" . '<tr><td colspan="3" class="fcp_error">' . JText::_('COM_FLEXICONTACT_ENV_GD_LIBRARY') . '</td></tr>'; } echo "\n" . '<tr><td colspan="3"><hr /></td></tr>'; // ReCaptcha $recaptcha_theme_list = FCP_Common::make_list('recaptcha_theme', $this->config_data->config_data->recaptcha_theme, $recaptcha_themes); echo "\n<tr>"; echo '<td><img src="' . LAFC_ADMIN_ASSETS_URL . 'captcha4.gif" alt="" style="vertical-align:middle;" /></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_RECAPTCHA') . '</td>'; echo '<td>'; echo $recaptcha_theme_list; echo ' ' . JText::_('JFIELD_LANGUAGE_LABEL'); echo ' <input type="text" size="6" name="recaptcha_language" value="' . $this->config_data->config_data->recaptcha_language . '" />'; echo '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_RECAPTCHA_PUBLIC_KEY') . '</td>'; echo '<td><input type="text" size="60" name="recaptcha_public_key" value="' . $this->config_data->config_data->recaptcha_public_key . '" /> '; $link = 'https://www.google.com/recaptcha/admin/create'; echo FCP_Admin::make_info(JText::_('COM_FLEXICONTACT_GET_KEY'), $link) . '</td>'; echo "\n</tr>"; echo "\n<tr>"; echo '<td></td>'; echo '<td class="prompt">' . JText::_('COM_FLEXICONTACT_RECAPTCHA_PRIVATE_KEY') . '</td>'; echo '<td><input type="text" size="60" name="recaptcha_private_key" value="' . $this->config_data->config_data->recaptcha_private_key . '" /></td>'; echo "\n</tr>"; echo '</table>'; echo '</form>'; }