= USERLEVEL_ADMIN) { return false; } // do we already have it? if (is_dir($this->cke_dir) && is_file($this->cke_dir . '/ckeditor.js')) { // this is running while getting a new Plugin version if ($this->checkUpdate()) { $this->set_config('installer', '4-'.date('Ymd-H:i:s')); // this is a faked debug notice, since falldown is extract true with case 0, 1 or 2 } else { $this->set_config('installer', '3-'.date('Ymd-H:i:s')); // this will happen, if no further extract is necessary in case of an update return; } } if (is_writable($this->cke_path)) { $zip = new ZipArchive; if ($zip->open($this->cke_path . '/' . $this->cke_zipfile) === true) { $zip->extractTo($this->cke_path); $zip->close(); $this->set_config('installer', '2-'.date('Ymd-H:i:s')); // returned by string[0], which is better than substr in this case // Check to remove every old ckeditor_(*)_standard-plus.zip files foreach (glob($this->cke_path . '/*.zip') as $filename) { if($this->cke_path . '/' . $this->cke_zipfile != $filename) { @unlink($filename); } } } else { $this->set_config('installer', '1-'.date('Ymd-H:i:s')); return false; } } else { $this->set_config('installer', '0-'.date('Ymd-H:i:s')); // do it again, Sam return false; } return true; } function introspect(&$propbag) { global $serendipity; $propbag->add('name', PLUGIN_EVENT_CKEDITOR_NAME); $propbag->add('description', PLUGIN_EVENT_CKEDITOR_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Rustam Abdullaev, Ian'); $propbag->add('version', '1.3.2'); $propbag->add('copyright', 'GPL or LGPL License'); $propbag->add('requirements', array( 'serendipity' => '1.7', 'smarty' => '3.1.13', 'php' => '5.2.6' )); $propbag->add('event_hooks', array( 'backend_header' => true, 'css_backend' => true, 'backend_plugins_update' => true, 'backend_media_path_exclude_directories' => true, 'backend_wysiwyg' => true, 'backend_wysiwyg_finish' => true )); $propbag->add('configuration', array('path', 'plugpath', 'acf_off', 'toolbar_break')); $propbag->add('groups', array('BACKEND_EDITOR')); } function introspect_config_item($name, &$propbag) { global $serendipity; switch($name) { case 'path': $propbag->add('type', 'string'); $propbag->add('name', INSTALL_RELPATH); $propbag->add('description', ''); $propbag->add('default', 'plugins/serendipity_event_ckeditor/ckeditor/'); break; case 'plugpath': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EVENT_CKEDITOR_INSTALL_PLUGPATH); $propbag->add('description', ''); $propbag->add('default', $serendipity['serendipityHTTPPath'] . 'plugins/'); break; case 'acf_off': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EVENT_CKEDITOR_CKEACF_OPTION); $propbag->add('description', 'http://ckeditor.com/blog/Integrating-Plugins-with-Advanced-Content-Filter'); $propbag->add('default', 'false'); break; case 'toolbar_break': $propbag->add('type', 'boolean'); $propbag->add('name', PLUGIN_EVENT_CKEDITOR_TBLB_OPTION); $propbag->add('description', ''); $propbag->add('default', 'true'); break; default: return false; } return true; } function generate_content(&$title) { $title = $this->title; } function example() { $installer = $this->get_config('installer'); // Can't use method return value in write context in '' with substr(), get_config() and isset() $parts = explode(':', $this->checkUpdateVersion[0]); // this is ckeditor only echo PLUGIN_EVENT_CKEDITOR_REVISION_TITLE; echo "\n
Check Plugin Update Message: NO CONFIG SET OR NO MATCH -> config_set: "last_'.$parts[0].'_version:'. $parts[1].'"
'; break; case '3': echo 'Installer Update Message: Check Update found false, no unpack needed. Plugin upgrade successfully done or has been triggered to be checked by an other Spartacus Plugin update!
'; break; case '2': echo 'Installer Message: Extracting the zip to ' . $this->cke_path . ' directory done!
'; break; case '1': echo 'Installer Error[1]: Extracting the zip to ' . $this->cke_path . ' directory failed!
Please extract ' . $this->cke_zipfile . ' by hand.
Installer Error[0]: Due to a writing permission error, extracting the zip to ' . $this->cke_path . ' directory failed!
Please set "/plugins" or "/plugins/serendipity_event_ckeditor" directory and files correct writing permissions and extract ' . $this->cke_zipfile . ' by hand or try again and remove(!) this plugin from your plugin list and install it again.