function upload() { $tmp = '_tmp/Pefi_COMRES/'; $retVal = ''; createDirsInPath($tmp); if ($_SERVER['REQUEST_METHOD'] == 'GET') { $act = createActionURL('commercials', 'upload', ''); $retVal = "\n <form enctype='multipart/form-data' action='{$act}' method='POST'>\n <input type='hidden' name='MAX_FILE_SIZE' value='100000' />\n <div>\n <span>Choose a file to upload: </span>\n <input name='uploadedfile' type='file' />\n </div>\n <input type='submit' value='Upload' />\n </form>\n "; } else { $name = $_FILES['uploadedfile']['name']; if (strrpos($name, ".zip") == strlen($name) - 4) { $target_path = $tmp . basename($_FILES['uploadedfile']['name']); if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { $retVal = "Uploaded file: <strong>{$target_path}</strong>"; } else { $retVal = "Upload error"; } } else { $retVal = "Only Zip files allowed"; } } return $retVal; }
if (function_exists('finfo_open')) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $fType = finfo_file($finfo, $editedFile); finfo_close($finfo); } else { $fType = 'text/plain'; } if ($fType == 'text/plain' or $fType == 'inode/x-empty') { $ext = substr($editedFile, strrpos($editedFile, '.') + 1); if (array_key_exists($ext, $editableFiles)) { $fType = $ext; } } $codemirror = "{$_PEFI->dlibURL}/codemirror"; $_PEFI->view->title = "Code editor"; $_PEFI->view->head = "\n <link rel='stylesheet' href='{$codemirror}/lib/codemirror.css' />\n <link rel='stylesheet' href='{$codemirror}/theme/night.css' />\n <link rel='stylesheet' href='{$codemirror}/doc/docs.css' />\n <style type='text/css'>\n div.CodeMirror { height: 430px; }\n body { max-width: 100%; margin: 0; padding: 0; line-height: 1; }\n </style>\n\n <script src='{$codemirror}/lib/codemirror.js'></script>\n <script src='{$codemirror}/mode/xml/xml.js'></script>\n <script src='{$codemirror}/mode/javascript/javascript.js'></script>\n <script src='{$codemirror}/mode/css/css.js'></script>\n <script src='{$codemirror}/mode/htmlmixed/htmlmixed.js'></script>\n <script src='{$codemirror}/mode/clike/clike.js'></script>\n <script src='{$codemirror}/mode/php/php.js'></script>\n <script src='{$codemirror}/mode/sql/sql.js'></script>\n"; $content = ''; $showDirAction = createActionURL('site', 'viewfiles', "fileOrDir={$editedFileDir}"); if (array_key_exists($fType, $editableFiles)) { $fcontent = htmlspecialchars(file_get_contents($editedFile)); $oldval = ''; if (!empty($_PEFI->view->content)) { $oldval = "\n <label>Your file:</label>\n <br>\n <textarea>{$_PEFI->view->content}</textarea>\n "; } $fileHash = md5_file($editedFile); $editedAction = createActionURL('site', 'savefile'); $content .= "\n <form action='{$editedAction}' method='post'>\n <input type='hidden' name='fileOrDir' value='{$editedFileDir}' />\n <input type='hidden' name='filename' value='{$editedFile}' />\n <input type='hidden' name='filehash' value='{$fileHash}' />\n <label for='pageEditTextArea'>This is going to be saved:</label>\n <br>\n <textarea class='admin_edit_code' name='filedata' id='pageEditTextArea'>{$fcontent}</textarea>\n <br>\n {$oldval}\n <input type='submit' value='Send' />\n </form>\n <script type='text/javascript'>\n var myCodeMirror = CodeMirror.fromTextArea(document.getElementById('pageEditTextArea'), { \n lineNumbers: 'true', \n theme: 'night',\n mode: '{$editableFiles[$fType]}'\n });\n </script>\n "; } else { $content .= "<h3><a href='{$showDirAction}'>Back</a> Can not read this file!</h3>"; } $_PEFI->view->content = "\n <h3><a href='{$showDirAction}'><<Back</a> {$editedFile}</h3>\n <div>{$content}</div>\n";
<li> <a href="#">Commercials</a> <ul id="admin_menu_commercial"> <li><a href="<?php echo createActionURL('commercials', 'publish'); ?> " class="confirm" target="admin_popup_iframe">Publish</a></li> <li> <form action="<?php echo createActionURL('commercials', 'clean'); ?> " method="get" target="admin_popup_iframe"> <input type="submit" value="Clean" class="textbutton" /> <input type="checkbox" name="clean_tmp" value="Clean tmp" title="Clean Temp Files" /> </form> </li> <li> <form action="<?php echo createActionURL('commercials', 'generate'); ?> " method="get" target="admin_popup_iframe"> <input type="submit" value="Generate" class="textbutton" /> <input type="checkbox" name="download" value="Download resources" title="Download resources" /> </form> </li> <li><a href="<?php echo createActionURL('commercials', 'upload'); ?> " target="_blank">Upload</a></li> </ul> </li>
function form($page) { $action = createActionURL('page', 'assets-upload', "page={$page}"); return "\n <div>\n <form action='{$action}' method='POST' enctype='multipart/form-data'>\n <label>Filename:</label>\n <input name='newImageName' type='text' />\n <input name='newImage' type='file' />\n <input type='submit' value='Upload' />\n </form>\n\n </div>"; }
<li><a href="#">Reservations</a> <ul id="admin_menu_reservations"> <li><a href="<?php echo createActionURL('reservations', 'index'); ?> " target="_blank">Manage</a></li> <li><a href="<?php echo createActionURL('reservations', 'reservation'); ?> " target="_blank">Reservations</a></li> <li><a href="<?php echo createActionURL('reservations', 'reservationsadd'); ?> " target="_blank">Add</a></li> <li><a href="<?php echo createActionURL('reservations', 'availability'); ?> " target="_blank">Availability</a></li> <?php if (ucan('ifa', 'LIST')) { ?> <li><a href="<?php echo createActionURL('reservations', 'ifa'); ?> " target="_blank">IFA</a></li> <?php } ?> </ul> </li>
} ?> </form> </li> <li><a href="<?php echo createActionURL('page', 'assets-show', "page={$pageuri}"); ?> " target="_blank">Page images</a></li> <?php if (ucan('assets')) { ?> <li><a href="<?php echo createActionURL('page', 'assets-generatethumbs', "page={$pageuri}"); ?> " target="admin_popup_iframe">Generate thumbs</a></li> <?php } ?> <?php if (ucan('editsource')) { ?> <li><a href="<?php echo createActionURL('site', 'editbfile', "page={$pageuri}"); ?> " target="_blank">Edit basefile</a></li> <?php } ?> </ul> </li>
$meta_description->setData($description_req); $_PEFI->tr->save($meta_description); $meta_slug->setData($slug_req); $_PEFI->tr->save($meta_slug); $action = createActionURL('page', 'metadata', "page={$page}"); $_PEFI->view->content = "\r <p>\r Metadata SAVED, should refresh PARENT page! <br>\r If slug was changed, you will have a notfound page:\r change URL to slug, or click again from the root of\r the main page.\r </p>\r "; } else { $_PEFI->view->messages[] = 'Somebody changed the values while you were editing!'; $todo = 'metadata-show'; } } else { $_PEFI->view->content = "Editing canceled"; } } if ($todo == 'metadata-show') { $form_action = createActionURL('page', 'metadata-save'); $title = tr("{$page}.title:meta")->getData(); if (!isset($title_req)) { $title_req = ''; } $keywords = tr("{$page}.keywords:meta")->getData(); if (!isset($keywords_req)) { $keywords_req = ''; } $description = tr("{$page}.description:meta")->getData(); if (!isset($description_req)) { $description_req = ''; } $slug = tr($page . ':slug')->getData(); if (!isset($slug_req)) { $slug_req = '';
</li> <li> <a href="<?php echo createActionURL('reservations', 'config'); ?> " id="config_toggle">Config</a> <div id="config_tab" class="tabs_data"> <iframe name='config_frame' src="<?php echo createActionURL('reservations', 'config'); ?> "></iframe> </div> </li> <li> <a href="<?php echo createActionURL('reservations', 'reservationsShortList'); ?> " id="short_toggle">Short List</a> <div id="short_tab" class="tabs_data"> <iframe name='short_frame' src="<?php echo createActionURL('reservations', 'reservationsShortList'); ?> "></iframe> </div> </li> </ul> </div> </div> </body> </html>
?> <li><a href="#">Links</a> <ul id="admin_menu_links"> <li><a href="<?php echo createActionURL('links', 'publish'); ?> " class="confirm" target="admin_popup_iframe">Publish</a></li> <li><a href="<?php echo createActionURL('links', 'clean'); ?> " target="admin_popup_iframe">Clean</a></li> <li><a href="<?php echo createActionURL('links', 'generate'); ?> " target="admin_popup_iframe">Generate</a></li> <li><a href="<?php echo createActionURL('links', 'manage'); ?> " target="_blank">Manage</a></li> <li><a href="<?php echo createActionURL('links', 'managesections'); ?> " target="_blank">Sections</a></li> <li><a href="<?php echo createActionURL('links', 'managesubsections'); ?> " target="_blank">Subsections</a></li> </ul> </li>
if (!$_PEFI->user) { return; } ?> <li> <a href="#">User</a> <ul id="admin_menu_user"> <li><a href="<?php echo createActionURL('user', 'logout', 'redirect_to=' . $_PEFI->route->page); ?> " class="confirm" id="admin_logout"><?php echo $_PEFI->user->name; ?> </a></li> <?php if ($_PEFI->crdntls->can('user', 'list')) { ?> <li><a href="<?php echo createActionURL('user', 'manage'); ?> " id="admin_usermanage" target="_blank">Manage Users</a></li> <li><a href="<?php echo createActionURL('user', 'manage_pass'); ?> " id="admin_userpass" target="_blank">Manage Passwords</a></li> <?php } ?> </ul> </li>
function redirect_to_login($source) { header("Location: " . createActionURL('user', '', "redirect_to={$source}")); }
echo createActionURL('reservations', 'source'); ?> ">Source</a></li> <li><a href="<?php echo createActionURL('reservations', 'month'); ?> ">Month</a></li> <li><a href="<?php echo createActionURL('reservations', 'user'); ?> ">User</a></li> <li><a href="<?php echo createActionURL('reservations', 'updatestatus'); ?> ">UpdateStatus</a></li> <li><a href="<?php echo createActionURL('reservations', 'reservation', 'backup=true'); ?> ">Backup</a></li> <li><a href="<?php echo createActionURL('reservations', 'clearcache'); ?> ">Clear Cache</a></li> </ul> <?php }; ?> <?php include_once 'form.php';
<!-- Day with Weekday in title --> <tr> <td>room</td> <?php foreach ($row as $date => $cell) { $dtime = strtotime($date); ?> <td class="datecell<?php echo date('N', $dtime) >= 6 ? ' weekend' : ''; ?> "> <a target="reservation_frame" title="<?php echo date('D', $dtime); ?> " href="<?php echo createActionURL('reservations', 'reservation', 'f_showday=' . $date); ?> "><?php echo date('j', $dtime); ?> </a> </td> <?php } ?> </tr> <?php } ?> <!-- room availability information -->
} $str = " <$tag class='editable_wrap {$type}'> $action <$tag class='editable' key='$key' title='$key' id='{$this->text->getKey()}:{$this->text->getLang()}'> $str </$tag> </$tag> "; } elseif (in_array($type, array('option','img','button'))) { $str = "%%{$this->text->getKey()}:{$this->text->getLang()}%%:$str"; } } return $str; } function __toString () { return $this->getEditingData(); } } */ $_PEFI->view->title = 'Edit tr' . $_REQUEST['key']; if ($todo == 'texts-get') { $text = tr($_REQUEST['key']); // the $%#@!~ is a 'unique' delimiter echo $_REQUEST['key'] . '$%#@!~' . $text->getData(); exit; } if ($todo == 'texts-save') { if (array_key_exists('save', $_POST)) { $lang = $_SESSION['pefi_user']->lang; $text = tr($_POST['key']);
" target="admin_popup_iframe">Clear Cache</a></li> <li><a href="<?php echo createActionURL('site', 'build'); ?> " class="confirm" target="admin_popup_iframe">Build</a></li> <li><a href="<?php echo createActionURL('site', 'raiseversion'); ?> " target="admin_popup_iframe">Version++</a></li> <li><a href="<?php echo createActionURL('site', 'resetlog'); ?> " target="admin_popup_iframe">Reset log</a></li> <li><a href="<?php echo createActionURL('site', 'showlog'); ?> " target="admin_popup_iframe">Show log</a></li> <li><a href="<?php echo createActionURL('site', 'downloadall'); ?> " class="confirm" target="admin_popup_iframe">Download site</a></li> <li><a href="<?php echo createActionURL('site', 'edittr'); ?> " target="_blank">Edit text resources</a></li> <li><a href="<?php echo createActionURL('site', 'viewfiles'); ?> " target="_blank">View files</a></li> </ul> </li>
<?php if (!ucan('setup') || !file_exists('_SETUPOK')) { return; } ?> <li> <a href="#" id="setup_menu">Setup</a> <ul id="admin_menu_setup"> <li><a href="<?php echo createActionURL('setup', 'removefile'); ?> " target="admin_popup_iframe">Remove File</a></li> <li><a href="<?php echo createActionURL('setup', 'db'); ?> " target="_blank">Setup DB</a></li> </ul> </li>
<?php if (!$_PEFI->crdntls->can('reservation', 'SHOW') || !file_exists('_SETUPOK')) { redirect_to_login($_PEFI->route->page); } $content = '<h2>If SETUP complete remove _SETUPOK file from ROOT dir!</h2>'; $db = $_PEFI->db; $todo = $_PEFI->todo; $db_pref = $_PEFI->dbpref; if ($todo == 'removefile') { unlink('_SETUPOK'); $content .= '<p>File _SETUPOK removed</p>'; } elseif ($todo == 'db') { $pdoEngineName = $db->getAttribute(PDO::ATTR_DRIVER_NAME); if ($_SERVER['REQUEST_METHOD'] === 'GET') { $content .= '<form action="' . createActionURL('setup', 'db') . '" method="POST">'; $content .= '<table><tr><th>Module</th><th>Tables</th><th>Basedata</th></tr>'; foreach ($_PEFI->modules as $module => $module_dir) { $content .= '<tr>'; $content .= "<td>{$module}</td>"; $content .= '<td>'; $fileName = "{$_PEFI->path}/{$module_dir}/data/{$module}.{$pdoEngineName}.def.sql"; if (file_exists($fileName)) { $content .= "<input type='checkbox' name='{$fileName}' title='{$fileName}'>"; } $content .= '</td>'; $content .= '<td>'; $fileName = "{$_PEFI->path}/{$module_dir}/data/{$module}.basedata.sql"; if (file_exists($fileName)) { $content .= "<input type='checkbox' name='{$fileName}' title='{$fileName}'>"; }
<link rel="stylesheet" type="text/css" href="<?php echo "{$_PEFI->url}/edit.css"; ?> " /> <script type="text/javascript" src="<?php echo "{$_PEFI->dlibURL}/jquery.js"; ?> "></script> <script type="text/javascript" src="<?php echo "{$_PEFI->libURL}/pefi_util.js"; ?> "></script> <script type="text/javascript" src="<?php echo "{$_PEFI->url}/edit.js"; ?> "></script> <script type="text/javascript" src="<?php echo "{$_PEFI->url}/page.js"; ?> "></script> <script type='text/javascript'> if ((typeof PEFI === "object") && (typeof PEFI.UTIL === "object")) { PEFI.UTIL.actionURL = "<?php echo createActionURL('*action', '*todo', '*rest'); ?> "; } </script> </div>
<?php $content = ''; foreach ($files as $fileName) { $thisFile = realpath("{$fileOrDir}/{$fileName}"); $fType = 'unknown'; if (function_exists('finfo_open')) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $fType = finfo_file($finfo, $thisFile); finfo_close($finfo); } $content .= "<li><a href='{$fileAction}fileOrDir={$thisFile}'>{$fileName}</a> [{$fType}]</li>"; } $form_action = createActionURL('site', 'savefile'); $_PEFI->view->title = "File lister"; $_PEFI->view->content = "\n <h3>Content of {$fileOrDir}</h3>\n <ul>{$content}</ul>\n <form action='{$form_action}' method='post'>\n <input type='hidden' name='fileOrDir' value='{$fileOrDir}' />\n <input type='text' name='filename' />\n <input type='checkbox' name='mkdir' value='DIR' />\n <input type='submit' value='Create file or dir' />\n </form>\n";
<?php if (!$_PEFI->crdntls->can('edit_lock')) { return; } ?> <li><a href="#">Forms</a> <ul> <li><a href="<?php echo createActionURL('form', 'edit_lock'); ?> " target="_blank">Edit Locks</a></li> </ul> </li>
function get_form($message = "") { session_destroy(); $action = createActionURL('user', 'login', isset($_GET['redirect_to']) ? 'redirect_to=' . $_GET['redirect_to'] : ''); return "\n <p> {$message} </p>\n <form method='POST' action='{$action}'>\n <label for='name'> Name: </label>\n <input type='text' id='name' name='name'>\n <label for='pass'> Passw: </label>\n <input type='password' id='pass' name='pass'>\n <input type='submit' id='login' name='login'>\n </form>\n <p> You will only see action menu if is in your language! </p>\n "; }