function ExtraJS() { header('Content-type: application/javascript'); includeFile('tool/editing.php'); trigger_error('Deprecated: special_extrajs'); $_GET += array('which' => array()); foreach ((array) $_GET['which'] as $which_code) { switch ($which_code) { case 'autocomplete2': $options['admin_vals'] = false; $options['var_name'] = 'gp_include_titles'; echo gp_edit::AutoCompleteValues(false, $options); break; case 'autocomplete': echo gp_edit::AutoCompleteValues(true); break; case 'gp_ckconfig': $options = array(); echo gp_edit::CKConfig($options, 'gp_ckconfig'); break; } } die; }
static function InlineEdit_Text($scripts) { includeFile('tool/editing.php'); // autocomplete echo gp_edit::AutoCompleteValues(true); // ckeditor basepath and configuration $options = array('extraPlugins' => 'sharedspace', 'sharedSpaces' => array('top' => 'ckeditor_top', 'bottom' => ' ckeditor_bottom')); $ckeditor_basepath = common::GetDir('/include/thirdparty/ckeditor_34/'); echo 'CKEDITOR_BASEPATH = ' . gpAjax::quote($ckeditor_basepath) . ';'; echo 'var gp_ckconfig = ' . gp_edit::CKConfig($options, 'json', $plugins) . ';'; // extra plugins echo 'var gp_add_plugins = ' . json_encode($plugins) . ';'; // scripts $scripts[] = '/include/thirdparty/ckeditor_34/ckeditor.js'; $scripts[] = '/include/js/ckeditor_config.js'; $scripts[] = '/include/js/inline_edit/inlineck.js'; return $scripts; }
/** * Show the default admin page * */ function AdminPanel() { global $langmessage; $cmd = common::GetCommand(); switch ($cmd) { case 'embededcheck': includeFile('tool/update.php'); new update_class('embededcheck'); return; case 'autocomplete-titles': $opts = array('var_name' => false); echo gp_edit::AutoCompleteValues(false, $opts); die; } $this->head_js[] = '/include/js/auto_width.js'; echo '<h2>' . $langmessage['administration'] . '</h2>'; echo '<div id="adminlinks2">'; admin_tools::AdminPanelLinks(false); echo '</div>'; }
/** * Include Editing * */ function IncludeDialog($section) { global $page, $langmessage, $config; $page->ajaxReplace = array(); $include_type =& $section['include_type']; $gadget_content = ''; $file_content = ''; switch ($include_type) { case 'gadget': $gadget_content =& $section['content']; break; default: $file_content =& $section['content']; break; } ob_start(); echo '<form id="gp_include_form">'; echo '<div class="gp_inlude_edit">'; echo '<span class="label">'; echo $langmessage['File Include']; echo '</span>'; echo '<input type="text" size="" id="gp_file_include" name="file_include" class="title-autocomplete" value="' . htmlspecialchars($file_content) . '" />'; echo '</div>'; echo '<div class="gp_inlude_edit">'; echo '<span class="label">'; echo $langmessage['gadgets']; echo '</span>'; echo '<input type="text" size="" id="gp_gadget_include" name="gadget_include" class="title-autocomplete" value="' . htmlspecialchars($gadget_content) . '" />'; echo '</div>'; echo '<div id="gp_option_area">'; echo '<a data-cmd="gp_include_preview" class="ckeditor_control full_width">Preview</a>'; echo '</div>'; echo '</form>'; $content = ob_get_clean(); $page->ajaxReplace[] = array('gp_include_dialog', '', $content); //file include autocomplete $options['admin_vals'] = false; $options['var_name'] = 'source'; $file_includes = gp_edit::AutoCompleteValues(false, $options); $page->ajaxReplace[] = array('gp_autocomplete_include', 'file', $file_includes); //gadget include autocomplete $codea = array(); if (isset($config['gadgets'])) { foreach ($config['gadgets'] as $uniq => $info) { $codea[] = array($uniq, $uniq); } } $code = 'var source=' . json_encode($codea); $page->ajaxReplace[] = array('gp_autocomplete_include', 'gadget', $code); return false; }
static function PrepAutoComplete($autocomplete_js = true, $GetUrl = true) { global $page; if ($autocomplete_js) { $page->head_js[] = '/include/js/autocomplete.js'; } $page->head_script .= gp_edit::AutoCompleteValues($GetUrl); }
function IncludeDialog() { global $page, $langmessage, $config; $page->ajaxReplace = array(); $section =& $_GET['section']; if (!isset($this->file_sections[$section])) { message($langmessage['OOPS']); return; } $include_type =& $this->file_sections[$section]['include_type']; $gadget_content = ''; $file_content = ''; switch ($include_type) { case 'gadget': $gadget_content =& $this->file_sections[$section]['content']; break; default: $file_content =& $this->file_sections[$section]['content']; break; } ob_start(); echo '<form id="gp_include_form">'; echo '<div class="gp_inlude_edit">'; echo '<span class="label">'; echo $langmessage['File Include']; echo '</span>'; echo '<input type="text" size="" id="gp_file_include" name="file_include" class="autocomplete" value="' . htmlspecialchars($file_content) . '" />'; echo '</div>'; echo '<div class="gp_inlude_edit">'; echo '<span class="label">'; echo $langmessage['gadgets']; echo '</span>'; echo '<input type="text" size="" id="gp_gadget_include" name="gadget_include" class="autocomplete" value="' . htmlspecialchars($gadget_content) . '" />'; echo '</div>'; echo '<div class="option_area">'; echo '<a href="#" name="gp_include_preview" class="ckeditor_control full_width">Preview</a>'; echo '</div>'; echo '</form>'; $content = ob_get_clean(); $page->ajaxReplace[] = array('gp_include_dialog', '', $content); //file include autocomplete $options['admin_vals'] = false; $options['var_name'] = 'source'; $file_includes = gp_edit::AutoCompleteValues(false, $options); $page->ajaxReplace[] = array('gp_autocomplete_include', 'file', $file_includes); //gadget include autocomplete $code = 'var source=['; if (isset($config['gadgets'])) { foreach ($config['gadgets'] as $uniq => $info) { $code .= '["' . addslashes($uniq) . '","' . addslashes($uniq) . '"],'; } } $code .= ']'; $page->ajaxReplace[] = array('gp_autocomplete_include', 'gadget', $code); }
/** * @deprecated * Use gp_edit::AutoCompleteValues(); */ function AutoCompleteValues($GetUrl = true, $options = array()) { includeFile('tool/editing.php'); return gp_edit::AutoCompleteValues($GetUrl, $options); }
function InlineEdit_Text($scripts) { includeFile('tool/editing.php'); //autocomplete echo gp_edit::AutoCompleteValues(true); //ckeditor basepath and configuration $ckeditor_basepath = common::GetDir('/include/thirdparty/ckeditor_34/'); echo 'CKEDITOR_BASEPATH = ' . gpAjax::quote($ckeditor_basepath) . ';'; echo 'var gp_ckconfig = {};'; //gp_ckconfig options $options = array(); echo gp_edit::CKConfig($options, 'gp_ckconfig'); $scripts[] = '/include/thirdparty/ckeditor_34/ckeditor.js'; $scripts[] = '/include/js/inline_edit/inlineck.js'; return $scripts; }