Example #1
0
 function getHTML($id)
 {
     $this->loadMeOrEmpty();
     $gui = new HTMLGUI2();
     $gui->setObject($this);
     $gui->setName("RSSFilter");
     $gui->setShowAttributes(array("RSSFilterName", "RSSFilterFeed", "RSSFilterAdapter", "RSSFilterJDID", "RSSFilterAutoDL", "RSSFilterProviderRapidshare", "RSSFilterProviderNetload", "RSSFilterProviderUploaded"));
     $gui->setLabel("RSSFilterName", "Name");
     $gui->setLabel("RSSFilterFeed", "Feed URL");
     $gui->setLabel("RSSFilterAdapter", "Adapter");
     $gui->setLabel("RSSFilterJDID", "DL with");
     $gui->setLabel("RSSFilterProviderRapidshare", "Rapidshare.com");
     $gui->setLabel("RSSFilterProviderNetload", "Netload");
     $gui->setLabel("RSSFilterProviderUploaded", "Uploaded");
     $gui->setLabel("RSSFilterAutoDL", "Auto-DL?");
     $gui->setType("RSSFilterProviderRapidshare", "checkbox");
     $gui->setType("RSSFilterProviderNetload", "checkbox");
     $gui->setType("RSSFilterAutoDL", "checkbox");
     $gui->setType("RSSFilterProviderUploaded", "checkbox");
     $gui->insertSpaceAbove("RSSFilterJDID");
     $gui->setFieldDescription("RSSFilterAutoDL", "Currently only works when using JDownloader RC, Qnap and pyLoad. Will have no effect otherwise.");
     $gui->selectWithCollection("RSSFilterJDID", new mJDGUI(), "JDName", "nicht herunterladen");
     $gui->setStandardSaveButton($this);
     $Tab = new HTMLSideTable("right");
     $B = new Button("show filtered\nfeed", "./trinityDB/RSSFilter/Filtered.png");
     $B->onclick("window.open('./trinityDB/RSSFilter/FilteredFeed.php?RSSFilterID=" . $this->getID() . "', 'Filtered feed');");
     $Tab->addRow($B);
     $FB = new FileBrowser();
     $FB->addDir(Util::getRootPath() . "trinityDB/RSSFilter");
     $Adapters = $FB->getAsLabeledArray("iFeedFilter", ".class.php", true);
     $gui->setType("RSSFilterAdapter", "select");
     $gui->setOptions("RSSFilterAdapter", array_values($Adapters), array_keys($Adapters));
     return $Tab . $gui->getEditHTML();
 }
Example #2
0
 function getHTML($id)
 {
     $this->loadMeOrEmpty();
     $gui = new HTMLGUIX($this);
     $gui->name("DL");
     $gui->attributes(array("JDDLType", "JDName", "JDHost", "JDPort", "JDUser", "JDPassword", "JDWgetFilesDir", "JDLinkParser", "JDLinkParserUser", "JDLinkParserPassword"));
     $gui->label("JDDLType", "Type");
     $gui->label("JDName", "Name");
     $gui->label("JDHost", "Host");
     $gui->label("JDPort", "Port");
     $gui->label("JDUser", "User");
     $gui->label("JDPassword", "Password");
     $gui->label("JDWgetFilesDir", "Wget files dir");
     $gui->label("JDLinkParser", "Parser");
     $gui->label("JDLinkParserUser", "User");
     $gui->label("JDLinkParserPassword", "Password");
     $gui->descriptionField("JDPort", "Default: JD Web 8765; QNap 8080; JD RC 10025; pyLoad 7227");
     $gui->space("JDUser");
     $gui->space("JDLinkParser", "Link");
     $FB = new FileBrowser();
     $FB->addDir(__DIR__);
     $gui->type("JDLinkParser", "select", array_merge(array("" => "None"), $FB->getAsLabeledArrayF("iLinkParser", ".class.php", true)));
     $gui->type("JDDLType", "select", array("JDownloader Web", "QNap Downloader", "JDownloader RC", "pyLoad", "wget"));
     $gui->toggleFields("JDDLType", "4", array("JDWgetFilesDir"), array("JDHost", "JDPort", "JDUser", "JDPassword"));
     $B = $gui->addSideButton("test\ndownload", "./trinityDB/JD/testLink.png");
     $B->popup("testLink", "test link", "JD", $this->getID(), "testDownloadPopup");
     return $gui->getEditHTML();
 }
Example #3
0
 /**
  * @return iCorporateDesign
  */
 public static function getCorporateDesign()
 {
     try {
         $FB = new FileBrowser();
         $FB->addDir(FileStorage::getFilesDir());
         $FB->addDir(Util::getRootPath() . "specifics");
         $T = $FB->getAsLabeledArray("iCorporateDesign", ".class.php");
         foreach ($T as $c) {
             $CD = new $c();
             break;
         }
         #throw new ClassNotFoundException();
     } catch (ClassNotFoundException $e) {
         $CD = new CorporateDesign();
     }
     return $CD;
 }
 public function getHTML($id)
 {
     $gui = new HTMLGUI();
     $gui->VersionCheck($this->getClearClass());
     $t = new HTMLTable(2, $this->tableLabel);
     $t->addColStyle(1, "width:20px;");
     $FB = new FileBrowser();
     $FB->addDir($this->directory);
     $w = $FB->getAsLabeledArray("iFileBrowser", ".class.php");
     foreach ($w as $k => $v) {
         $B = new Button("", "./images/i2/edit.png");
         $B->type("icon");
         $B->onclick("contentManager.loadFrame('contentLeft','{$v}');");
         $t->addRow(array($B, "{$k}"));
     }
     return $t->getHTML();
 }
Example #5
0
 public function getHTML($id)
 {
     $gui = new HTMLGUI();
     $gui->VersionCheck("mTool");
     $FB = new FileBrowser();
     $FB->addDir("../PM/GoD");
     $files = $FB->getAsLabeledArray("iPMTool", ".class.php", true);
     $tab = new HTMLTable(2, "Tools");
     $tab->setColWidth(1, "20px");
     foreach ($files as $key => $value) {
         $B = new Button("", "./images/i2/edit.png");
         $B->type("icon");
         $B->onclick("loadFrameV2('contentLeft','{$value}');");
         $tab->addRow(array($B, $key));
     }
     return $tab;
 }
Example #6
0
 function getHTML($id)
 {
     $gui = new HTMLGUIX($this);
     $gui->name("RSSParser");
     $FB = new FileBrowser();
     $FB->addDir(dirname(__FILE__));
     $P = array_merge(array("" => "kein Parser"), array_flip($FB->getAsLabeledArray("iRSSParser", ".class.php")));
     $FB = new FileBrowser();
     $FB->addDir(dirname(__FILE__));
     $PD = array_merge(array("" => "kein Parser"), array_flip($FB->getAsLabeledArray("iRSSDataParser", ".class.php")));
     $fields = array("RSSParserName", "RSSParserURL", "RSSParserPOST", "RSSParserDataParserClass", "RSSParserUseCache", "RSSParserLastUpdate", "RSSParserCache");
     if (Applications::activeApplication() == "fheME") {
         $fields[] = "RSSParserParserClass";
         $fields[] = "RSSParserOnCall";
         $fields[] = "RSSParserCount";
     }
     $gui->attributes($fields);
     $gui->type("RSSParserParserClass", "select", $P);
     $gui->type("RSSParserDataParserClass", "select", $PD);
     $gui->type("RSSParserUseCache", "checkbox");
     $gui->type("RSSParserPOST", "textarea");
     $gui->label("RSSParserParserClass", "Parser");
     $gui->label("RSSParserOnCall", "Button");
     $gui->label("RSSParserCount", "Anzahl");
     $gui->label("RSSParserDataParserClass", "Data-Parser");
     $gui->descriptionField("RSSParserUseCache", "Der Cache funktioniert nur zusammen mit dem cronjob");
     $gui->descriptionField("RSSParserPOST", "Format: Jeweils ein Name:Wert pro Zeile<br>Variablen: \$timestampToday");
     $gui->parser("RSSParserLastUpdate", "parserLastUpdate");
     $gui->parser("RSSParserCache", "parserCache");
     $gui->descriptionField("RSSParserParserClass", "Der Parser kann die Anzeige des Feeds anpassen");
     $gui->descriptionField("RSSParserDataParserClass", "Der Parser kann die Daten des Feeds anpassen");
     $gui->descriptionField("RSSParserOnCall", "Der Feed wird mit einem eigenen Button geöffnet");
     $gui->descriptionField("RSSParserCount", "Die maximale Anzahl der angezeigten Einträge. 0 zeigt alle");
     #$gui->type("RSSParserLastUpdate", "hidden");
     $gui->type("RSSParserOnCall", "checkbox");
     $B = $gui->addSideButton("Update", "down");
     $B->rmePCR("RSSParser", $this->getID(), "download", "", OnEvent::reload("Left"));
     #if($this->A("RSSParserCache") != ""){
     #	$B = $gui->addSideButton("XML\nvalidieren", "new");
     #	$B->popup("", "XML validieren", "RSSParser", $this->getID(), "validate");
     #}
     return $gui->getEditHTML();
 }
Example #7
0
 public function testValidResultFiles()
 {
     $result = json_decode(FileBrowser::getFolderContent(''), true);
     foreach ($result as $file_info) {
         if ($file_info['type'] == 'dir') {
             $this->assertTrue(is_dir($file_info['path']));
         } else {
             if ($file_info['type'] == 'file') {
                 $this->assertTrue(is_file($file_info['path']));
             }
         }
     }
 }
Example #8
0
    function html_edit_form()
    {
        /*
        get the item id and oncology
        build the ui form based on oncology and retrieved item data
        */
        $html_form = "";
        // get default item properties
        $s_id = urldecode($this->o_loaded_item_object->id);
        $s_title = urldecode($this->o_loaded_item_object->title);
        $s_keywords = urldecode($this->o_loaded_item_object->keywords);
        $s_description = urldecode($this->o_loaded_item_object->description);
        $s_parent = urldecode($this->o_loaded_item_object->parent);
        $s_url = urldecode($this->o_loaded_item_object->url);
        $b_published = urldecode($this->o_loaded_item_object->published);
        $s_checked = urldecode($this->o_loaded_item_object->url_auto);
        $s_template = urldecode($this->o_loaded_item_object->template);
        $s_published_class = "";
        $s_unpublished_class = "";
        $s_url_input_disabled = "";
        if ($b_published === "true") {
            $s_published_class = "disabled ";
        } else {
            $s_unpublished_class = "disabled ";
        }
        if ($s_checked === "true") {
            $s_checked = " checked";
            $s_url_input_disabled = " disabled";
        }
        # start button group
        $html_form .= '<div class="btn-group edit_item_general_toolbar">';
        // preview
        $html_form .= '<a class="btn btn-default btn-sm" href="#" id="preview_edits"><i class="glyphicon glyphicon-expand"></i><span class="small-hidden"> preview</span></a>';
        /*
        $html_form .= '<a disabled class="btn btn-default btn-sm" href="#"><i class="glyphicon glyphicon-fire"></i><span class="small-hidden"> purge from cache</span></a>';
        */
        // view (open in new tab)
        $oUrlStuff = new UrlStuff();
        $s_view_url = $oUrlStuff->s_format_url_from_item_url($s_url);
        $html_form .= '<a target="_blank" ' . $s_unpublished_class . 'class="btn btn-default btn-sm" href="' . $s_view_url . '"><i class="glyphicon glyphicon-eye-open"></i><span class="small-hidden"> view</span></a>';
        # end button group
        $html_form .= '</div>';
        # published toggle
        $html_form .= '<div class="btn-group edit_item_general_toolbar">';
        $html_form .= '<a class="btn btn-success btn-sm" ' . $s_published_class . 'href="javascript:publish(\'published\');"><i class="glyphicon glyphicon-cloud-upload"></i> save &amp; publish</a>';
        $html_form .= '<a class="btn btn-warning btn-sm" ' . $s_unpublished_class . 'href="javascript:publish(\'unpublished\');"><i class="glyphicon glyphicon-cloud-download"></i> unpublish</a>';
        $html_form .= '</div>';
        // delete button group
        $html_form .= '<div class="btn-group">';
        // delete
        $html_form .= '<a class="btn btn-danger btn-sm" href="/flot_flot/admin/index.php?section=items&oncology=page&item=' . $s_id . '&action=delete"><i class="glyphicon glyphicon-trash"></i><span class="small-hidden"> delete</span></a>';
        $html_form .= '</div>';
        $html_form .= '<div id="publish_output"></div><hr/>';
        $html_form .= '<div class="alert alert-info">Edit the fields on this page and save for them to be visible on your site. There are settings for SEO on the Extra tab. You can copy paste the embed codes from the Embed tab, into your template, if you haven\'t already</div>';
        $html_form .= '<form id="item_edit_form" role="form" method="post" action="index.php">';
        #
        # make tabs
        #
        # tab menu
        $html_form .= '<ul class="nav nav-tabs">';
        $html_form .= '<li class="active"><a href="#edit" data-toggle="tab">Edit</a></li>';
        $html_form .= '<li><a href="#extra" data-toggle="tab">Extra</a></li>';
        $html_form .= '<li><a href="#codes" data-toggle="tab">Embed codes</a></li>';
        $html_form .= '</ul>';
        # tabs
        $html_form .= '<div class="tab-content">';
        #
        # edit tab
        #
        $html_form .= '<div class="tab-pane active" id="edit">';
        # title
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_keywords">Title</label><input type="text" class="form-control" name="title" placeholder="page title" value="' . $s_title . '" id="item_edit_title">';
        $html_form .= '</div>';
        # url
        $html_form .= '<div id="url_input" class="input-group input-group-sm">';
        $html_form .= '<span class="input-group-addon">';
        $html_form .= '<input id="item_edit_auto_url" name="url_auto" ' . $s_checked . ' value="true" type="checkbox"> set url for me';
        $html_form .= '</span>';
        $html_form .= '<input type="text" id="item_edit_url" class="form-control item_edit_url" placeholder="relative url" value="' . $s_url . '"' . $s_url_input_disabled . '>';
        //$html_form .= '<span class="input-group-btn"><button class="btn btn-default" type="button"></button></span>';
        $s_make_home_page_disabled = '';
        if ($s_url === "index.html") {
            $s_make_home_page_disabled = ' disabled';
        }
        $html_form .= '<span class="input-group-btn"><a class="btn btn-default btn-sm' . $s_make_home_page_disabled . '" href="javascript:_make_home_page();"><i class="glyphicon glyphicon-home"></i><span class="small-hidden">&nbsp;make homepage</span></a></span>';
        $html_form .= '</div><!-- /input-group -->';
        $html_form .= '<hr/>';
        //
        // oncology specific elements
        //
        foreach ($this->o_oncology->full_elements as $element) {
            $html_form .= '<label class="form-group">' . $element->name . '</label><br/>';
            $s_value = '';
            if (isset($this->o_full_item_object[$element->name])) {
                $s_value = urldecode($this->o_full_item_object[$element->name]);
            }
            $s_disabled_status = "";
            if ($element->editable === "false") {
                $s_disabled_status = " disabled ";
            }
            switch ($element->type) {
                case 'html':
                    $html_form .= '<textarea id="' . $element->type . $element->name . '" class="ckeditor" name="' . $element->name . '"' . $s_disabled_status . '>' . $s_value . '</textarea><br/>';
                    break;
                case 'text':
                    $html_form .= '<input type="text" class="form-control" name="' . $element->name . '" value="' . $s_value . '" placeholder="' . $element->name . '"' . $s_disabled_status . '/>';
                    break;
                case 'text_multiline':
                    $html_form .= '<textarea rows="6" id="' . $element->type . $element->name . '" class="form-control" name="' . $element->name . '"' . $s_disabled_status . '>' . $s_value . '</textarea><br/>';
                    break;
                default:
                    $html_form .= "flot doesn't support this type :(<br/>";
                    break;
            }
        }
        # end edit tab
        $html_form .= '</div>';
        #
        # 'extra' tab
        #
        $html_form .= '<div class="tab-pane" id="extra">';
        # keywords
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_keywords">Keywords (comma seperated)</label><input id="item_keywords" type="text" class="form-control" name="keywords" placeholder="keywords" value="' . $s_keywords . '">';
        $html_form .= '</div>';
        # description
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_description">Description</label><input type="text" class="form-control" name="description" id="item_description" placeholder="description" value="' . $s_description . '">';
        $html_form .= '</div>';
        # template
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_template">Template</label>';
        $html_form .= '<select name="template" class="form-control" id="item_template">';
        $sa_files = $this->datastore->sa_templates_available();
        foreach ($sa_files as $s_template_file) {
            $s_selected = '';
            if ($s_template_file === $s_template) {
                $s_selected = 'selected ';
            }
            $html_form .= '<option ' . $s_selected . 'value="' . $s_template_file . '" >' . $s_template_file . '</option>';
        }
        $html_form .= '</select>';
        $html_form .= '</div>';
        # parent
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_parent">Parent</label>';
        $html_form .= '<select name="parent" class="form-control" id="item_parent">';
        $html_form .= '<option value=""></option>';
        $oa_partial_items = $this->datastore->sa_get_pages_except($s_id);
        foreach ($oa_partial_items as $item_id => $item_value) {
            $s_selected = '';
            if ($item_id === $s_parent) {
                $s_selected = 'selected ';
            }
            $html_form .= '<option ' . $s_selected . 'value="' . $item_id . '" >' . $item_value . '</option>';
        }
        $html_form .= '</select>';
        $html_form .= '</div>';
        # end extra tab
        $html_form .= '</div>';
        #
        # 'codes' tab
        #
        $html_form .= '<div class="tab-pane" id="codes">';
        // info
        $html_form .= '<div class="alert alert-info"><strong>Embed codes</strong> can be placed in your websites theme, they will be replaced with the pages actual content, which can be set by editing a page.</div>';
        // default types
        $html_form .= '<h4>Title</h4>';
        $html_form .= '<kbd>{{item:title}}</kbd>';
        $html_form .= '<h4>Description</h4>';
        $html_form .= '<kbd>{{item:description}}</kbd>';
        $html_form .= '<h4>Keywords</h4>';
        $html_form .= '<kbd>{{item:keywords}}</kbd>';
        $html_form .= '<hr/>';
        // custom types
        if (count($this->o_oncology->full_elements) > 0) {
            foreach ($this->o_oncology->full_elements as $element) {
                $html_form .= '<h4>' . ucfirst($element->name) . ' (' . $element->type . ')</h4>';
                $html_form .= '<kbd>{{item:' . $element->name . '}}</kbd>';
            }
        } else {
            $html_form .= '<p>this page type has no custom elements.</p>';
        }
        $html_form .= '<hr/>';
        # end extra tab
        $html_form .= '</div>';
        # end tabs
        $html_form .= '</div>';
        # hidden elements
        $html_form .= '<input id="published" type="hidden" name="published" value="' . $b_published . '">';
        $html_form .= '<input type="hidden" name="section" value="items">';
        $html_form .= '<input type="hidden" class="item_edit_url" name="url" value="' . $s_url . '">';
        $html_form .= '<input type="hidden" name="item_id" value="' . $s_id . '">';
        # save
        $html_form .= '<div class="form-group">';
        $html_form .= '<button type="submit" class="form-control btn btn-success"><i class="glyphicon glyphicon-floppy-disk"></i> save</button>';
        $html_form .= '</div>';
        $html_form .= '</form>';
        $html_form .= '<div id="file_browser_modal" class="modal fade">
			  <div class="container">
			    <div class="modal-content">			    	
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			        <h4 class="modal-title">Select a picture to insert</h4>
			      </div>
			      <div class="modal-body">
			      	Click a file to select it, you can upload new files too. Once files are selected you can click "insert pictures" or choose a different picture size from the drop up menu on the same button.<hr/>';
        $o_FileBrowser = new FileBrowser("select");
        $html_form .= $o_FileBrowser->html_make_browser();
        $html_form .= '</div>
			      <div class="modal-footer">
			      <div id="file_browser_selected"></div><hr/>
			        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
			        
			        <div class="btn-group dropup">
				        <button id="file_browser_insert_selected" onclick="insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'medium\')" type="button" class="disabled btn btn-success">Insert picture(s)</button>
				        <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
				          <span class="caret"></span>
				          <span class="sr-only">Toggle Dropdown</span>
				        </button>
				        <ul class="dropdown-menu" role="menu">
				        ';
        foreach ($this->datastore->settings->thumb_sizes as $size) {
            $html_form .= '<li><a href="javascript:insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'' . $size->name . '\');">' . $size->name . '</a></li>';
        }
        $html_form .= '<li><a href="javascript:insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'\');">original</a></li>
				        </ul>
				      </div>
			      </div>
			    </div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->';
        $jsiJSI = new JSInjector();
        $jsiJSI->_set_datastore($this->datastore);
        $html_form .= $jsiJSI->s_start_script();
        $html_form .= $jsiJSI->s_page_urls();
        $html_form .= $jsiJSI->s_end_script();
        return $html_form;
    }
Example #9
0
             # create the new item, then do a page change to be editing it
             $s_menu_id = $ufUf->s_get_var('menu', false);
             if ($s_menu_id) {
                 $flot->datastore->_delete_menu($s_menu_id);
                 $s_new_page = S_BASE_EXTENSION . "flot-admin/admin/index.php?section=menus&action=list";
                 $flot->_page_change($s_new_page);
             }
             break;
     }
     break;
 case "pictures":
     $s_action = $ufUf->s_get_var_from_allowed("action", array("select", "browse"), "browse");
     #
     # top menu
     #
     $o_FileBrowser = new FileBrowser($s_action);
     $html_main_admin_content .= $o_FileBrowser->html_make_browser();
     if ($s_action === "select") {
         echo $admin_ui->html_admin_headers_base();
         echo $admin_ui->html_admin_headers_pictures();
         echo $html_main_admin_content;
         exit;
     }
     break;
 case "settings":
     $html_main_admin_content = $admin_ui->html_make_settings_form($flot->datastore->settings);
     break;
 case "oncologies":
     $s_action = $ufUf->s_get_var_from_allowed("action", array("edit", "list", "new", "delete"), "list");
     switch ($s_action) {
         case 'edit':
Example #10
0
<?php

class FileBrowser
{
    public static $plugin;
    public static function bootstrap()
    {
        URLMap::from("/filebrowser/view/:type/", 'FileBrowser::display');
    }
    public static function display($args)
    {
        cc_admin_include('cc-users.php');
        Users::bootstrap();
        if (Users::isValid()) {
            //var_dump(self::$plugin->pluginPublicDir());
            cc_redirect(self::$plugin->pluginPublicDir() . "browser/");
        } else {
            cc_redirect(TH_PUB_ROOT);
        }
    }
}
FileBrowser::$plugin = new Plugin('File Browser', 'TopHat Team', 'Allows you to manage the files on your server.', '1.0');
FileBrowser::$plugin->bootstrap('FileBrowser::bootstrap');
Example #11
0
    {
        $path = $this->normalize($path);
        $this->ensureAccess($path);
        $name = basename($file['name']);
        $target = $path . $name;
        move_uploaded_file($file['tmp_name'], $target);
        header('Content-Type: application/json');
        $result = new FileBrowserEntry();
        $result->size = filesize($target);
        $result->name = $name;
        echo json_encode($result);
    }
}
// serve response
parse_str($_SERVER['QUERY_STRING'], $parameters);
$fileBrowser = new FileBrowser();
$action = $parameters['action'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $path = $fileBrowser->basePath() . (isset($_POST['path']) ? $_POST['path'] : '');
    $name = isset($_POST['name']) ? $_POST['name'] : '';
    if ($action == 'read') {
        $fileBrowser->getList($path);
    } elseif ($action == 'create') {
        $fileBrowser->create($path, $name);
    } elseif ($action == 'destroy') {
        $fileBrowser->destroy($path, $name);
    } elseif ($action == 'upload') {
        if (isset($_FILES['file'])) {
            $fileBrowser->saveFile($_FILES['file'], $path);
        }
    }
Example #12
0
<?php

require_once 'FileBrowser.class.php';
$path = filter_input(INPUT_GET, 'path');
FileBrowser::fileDownload($path);
Example #13
0
 * @package    
 * @author     Original Author Josè Joaquín Gamboa Sotelo
 * @author     Another Author jose_9515@hotmail.com
 * @copyright  1997-2005 The PHP Group
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
 * @version    SVN: $Id$
 * @link       http://pear.php.net/package/PackageName
 * @see        NetOther, Net_Sample::Net_Sample()
 * @since      File available since Release 1.2.0
 * @deprecated File deprecated in Release 2.0.0
 */
$defaul = '../';
if (!isset($_POST['dir'])) {
    $fileBrowser = new FileBrowser($defaul);
} else {
    $fileBrowser = new FileBrowser($defaul, $_POST['dir']);
}
$fileBrowser->SetExtensionFilter(array(".DS_Store", ".gitignore", ".version"));
$arrayFiles = $fileBrowser->Get();
@($itratorFiles = new ItemIterator($arrayFiles["files"]));
@($iteratorFolders = new ItemIterator($arrayFiles["folders"]));
?>
<ul class="jqueryFileTree" style="display: none;">
    <?php 
while ($iteratorFolders->valid()) {
    $name = $iteratorFolders->current()->getName();
    $path = $iteratorFolders->current()->getPath();
    ?>
        <li class="directory collapsed"><a href="" rel="<?php 
    echo $path;
    ?>
 function getHTML($id)
 {
     $type = "none";
     $U = new mUserdata();
     $U = $U->getUDValue("selectedDomain");
     $bps = $this->getMyBPSData();
     if ($bps != -1 and isset($bps["type"])) {
         $type = $bps["type"];
     }
     $this->loadMeOrEmpty();
     if ($id == -1) {
         if ($type != "none" and $type != "undefined") {
             $this->A->SeiteID = $type;
         }
     }
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Content");
     $gui->setType("contentType", "select");
     $gui->setOptions("contentType", array("text", "preset", "downloads", "php"), array("Text", "HTML-Vorlage", "Downloads", "PHP"));
     $FB = new FileBrowser();
     $FB->addDir("../specifics/");
     if ($_SESSION["S"]->checkForPlugin("mShop")) {
         $FB->addDir("../multiCMS/Shop/");
     }
     $a = $FB->getAsLabeledArray("iCustomContent", ".class.php");
     $gui->setLabel("customContent", "Inhalt");
     $gui->setType("customContent", "select");
     $gui->setOptions("customContent", array_values($a), array_keys($a));
     $Tab = new HTMLTable(1);
     if ($this->singular) {
         $gui->setType("sort", "hidden");
     } else {
         $B = new Button("zurück", "back");
         $B->onclick("contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . ");");
         $Tab->addRow($B);
     }
     $gui->setLabel("contentType", "Typ");
     $gui->setLabel("ContentImage", "Bild");
     $gui->setLabel("SeiteID", "Seite");
     $gui->setLabel("TemplateID", "Vorlage");
     $gui->setLabel("sort", "Sortierung");
     $gui->setFieldDescription("ContentImage", "Wird an Stelle des Parameters %%%IMAGE%%% eingesetzt.");
     #$gui->setType("header","hidden");
     $gui->insertSpaceAbove("contentType");
     #$gui->insertSpaceAbove("TemplateID","sonstiges", true);
     $gui->setInputJSEvent("contentType", "onchange", "Content.selectType(this);");
     $gui->setType("text", "HTMLEditor");
     if (Session::isPluginLoaded("mFile")) {
         $B = new Button("Bild auswählen", "./images/i2/add.png");
         $B->type("icon");
         $B->customSelect("contentRight", $this->ID, "mFile", "Content.selectImage");
         $gui->activateFeature("addCustomButton", $this, "ContentImage", $B);
     } else {
         $gui->setType("ContentImage", "hidden");
     }
     $gui->setShowAttributes(array("text", "ContentSpracheID", "ContentImage", "TemplateID", "header", "sort", "contentType", "presetTemplateID", "formHandlerID", "customContent"));
     $gui->setFormID("ContentForm");
     $S = new anyC();
     $S->setCollectionOf("Seite");
     $gui->selectWithCollection("SeiteID", $S, "name");
     $gui->setType("name", "hidden");
     $gui->setType("SeiteID", "hidden");
     $gui->setLabel("presetTemplateID", "Vorlage");
     $gui->setLabel("formHandlerID", "Handler");
     $gui->setLabel("ContentSpracheID", "Sprache");
     if (Session::isPluginLoaded("mSprache")) {
         $Sprachen = new anyC();
         $Sprachen->setCollectionOf("Sprache");
         $gui->selectWithCollection("ContentSpracheID", $Sprachen, "SpracheIdentifier", "alle");
     } else {
         $gui->setType("ContentSpracheID", "hidden");
     }
     $aC = new anyC();
     $aC->setCollectionOf("Template");
     $aC->addAssocV3("templateType", "=", "presetTemplate");
     $gui->selectWithCollection("presetTemplateID", $aC, "name");
     if ($_SESSION["S"]->checkForPlugin("mHandler")) {
         $handlerAC = new anyC();
         $handlerAC->setCollectionOf("Handler");
         $handlerAC->addAssocV3("HandlerDomainID", "=", $U);
         $gui->selectWithCollection("formHandlerID", $handlerAC, "HandlerName", "keiner");
     } else {
         $gui->setParser("formHandlerID", "ContentGUI::noHandlerParser");
     }
     if ($this->A->contentType != "preset") {
         $gui->setLineStyle("presetTemplateID", "display:none;");
         $gui->setLineStyle("formHandlerID", "display:none;");
     }
     if ($this->A->contentType != "php") {
         $gui->setLineStyle("customContent", "display:none;");
     }
     $T = new TemplatesGUI();
     $T->addAssocV3("templateType", "=", "contentTemplate");
     $T->addAssocV3("templateType", "=", "listTemplate", "OR");
     $T->addAssocV3("templateType", "=", "tableTemplate", "OR");
     $T->addAssocV3("templateType", "=", "dlTemplate", "OR");
     $T->addOrderV3("templateType");
     $TG = new TemplatesGUI();
     $cats = $TG->getAvailableCategories();
     $options = array();
     while ($o = $T->getNextEntry()) {
         $options[$o->getID()] = $cats[$o->getA()->templateType];
     }
     $T->resetPointer();
     $gui->selectWithCollection("TemplateID", $T, "name");
     $gui->selectOptgroup("TemplateID", $options);
     $gui->setJSEvent("onSave", "function() { contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . "); }");
     $gui->setStandardSaveButton($this);
     $gui->customize($this->customizer);
     return $Tab . $gui->getEditHTML();
 }
Example #15
0
<?php

require_once 'FileBrowser.class.php';
$path = filter_input(INPUT_GET, 'path');
echo FileBrowser::getFolderContent($path);
Example #16
0
<?php

require_once 'filebrowser.php';
/*
 * Add your filebrowser definition code here
 */
$rootPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR;
//set the root directory
$exensionFilter = array('php');
//set the filter
$currentPath = isset($_REQUEST['current_path']) ? $_REQUEST['current_path'] : NULL;
//get the current path from HTTP REQUEST
$arrFiles = FileBrowser::Factory($rootPath, $currentPath, $exensionFilter)->Get();
?>
<!doctype html>
<html lang="en">
 <head>
  <title>File browser</title>
 </head>
 <body>
     <div>
        <ul>
            <?php 
//display the parnet dir
if (isset($arrFiles['parent_dir']) && !empty($arrFiles['parent_dir'])) {
    ?>
            <li><a href="?current_path=<?php 
    echo $arrFiles['parent_dir'];
    ?>
">Parent</a></li>
            <?php 
Example #17
0
    function html_edit_form()
    {
        /*
        get the item id and oncology
        build the ui form based on oncology and retrieved item data
        */
        $html_form = "";
        // get default item properties
        $s_id = urldecode($this->o_loaded_element_object->id);
        $s_title = urldecode($this->o_loaded_element_object->title);
        $b_published = urldecode($this->o_loaded_element_object->published);
        $s_value = urldecode($this->o_full_element_object['content_html']);
        $s_published_class = "";
        $s_unpublished_class = "";
        if ($b_published === "true") {
            $s_published_class = "disabled ";
        } else {
            $s_unpublished_class = "disabled ";
        }
        # start button group
        $html_form .= '<div class="btn-group edit_item_general_toolbar">';
        # end button group
        $html_form .= '</div>';
        # published toggle
        $html_form .= '<div class="btn-group edit_item_general_toolbar">';
        $html_form .= '<a class="btn btn-success btn-sm" ' . $s_published_class . 'href="javascript:publish(\'published\');"><i class="glyphicon glyphicon-cloud-upload"></i> save &amp; publish</a>';
        $html_form .= '<a class="btn btn-warning btn-sm" ' . $s_unpublished_class . 'href="javascript:publish(\'unpublished\');"><i class="glyphicon glyphicon-cloud-download"></i> unpublish</a>';
        $html_form .= '</div>';
        // delete button group
        $html_form .= '<div class="btn-group">';
        // delete
        $html_form .= '<a class="disabled btn btn-danger btn-sm" href="/flot_flot/admin/index.php?section=items&oncology=page&item=' . $s_id . '&action=delete"><i class="glyphicon glyphicon-trash"></i><span class="small-hidden"> delete</span></a>';
        $html_form .= '</div>';
        $html_form .= '<div id="publish_output"></div><hr/>';
        $html_form .= '<div class="alert alert-info">Elements can be made and edited in one place, but used throughout your site on multiple pages or put directly in the template. Copy paste the embed code below and flot will replace it with the entered content.</div>';
        $html_form .= '<form id="element_edit_form" role="form" method="post" action="index.php">';
        #
        # edit element
        #
        $html_form .= '<div class="tab-pane active" id="edit">';
        # title
        $html_form .= '<div class="form-group input-group-sm">';
        $html_form .= '<label for="item_keywords">Title</label><input type="text" class="form-control" name="title" placeholder="page title" value="' . $s_title . '" id="item_edit_title">';
        $html_form .= '</div>';
        $html_form .= '<hr/>';
        //
        // oncology specific elements
        //
        $html_form .= '<textarea id="element_value" class="ckeditor" name="content_html">' . $s_value . '</textarea><br/>';
        // default types
        $html_form .= '<h4>Embed</h4>';
        $html_form .= '<kbd>{{element:' . $s_id . '}}</kbd>';
        $html_form .= '<hr/>';
        # hidden elements
        $html_form .= '<input id="published" type="hidden" name="published" value="' . $b_published . '">';
        $html_form .= '<input type="hidden" name="section" value="elements">';
        $html_form .= '<input type="hidden" name="element_id" value="' . $s_id . '">';
        # save
        $html_form .= '<div class="form-group">';
        $html_form .= '<button type="submit" class="form-control btn btn-success"><i class="glyphicon glyphicon-floppy-disk"></i> save</button>';
        $html_form .= '</div>';
        $html_form .= '</form>';
        $html_form .= '<div id="file_browser_modal" class="modal fade">
			  <div class="container">
			    <div class="modal-content">			    	
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			        <h4 class="modal-title">Select a picture to insert</h4>
			      </div>
			      <div class="modal-body">
			      	Click a file to select it, you can upload new files too. Once files are selected you can click "insert pictures" or choose a different picture size from the drop up menu on the same button.<hr/>';
        $o_FileBrowser = new FileBrowser("select");
        $html_form .= $o_FileBrowser->html_make_browser();
        $html_form .= '</div>
			      <div class="modal-footer">
			      <div id="file_browser_selected"></div><hr/>
			        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
			        
			        <div class="btn-group dropup">
				        <button id="file_browser_insert_selected" onclick="insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'medium\')" type="button" class="disabled btn btn-success">Insert picture(s)</button>
				        <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
				          <span class="caret"></span>
				          <span class="sr-only">Toggle Dropdown</span>
				        </button>
				        <ul class="dropdown-menu" role="menu">
				        ';
        foreach ($this->datastore->settings->thumb_sizes as $size) {
            $html_form .= '<li><a href="javascript:insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'' . $size->name . '\');">' . $size->name . '</a></li>';
        }
        $html_form .= '<li><a href="javascript:insert_selected_pictures(\'' . $this->datastore->settings->upload_dir . '\', \'\');">original</a></li>
				        </ul>
				      </div>
			      </div>
			    </div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->';
        return $html_form;
    }
Example #18
0
 function html_make_settings_form($jo_settings)
 {
     $html_form = "";
     $suSU = new SettingsUtilities();
     $html_form .= '<h4>Settings</h4>';
     $html_form .= '<div class="alert alert-info">Only some settings can be edited at the moment, if you feel confident you can edit theme directly in the settings datastore.</div><hr/>';
     $html_form .= '<form role="form" method="post" action="index.php">';
     #
     # make tabs
     #
     # tab menu
     $html_form .= '<ul class="nav nav-tabs">';
     $html_form .= '<li class="active"><a href="#general" data-toggle="tab">General</a></li>';
     $html_form .= '<li><a href="#images" data-toggle="tab">Images</a></li>';
     $html_form .= '<li><a href="#flot" data-toggle="tab">Flot</a></li>';
     $html_form .= '</ul>';
     # tabs
     $html_form .= '<div class="tab-content">';
     #
     # general tab
     #
     $html_form .= '<div class="tab-pane active" id="general">';
     # upload dir
     $html_form .= '<div class="form-group"><label for="setting_upload_dir">Upload folder (file path, relative from root)</label><input type="text" class="form-control input-sm" id="setting_upload_dir" placeholder="relative upload directory" disabled value="' . $jo_settings->upload_dir . '"></div>';
     # website name
     $html_form .= '<div class="form-group"><label for="setting_website_name">Website name</label><input type="text" name="site_name" class="form-control input-sm" id="setting_website_name" placeholder="website name" value="' . $jo_settings->site_name . '"></div>';
     # template
     $html_form .= '<div class="form-group input-group-sm">';
     $html_form .= '<label for="setting_theme_name">Theme</label>';
     $html_form .= '<select name="theme" class="form-control" id="settings_theme">';
     $file_utility = new FileBrowser();
     $sa_dirs = $file_utility->sa_themes_available();
     foreach ($sa_dirs as $s_theme_dir) {
         $s_selected = '';
         if ($s_theme_dir === $jo_settings->theme) {
             $s_selected = 'selected ';
         }
         $html_form .= '<option ' . $s_selected . 'value="' . $s_theme_dir . '" >' . $s_theme_dir . '</option>';
     }
     $html_form .= '</select>';
     $html_form .= '</div>';
     $html_form .= '</div>';
     #
     # images tab
     #
     $html_form .= '<div class="tab-pane" id="images">';
     # thumbs
     $html_form .= '<h5>Thumbnail sizes</h5>';
     foreach ($jo_settings->thumb_sizes as $o_thumb_size) {
         $html_form .= '<div class="row form-group"><div class="col-xs-12"><label>' . $o_thumb_size->name . '</label><input type="text" class="form-control" placeholder="" value="' . $o_thumb_size->name . '" disabled></div></div><div class="row form-group"><div class="col-xs-12 col-sm-6"><label>max width (blank for none)</label><input type="text" class="form-control" placeholder="" value="' . $o_thumb_size->max_width . '" disabled></div><div class="col-xs-12 col-sm-6"><label>max height (blank for none)</label><input type="text" class="form-control" placeholder="" value="' . $o_thumb_size->max_height . '" disabled></div></div>';
     }
     $html_form .= '</div>';
     #
     # flot tab
     #
     $html_form .= '<div class="tab-pane" id="flot">';
     $html_form .= '<table class="table table-condensed"><thead><tr><th>Property</th><th>Value</th></tr></thead><tbody>';
     // flot version
     $html_form .= '<tr><td>flot version</td><td><span class="label label-primary">' . $suSU->s_literal_flot_version() . '</span></td></tr>';
     // max execution time
     $html_form .= '<tr><td>PHP max execution time (seconds)</td><td>' . $suSU->i_max_execution_time() . '</td></tr>';
     // max input post time
     $html_form .= '<tr><td>PHP max input time (seconds)</td><td>' . $suSU->i_max_input_time() . '</td></tr>';
     // post_max_size
     $html_form .= '<tr><td>PHP post max size</td><td>' . $suSU->i_post_max_size() . '</td></tr>';
     // upload_max_filesize
     $html_form .= '<tr><td>PHP upload max filesize</td><td>' . $suSU->i_upload_max_filesize() . '</td></tr>';
     // www write perms
     $b_write_perms = $suSU->b_root_write_permission();
     $s_write_perms = $b_write_perms ? '<i class="green glyphicon glyphicon-ok"></i>' : '<i class="red glyphicon glyphicon-remove"></i>';
     $html_form .= '<tr><td>www write permission</td><td>' . $s_write_perms . '</td></tr>';
     /*
     if(!$b_write_perms){
     	foreach ($suSU->sa_unwritable_dirs as $s_path) {
     		$html_form .= $s_path.'<br/>';
     	}				
     }
     */
     // mod_rewrite enabled
     $b_mod_rewrite = $suSU->b_mod_rewrite_enabled();
     $s_mod_rewrite = $b_mod_rewrite ? '<i class="green glyphicon glyphicon-ok"></i>' : '<i class="red glyphicon glyphicon-remove"></i>';
     $html_form .= '<tr><td>mod_rewrite enabled</td><td>' . $s_mod_rewrite . '</td></tr>';
     $html_form .= '</tbody></table>';
     $html_form .= '<hr/>';
     $s_update_enabled = $b_write_perms ? '' : ' disabled';
     $html_form .= '<a class="btn btn-info" href="' . S_BASE_EXTENSION . 'flot-admin/admin/update.php" target="_blank" ' . $s_update_enabled . '><i class="glyphicon glyphicon-cloud-download"></i> update flot</a>';
     $html_form .= '<hr/>';
     $html_form .= '</div>';
     $html_form .= '</div>';
     # save
     $html_form .= '<div class="form-group">';
     $html_form .= '<button type="submit" class="btn btn-success pull-right"><i class="glyphicon glyphicon-floppy-disk"></i> save</button>';
     $html_form .= '</div>';
     # hidden elements
     $html_form .= '<input type="hidden" name="section" value="settings">';
     $html_form .= '</form>';
     return $html_form;
 }