本文整理汇总了PHP中Layout::wrap方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::wrap方法的具体用法?PHP Layout::wrap怎么用?PHP Layout::wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::wrap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
public function admin()
{
switch ($_REQUEST['iop']) {
case 'delete_image':
if (!$this->folder->id || !Current_User::secured('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->loadImage(filter_input(INPUT_GET, 'file_id', FILTER_VALIDATE_INT));
$this->image->delete();
PHPWS_Core::goBack();
break;
case 'post_image_upload':
if (!$this->folder->id || !Current_User::authorized('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
if (!$this->postImageUpload()) {
\Cabinet::setMessage('Failed to upload image. Check directory permissions.');
}
Layout::nakedDisplay();
//\PHPWS_Core::goBack();
break;
case 'upload_image_form':
if (!$this->folder->id || !Current_User::secured('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->loadImage(filter_input(INPUT_GET, 'file_id', FILTER_VALIDATE_INT));
$this->edit();
echo Layout::wrap($this->content, 'Image Upload', true);
exit;
}
}
示例2: check_session
function check_session()
{
if (!isset($_SESSION['PHAT_FormManager']->form)) {
$info = sprintf('<p style="text-align : center; margin: 50% auto">%s</p>', dgettext('phatform', 'Session timeout'), dgettext('phatform', 'We are sorry, but your session timed out. You will need to click the Back button on your browser to return to the previous page.'));
echo Layout::wrap($info);
exit;
}
}
示例3: display
/**
* Main function controlling the display of data passed
* to layout
*/
public static function display()
{
if (LAYOUT_THEME_EXEC) {
$theme_exec = sprintf('%sthemes/%s/theme.php', PHPWS_SOURCE_DIR, Layout::getCurrentTheme());
if (is_file($theme_exec)) {
include_once $theme_exec;
}
}
Layout::processHeld();
$themeVarList = array();
$contentList = Layout::getBoxContent();
// if content list is blank
// 404 error?
foreach ($contentList as $module => $content) {
foreach ($content as $contentVar => $template) {
if (!($theme_var = $_SESSION['Layout_Settings']->getBoxThemeVar($module, $contentVar))) {
$theme_var = DEFAULT_THEME_VAR;
}
if (!in_array($theme_var, $themeVarList)) {
$themeVarList[] = $theme_var;
}
$order = $_SESSION['Layout_Settings']->getBoxOrder($module, $contentVar);
if (empty($order)) {
$order = MAX_ORDER_VALUE;
}
if (isset($unsortedLayout[$theme_var][$order])) {
PHPWS_Error::log(LAYOUT_BOX_ORDER_BROKEN, 'layout', 'Layout::display', $theme_var);
}
if (isset($unsortedLayout[$theme_var][$order])) {
$unsortedLayout[$theme_var][$order] .= $template;
} else {
$unsortedLayout[$theme_var][$order] = $template;
}
}
}
if (isset($GLOBALS['Layout_Plugs'])) {
foreach ($GLOBALS['Layout_Plugs'] as $plug_var => $content) {
if (!in_array($plug_var, $themeVarList)) {
$themeVarList[] = $plug_var;
$unsortedLayout[$plug_var][0] = implode('', $content);
}
}
}
if (isset($themeVarList)) {
foreach ($themeVarList as $theme_var) {
ksort($unsortedLayout[$theme_var]);
$upper_theme_var = strtoupper($theme_var);
$bodyLayout[$upper_theme_var] = implode('', $unsortedLayout[$theme_var]);
}
Layout::loadHeaderTags($bodyLayout);
$finalTheme = Layout::loadTheme(Layout::getCurrentTheme(), $bodyLayout);
if (PHPWS_Error::isError($finalTheme)) {
PHPWS_Error::log($finalTheme);
$content = implode('', $bodyLayout);
} else {
$content = $finalTheme->get();
if (LABEL_TEMPLATES) {
$content = "\n<!-- START TPL: " . $finalTheme->lastTemplatefile . " -->\n" . $content . "\n<!-- END TPL: " . $finalTheme->lastTemplatefile . " -->\n";
}
}
} else {
$plain = implode('<br />', $unsortedLayout[$theme_var]);
$content = Layout::wrap($plain);
}
return $content;
}
示例4: editFolder
public function editFolder($js)
{
if (!Current_User::allow('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->loadForms();
if ($this->folder->ftype == IMAGE_FOLDER) {
$this->title = dgettext('filecabinet', 'Update image folder');
} elseif ($this->folder->ftype == DOCUMENT_FOLDER) {
$this->title = dgettext('filecabinet', 'Update document folder');
} else {
$this->title = dgettext('filecabinet', 'Update multimedia folder');
}
$this->content = $this->forms->editFolder($this->folder, $js);
if ($js) {
echo \Layout::wrap($this->content, $this->title, true);
} else {
echo json_encode(array('title' => $this->title, 'content' => $this->content));
}
exit;
}
示例5: handle
public function handle()
{
$request = \Server::getCurrentRequest();
try {
switch ($request->getVar('ckop')) {
case 'form':
$this->form();
break;
case 'upload_file':
$this->uploadFile($request);
exit;
case 'delete_file':
$this->deleteFile($request);
exit;
case 'list_folder_files':
$this->printFolderFiles();
exit;
case 'get_file':
$this->printFile($request);
exit;
case 'file_form':
$this->fileForm($request);
exit;
case 'save_folder':
$this->saveFolder($request);
exit;
case 'list_folders':
$this->printFolderList($request);
exit;
case 'save_file':
$this->saveFile($request);
exit;
default:
throw new \Http\MethodNotAllowedException('Unknown request');
}
echo \Layout::wrap($this->getContent(), $this->getTitle(), true);
} catch (\Exception $e) {
echo $e->getMessage();
}
exit;
}
示例6: admin
public function admin()
{
switch ($_REQUEST['dop']) {
case 'delete_document':
if (!$this->folder->id || !Current_User::secured('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->document->delete();
PHPWS_Core::returnToBookmark();
break;
case 'post_document_upload':
if (!$this->folder->id || !Current_User::authorized('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->postDocumentUpload();
javascript('close_refresh');
Layout::nakedDisplay();
//\PHPWS_Core::goBack();
break;
case 'upload_document_form':
if (!$this->folder->id || !Current_User::secured('filecabinet', 'edit_folders', $this->folder->id, 'folder')) {
Current_User::disallow();
}
$this->loadDocument(filter_input(INPUT_GET, 'file_id', FILTER_VALIDATE_INT));
$this->edit();
echo Layout::wrap($this->content, 'Document Upload', true);
exit;
case 'add_access':
if (!Current_User::authorized('filecabinet')) {
Current_User::disallow();
}
$keyword = null;
$this->loadDocument();
// document exists, try making a shortcut
if ($this->document->id) {
PHPWS_Core::initModClass('access', 'Shortcut.php');
$shortcut = new Access_Shortcut();
if (isset($_GET['keyword'])) {
$keyword = $_GET['keyword'];
}
if (empty($keyword)) {
$keyword = $this->document->title;
}
$result = $shortcut->setKeyword($keyword);
$new_keyword = $shortcut->keyword;
// if setKeyword returns a false or error, we have them pick a different name
if (!$result || PHPWS_Error::isError($result)) {
$message = dgettext('filecabinet', 'Access shortcut name already in use. Please enter another.');
$success = false;
} else {
$shortcut->setUrl('filecabinet', $this->document->getViewLink());
$shortcut->save();
$success = true;
$message = '<p>' . dgettext('filecabinet', 'Access shortcut successful!') . '</p>';
$message .= '<a href="' . PHPWS_Core::getHomeHttp() . $shortcut->keyword . '">' . PHPWS_Core::getHomeHttp() . $shortcut->keyword . '</a>';
}
} else {
$message = dgettext('filecabinet', 'File not found');
// not really a success but prevents a repost prompt
$success = true;
}
echo json_encode(array('success' => $success, 'message' => $message, 'keyword' => $new_keyword));
exit;
}
}
示例7: getWrappedHtml
/**
* Uses show() to get the HTML snippit for this report, then uses PHPWS_Layout to
* wrap that snippit in a fully-formed HTML document, suitable for independent viewing.
*
* @see show()
* @return String fully-formed HTML document
*/
public function getWrappedHtml()
{
return Layout::wrap($this->show());
}