$e .= '<li><b>' . sprintf($ptx['error_form_missing'], $id) . '</b></li>'; } return Advancedform_formsAdministration(); } /* * Register the plugin menu items. */ if (function_exists('XH_registerStandardPluginMenuItems')) { XH_registerStandardPluginMenuItems(true); } /* * Handle the plugin administration. */ if (isset($advancedform) && $advancedform == 'true') { if (include_once $pth['folder']['plugins'] . 'jquery/jquery.inc.php') { include_jQuery(); include_jQueryUI(); } if (Advancedform_updateLangJs()) { $hjs .= PHP_EOL . '<script type="text/javascript" src="' . $pth['folder']['plugins'] . 'advancedform/languages/' . $sl . '.js">' . '</script>' . PHP_EOL; } $hjs .= '<script type="text/javascript" src="' . $pth['folder']['plugins'] . 'advancedform/admin.js"></script>' . PHP_EOL; $o .= print_plugin_admin('on'); switch ($admin) { case '': $o .= Advancedform_version() . Advancedform_systemCheck(); break; case 'plugin_main': switch ($action) { case 'new': $o .= Advancedform_createForm();
/** * Includes jquery and initializes the datepicker, if not already done. * * @return void * * @global array The paths of system files and folders. * @global string The current language. * @global string The (X)HTML fragment for insertion into the HEAD element. * @global array The configuration of the core. * @global array The configuration of the plugins. * @global array The localization of the plugins. */ function Advancedform_initJQuery() { global $pth, $sl, $hjs, $cf, $plugin_cf, $plugin_tx; if (defined('ADVFRM_JQUERY_INITIALIZED')) { return; } $ptx = $plugin_tx['advancedform']; if (include_once $pth['folder']['plugins'] . 'jquery/jquery.inc.php') { include_jQuery(); include_jQueryUI(); } $date_format = $ptx['date_order'][0] . $ptx['date_order'][0] . $ptx['date_delimiter'] . $ptx['date_order'][1] . $ptx['date_order'][1] . $ptx['date_delimiter'] . $ptx['date_order'][2] . $ptx['date_order'][2]; $lang = strlen($sl) == 2 ? $sl : $cf['language']['default']; $fn = $pth['folder']['plugins'] . 'advancedform/languages/jquery.ui.datepicker-' . $lang . '.js'; if (file_exists($fn)) { $hjs .= '<script type="text/javascript" src="' . $fn . '"></script>' . PHP_EOL; } else { if ($sl != 'en') { e('missing', 'language', $fn); } } $hjs .= <<<SCRIPT <script type="text/javascript">/* <![CDATA[ */ jQuery(function() { jQuery.datepicker.setDefaults(jQuery.datepicker.regional['{$lang}']); jQuery.datepicker.setDefaults({dateFormat: '{$date_format}'}); }) /* ]]> */</script> SCRIPT; define('ADVFRM_JQUERY_INITIALIZED', true); }
/** * Includes JS and CSS to the <head>. * * @return void * * @global array The paths of system files and folders. * @global string The (X)HTML of the head element. */ protected function hjs() { global $pth, $hjs; $dir = $pth['folder']['plugins'] . 'forum/markitup/'; $hjs .= tag('link rel="stylesheet" type="text/css" href="' . $dir . 'skins/simple/style.css"') . "\n"; $hjs .= tag('link rel="stylesheet" type="text/css" href="' . $dir . 'sets/bbcode/style.css"') . "\n"; include_once $pth['folder']['plugins'] . 'jquery/jquery.inc.php'; include_jQuery(); include_jQueryPlugin('markitup', $dir . 'jquery.markitup.js'); $texts = XH_encodeJson($this->jsTexts()); $hjs .= <<<EOT <script type="text/javascript">/* <![CDATA[ */ var Forum = {TX: {$texts}}; jQuery(function() { jQuery(".forum_comment textarea").markItUp(Forum.settings); }); /* ]]> */</script> <script type="text/javascript" src="{$dir}sets/bbcode/set.js"></script> EOT; }