Ejemplo n.º 1
0
 /**
  * Get scripts for editing inline text using ckeditor
  *
  */
 static function InlineEdit_Text($scripts)
 {
     // autocomplete
     $scripts[] = array('code' => \gp\tool\Editing::AutoCompleteValues(true), 'object' => 'gptitles');
     // ckeditor basepath and configuration
     $options = array('extraPlugins' => 'sharedspace', 'sharedSpaces' => array('top' => 'ckeditor_top', 'bottom' => ' ckeditor_bottom'));
     $ckeditor_basepath = \gp\tool::GetDir('/include/thirdparty/ckeditor_34/');
     echo 'CKEDITOR_BASEPATH = ' . self::quote($ckeditor_basepath) . ';';
     // config
     $scripts[] = array('code' => 'var gp_ckconfig = ' . \gp\tool\Editing::CKConfig($options, 'json', $plugins) . ';', 'object' => 'gp_ckconfig');
     // extra plugins
     $scripts[] = array('code' => 'var gp_add_plugins = ' . json_encode($plugins) . ';', 'object' => 'gp_add_plugins');
     // CKEDITOR
     $scripts[] = array('file' => '/include/thirdparty/ckeditor_34/ckeditor.js', 'object' => 'CKEDITOR');
     $scripts[] = array('file' => '/include/js/ckeditor_config.js', 'object' => 'CKEDITOR');
     $scripts[] = '/include/js/inline_edit/inlineck.js';
     return $scripts;
 }
Ejemplo n.º 2
0
 /**
  * Display Current Configuration Settings
  *
  */
 function DisplayCurrent()
 {
     global $langmessage;
     echo '<h3>' . $langmessage['Current Configuration'] . '</h3>';
     $default_config = \gp\tool\Editing::CKConfig(array(), 'array');
     echo '<pre class="json">';
     echo self::ReadableJson($default_config);
     echo '</pre>';
 }
Ejemplo n.º 3
0
 public function ExtraJS()
 {
     header('Content-type: application/javascript');
     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\tool\Editing::AutoCompleteValues(false, $options);
                 break;
             case 'autocomplete':
                 echo \gp\tool\Editing::AutoCompleteValues(true);
                 break;
             case 'gp_ckconfig':
                 $options = array();
                 echo \gp\tool\Editing::CKConfig($options, 'gp_ckconfig');
                 break;
         }
     }
     die;
 }