예제 #1
0
파일: dialog.php 프로젝트: ioanok/symfoxid
 function loadEmbedPlugin($name)
 {
     static $fs;
     $fs = new wproFilesystem();
     $name = $fs->makeVarOK($name);
     if (!isset($this->embedPlugins[$name])) {
         if (!wpro_class_exists('wproFilePlugin_' . $name)) {
             $dir = WPRO_DIR . 'plugins/mediaPlugins/';
             if (!$fs->includeFileOnce($name, $dir, '/plugin.php')) {
                 return false;
             } else {
                 if (!wpro_class_exists('wproFilePlugin_' . $name)) {
                     return false;
                 }
             }
         }
         @eval('$this->embedPlugins["' . $name . '"] = new wproFilePlugin_' . $name . '();');
         $this->embedPlugins[$name]->name = $name;
         if (method_exists($this->embedPlugins[$name], 'init')) {
             $this->embedPlugins[$name]->init($this);
         }
     }
     //$ret = & $p;
     return true;
 }
예제 #2
0
 function loadPlugin($name, $default = false)
 {
     require_once WPRO_DIR . 'core/libs/wproFilesystem.class.php';
     $files = new wproFilesystem();
     $name = $this->makeVarOk($name);
     if (!isset($this->plugins[$name])) {
         $baseDir = WPRO_DIR . '/plugins/';
         if (substr($name, 0, 9) == 'wproCore_') {
             $baseDir = WPRO_DIR . 'core/plugins/';
         } else {
             $baseDir = WPRO_DIR . 'plugins/';
         }
         // load componant file
         if (!wpro_class_exists("wproDialogPlugin_{$name}")) {
             if ($files->includeFileOnce($name, $baseDir, '/dialog.php')) {
                 $this->EDITOR->langEngine->loadFile('wysiwygpro/includes/' . $name . '.inc.php');
                 //
             } else {
                 return false;
             }
         }
         // create componant object
         if (wpro_class_exists("wproDialogPlugin_{$name}")) {
             @eval('$this->plugins["' . $name . '"] = & new wproDialogPlugin_' . $name . '();');
             if (method_exists($this->plugins[$name], 'init')) {
                 $this->plugins[$name]->init($this);
             }
             if ($default) {
                 $this->dialogName = $name;
             }
             return true;
         }
     } else {
         if ($default) {
             $this->dialogName = $name;
         }
         return true;
     }
     if ($default) {
         // do exit
         require_once WPRO_DIR . 'core/libs/wproMessageExit.class.php';
         $msg = new wproMessageExit();
         $msg->msgCode = WPRO_CRITICAL;
         $msg->msg = 'No dialog or incorrect dialog specified.';
         $msg->alert();
         exit;
     } else {
         return false;
     }
 }