예제 #1
0
파일: plugin.php 프로젝트: ioanok/symfoxid
 function displayRemoteOptions($prefix)
 {
     global $DIALOG;
     $tpl = new wproTemplate();
     $tpl->assign('prefix', $prefix);
     $DIALOG->assignCommonVarsToTemplate($tpl);
     return $tpl->fetch(dirname(__FILE__) . '/form.tpl.php');
 }
 function make()
 {
     $tpl = new wproTemplate();
     $tpl->templates = $this->template->templates;
     $tpl->bulkAssign(array('selected' => $this->selected, 'options' => $this->options, 'label' => $this->label, 'UID' => 'ddUI' . $this->uid, 'onChange' => $this->onChange));
     $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UIDropDown.tpl.php');
     if ($this->uid == 1) {
         $output = '<script type="text/javascript" src="core/js/wproUISelect_src.js"></script>' . $output;
     }
     return $output;
 }
 function make()
 {
     $tpl = new wproTemplate();
     $tpl->templates = $this->template->templates;
     $tpl->bulkAssign(array('name' => $this->name, 'color' => $this->color, 'UID' => 'cpUI' . $this->uid, 'onChange' => $this->onChange, 'showInput' => $this->showInput, 'accessKey' => $this->accessKey));
     $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UIColorPicker.tpl.php');
     if ($this->uid == 1) {
         $output = '<script type="text/javascript" src="core/js/wproUIColorPicker_src.js"></script>' . $output;
     }
     return $output;
 }
 function make()
 {
     global $DIALOG, $EDITOR;
     $tpl = new wproTemplate();
     $tpl->templates = $this->template->templates;
     $tpl->bulkAssign(array('headContent' => &$DIALOG->headContent, 'EDITOR' => &$EDITOR, 'name' => $this->name, 'UID' => 'irUI' . $this->uid, 'options' => $this->options, 'onChange' => $this->onChange, 'selected' => $this->selected, 'width' => $this->width, 'height' => $this->height));
     $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UIImageRadio.tpl.php');
     if ($this->uid == 1) {
         $output = '<script type="text/javascript" src="core/js/wproUIImageRadio_src.js"></script>' . $output;
     }
     return $output;
 }
예제 #5
0
    function make()
    {
        $tpl = new wproTemplate();
        $tpl->templates = $this->template->templates;
        $tpl->bulkAssign(array('nodes' => $this->nodes, 'UID' => 'treeUI' . $this->uid, 'editorURL' => $this->template->editorURL, 'themeURL' => $this->template->themeURL, 'width' => $this->width, 'height' => $this->height));
        $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UITree.tpl.php');
        if ($this->uid == 1) {
            $this->template->addOutputFilter('wproTemplate_UITree_outputfilter');
            $output = '<script type="text/javascript" src="core/js/COOLjsTreePro/cooltreepro.js"></script>
			<script type="text/javascript" src="core/js/COOLjsTreePro/tree_format.js"></script>' . $output;
        }
        return $output;
    }
 function make()
 {
     // close any unclosed tabs
     /*$o = array_reverse($this->options);
     		foreach ($o as $k=>$v) {
     			if ($v == '##capture##') {
     				$this->options[$label] = ob_get_contents();
     				ob_end_clean();
     			}
     		}*/
     $tpl = new wproTemplate();
     $tpl->templates = $this->template->templates;
     $tpl->bulkAssign(array('selected' => $this->selected, 'options' => $this->options, 'attributes' => $this->attributes, 'onswap' => $this->onswap, 'UID' => 'tUI' . $this->uid));
     $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UITabbed.tpl.php');
     if ($this->uid == 1) {
         $output = '<script type="text/javascript" src="core/js/wproUITabbed_src.js"></script>' . $output;
     }
     return $output;
 }
예제 #7
0
    function make()
    {
        global $mainframe;
        $url = wysiwygPro::stripTrailingSlash($mainframe->isAdmin() ? $mainframe->getSiteURL() : JURI::base());
        $tpl = new wproTemplate();
        //$tpl->templates = $this->template->templates;
        $tpl->bulkAssign(array('nodes' => $this->nodes, 'UID' => 'treeUI' . $this->uid, 'editorURL' => $url . '/plugins/editors/wysiwygPro3/wysiwygPro/', 'themeURL' => $url . '/plugins/editors/wysiwygPro3/wysiwygPro/themes/default/wysiwygpro/', 'width' => $this->width, 'height' => $this->height));
        $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UITree.tpl.php');
        //if ($this->uid==1) {
        $output = '<script type="text/javascript" src="' . $url . '/plugins/editors/wysiwygPro3/wysiwygPro/core/js/COOLjsTreePro/cooltreepro.js"></script>
			<script type="text/javascript" src="' . $url . '/plugins/editors/wysiwygPro3/wysiwygPro/core/js/COOLjsTreePro/tree_format.js"></script>' . $output;
        //}
        return $output;
    }
예제 #8
0
파일: dialog.php 프로젝트: ioanok/symfoxid
 function displayFolderList($folderId = 0, $folderPath = '', $page = 1, $sortBy = 'name', $sortDir = 'asc', $view = 'default', $highlight = array(), $history = true, &$response, $noError = false)
 {
     global $EDITOR, $DIALOG, $WPRO_SESS;
     // initial var check...
     if (!$response) {
         $response = $DIALOG->createAjaxResponse();
     }
     if (!is_string($folderId) && !is_int($folderId) || !is_string($folderPath) || !is_array($highlight)) {
         $response->addAlert('Datatype error.');
         $response->addScriptCall("FB.onFolderNotFound", "");
         return $response;
     }
     $page = intval($page);
     if ($page == 0) {
         $page = 1;
     }
     $pageLength = 100;
     if ($arr = $this->getFolder($folderId, $folderPath, $response, $noError)) {
         $directory = $arr['directory'];
         $URL = $arr['URL'];
         $dir = $arr['dir'];
         if ($arr['changed']) {
             $highlight = array();
         }
         $tpl = new wproTemplate();
         // if images, should we display thumbnails
         if ($EDITOR->thumbnails && $dir->type == 'image') {
             if ($view == 'default') {
                 $view = $EDITOR->defaultImageView;
             }
             $thumbnails = $view == 'thumbnails' ? true : false;
             if ($thumbnails) {
                 $params['sortBy'] = 'name';
                 $params['sortDir'] = 'asc';
             }
         } else {
             $thumbnails = false;
         }
         // get sort by and sort direction
         // get and validate sorting
         /*if (isset ($params['sortBy'])) {
         			$sortBy = $params['sortBy'];
         		} else {
         			$sortBy = 'name';
         		}*/
         if ($sortBy != 'name' && $sortBy != 'type' && $sortBy != 'modified' && $sortBy != 'size') {
             $sortBy = 'name';
         }
         /*if (isset ($params['sortDir'])) {
         			$sortDir = $params['sortDir'];
         		} else {
         			$sortDir = 'asc';
         		}*/
         if ($sortDir != 'asc' && $sortDir != 'desc') {
             $sortDir = 'asc';
         }
         $folderSortBy = 'name';
         if ($sortBy != 'name') {
             $folderSortDir = 'asc';
         } else {
             $folderSortDir = $sortDir;
         }
         $tpl->assign('sortBy', $sortBy);
         $tpl->assign('sortDir', $sortDir);
         //if (isset($params['doHistory'])) {
         //$DIALOG->template->assign('doHistory', false);
         //} else {
         //$DIALOG->template->assign('doHistory', true);
         //}
         // build a standard URL base to use with everything.
         $urlBase = $this->getURLBase($dir->id, $folderPath);
         // display the file list
         // what types of files to display?
         $fileTypes = array();
         switch ($dir->type) {
             case 'image':
                 $fileTypes = $EDITOR->allowedImageExtensions;
                 break;
             case 'media':
                 $fileTypes = $EDITOR->allowedMediaExtensions;
                 break;
             case 'document':
             default:
                 $fileTypes = $EDITOR->allowedDocExtensions;
                 break;
         }
         $fs = new wproFilesystem();
         if ($dir->type == 'image') {
             $getDimensions = true;
         } else {
             $getDimensions = false;
         }
         // get the list of folders and files
         $files = $fs->getFilesInDir($directory, $sortBy, $sortDir, $fileTypes, $dir->filters, $getDimensions);
         // if images then we need to build the thumbnails!
         if ($thumbnails && count($files)) {
             if (!$this->buildThumbnails($directory, $URL, $files, $urlBase)) {
                 $thumbnails = false;
             }
         }
         // build folders afterwards so that thumbnail folder is included.
         $folders = $fs->getFoldersInDir($directory, $folderSortBy, $folderSortDir, $dir->filters);
         $total = count($files) + count($folders);
         $numPages = ceil($total / $pageLength);
         // check for selected files and adjust current page if there is only one file selected.
         if (count($highlight) && $numPages > 1) {
             // OK, flip through the pages until we find the file.
             $j = 0;
             $found = false;
             $num = count($folders);
             for ($i = 0; $i < $num; $i++) {
                 if (in_array($folders[$i]['name'], $highlight)) {
                     $j = $i;
                     $found = true;
                     break;
                 }
             }
             if (!$found) {
                 $num = count($files);
                 for ($i = 0; $i < $num; $i++) {
                     if (in_array($files[$i]['name'], $highlight)) {
                         $j = $i;
                         break;
                     }
                 }
             }
             $page = ceil($j / $pageLength);
             if ($page == 0) {
                 $page = 1;
             }
         }
         // sanitize current page
         $page = intval($page);
         while ($page > $numPages) {
             $page--;
         }
         $start = $page * $pageLength - $pageLength;
         $end = $start + $pageLength;
         if ($end > $total) {
             $end = $total;
         }
         $tpl->assign('pageStart', $start);
         // no at page start
         $tpl->assign('pageEnd', $end);
         // no at page end
         $tpl->assign('pageCurrent', $page);
         // current page
         $tpl->assign('pageNumPages', $numPages);
         // number of pages
         $tpl->assign('pageLength', $pageLength);
         // length of each page
         $tpl->assign('pageTotal', $total);
         // total no of files
         $tpl->assign('dir', $dir);
         $tpl->assign('thumbnails', $thumbnails);
         $tpl->assign('folders', $folders);
         $tpl->assign('files', $files);
         $tpl->assign('folderID', $dir->id);
         $tpl->assign('folderPath', $folderPath);
         $tpl->assign('folderURL', $URL);
         $tpl->assign('sortBy', $sortBy);
         $tpl->assign('sortDir', $sortDir);
         $tpl->assign('highlight', $highlight);
         $tpl->assign('doHistory', false);
         /* generic assigns */
         /*$tpl->assignByRef('EDITOR', $EDITOR);
         		$tpl->assignByRef('langEngine', $EDITOR->langEngine);
         		$tpl->bulkAssign(array(
         			'themeURL' => $EDITOR->themeFolderURL.$EDITOR->theme.'/',
         			'editorURL' => $EDITOR->editorURL,
         			'langURL' => $EDITOR->langFolderURL.$DIALOG->langEngine->actualLang.'/',
         		));*/
         $DIALOG->assignCommonVarsToTemplate($tpl);
         /* end */
         $html = $tpl->fetch(WPRO_DIR . 'core/plugins/wproCore_fileBrowser/tpl/files.tpl.php');
         //$response->addAlert($html);
         // nonce
         $nonce = md5(uniqid(rand(), true));
         $response->addScriptCall("FB.setNonce", $nonce);
         $WPRO_SESS->addNonce($nonce, time() + 3600);
         $response->addAssign("folderFrame", "innerHTML", $html);
         $response->addScriptCall("FB.onLoadFolder", $history);
     } else {
         $response->addScriptCall("FB.onFolderNotFound", "");
     }
     return $response;
 }
예제 #9
0
 function display()
 {
     global $EDITOR, $WPRO_EDITOR_URL;
     $this->_setDefaults();
     require_once WPRO_DIR . 'core/libs/wproTemplate.class.php';
     if (empty($this->options)) {
         $this->options = array(array('type' => 'submit', 'name' => 'ok', 'value' => $this->getLang('ok', 'OK')), array('type' => 'submit', 'name' => 'cancel', 'value' => $this->getLang('cancel', 'Cancel')));
     }
     if (empty($EDITOR)) {
         //exit ($_SERVER['REQUEST_URI']);
         $iframeDialogs = false;
         $frameID = 0;
         if (defined('WPRO_IN_ROUTE')) {
             $editorURL = wproRoute::getEditorURL();
         } else {
             $editorURL = $WPRO_EDITOR_URL;
         }
         $themeURL = $this->varReplace(WPRO_THEME_URL, array('EDITOR_URL' => $WPRO_EDITOR_URL)) . WPRO_THEME . '/wysiwygpro';
         $tpl = new wproTemplate();
         $tpl->path = WPRO_DIR . 'core/tpl/';
         if (isset($_GET['iframe'])) {
             $iframeDialogs = true;
         }
         if (isset($_GET['dialogFrameID'])) {
             $iframeDialogs = true;
             $frameID = intval($_GET['dialogFrameID']);
         }
         if (isset($_GET['dialogOpenerID'])) {
             $openerID = intval($_GET['dialogOpenerID']);
         } else {
             $openerID = null;
         }
     } else {
         require_once WPRO_DIR . 'core/libs/wproDialog.class.php';
         $DIALOG = new wproDialog();
         $tpl =& $DIALOG->template;
         $DIALOG->bodyInclude = WPRO_DIR . 'core/tpl/messageExitBody.tpl.php';
         $DIALOG->title = $this->title;
         $DIALOG->options = $this->options;
         $DIALOG->chromeless = $this->chromeless;
         if (isset($_GET['iframe'])) {
             $iframeDialogs = true;
         }
         if (isset($_GET['dialogFrameID'])) {
             $iframeDialogs = true;
             $DIALOG->frameID = intval($_GET['dialogFrameID']);
         }
         if (isset($_GET['dialogOpenerID'])) {
             $DIALOG->openerID = intval($_GET['dialogOpenerID']);
         }
         $editorURL = $EDITOR->editorURL;
         $themeURL = $EDITOR->themeFolderURL . $EDITOR->theme . '/wysiwygpro';
         $iframeDialogs = $EDITOR->iframeDialogs;
         $frameID = $DIALOG->frameID;
         $openerID = $DIALOG->openerID;
     }
     $tpl->bulkAssign(array('iframeDialogs' => $iframeDialogs, 'frameID' => $frameID, 'openerID' => $openerID, 'editorURL' => $editorURL, 'themeURL' => $themeURL, 'hidden' => $this->hidden, 'jsAction' => $this->jsAction, 'action' => $this->action, 'title' => $this->title, 'icon' => $this->icon, 'options' => $this->options, 'msg' => $this->msg));
     /**  
      * Echo the results.  
      */
     if (empty($EDITOR)) {
         $tpl->display('messageExit.tpl.php');
     } else {
         $DIALOG->display();
     }
     exit;
 }