Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <td class="content">
- <?php
- global $Router, $Controller;
- //
- //
- //$this->display('/block/breadcrumbs');
- // Get route alias to run specific presentation logic.
- $alias = $Router->get_path_alias();
- function acc_get_submenu_def()
- {
- global $Router;
- // Each entry in the submenu definition holds its item name and flag
- // showing whether the item is active.
- $def = array(
- $Router::ALIAS_ACCOUNT_PROFILE => array('Profile', false, '/my/account'),
- $Router::ALIAS_ACCOUNT_SETTINGS => array('Settings', false, '/my/account/settings'),
- $Router::ALIAS_ACCOUNT_STAT => array('Statistics', false, '/my/account/stat'),
- );
- return array('submenu' => $def);
- }
- //
- //
- ${$Router::ALIAS_ACCOUNT_PROFILE} = function()
- {
- global $View, $Router;
- //var_dump($acc_get_submenu_def);
- $submenu = acc_get_submenu_def();
- $submenu['submenu'][$Router::ALIAS_ACCOUNT_PROFILE][1] = true;
- $View->display('/block/nav_submenu', $submenu);
- $View->display('/page/account/profile');
- };
- //
- //
- ${$Router::ALIAS_ACCOUNT_STAT} = function()
- {
- global $View, $acc_get_submenu_def;
- $submenu = $acc_get_submenu_def();
- $submenu['submenu'][$Router::ALIAS_ACCOUNT_STAT][1] = true;
- $View->display('/block/nav_submenu', $submenu);
- $View->display('/page/account/stat');
- };
- //
- // View user text collection.
- ${$Router::ALIAS_VIEW_COLL} = function()
- {
- global $View;
- $View->display('/page/coll');
- };
- //
- // Login form.
- ${$Router::ALIAS_LOGIN} = function()
- {
- global $View;
- $View->display('/login');
- };
- //
- //
- ${$Router::ALIAS_REGISTER} = function()
- {
- global $View;
- $View->display('/page/register');
- };
- //
- //
- ${$Router::ALIAS_EDIT_TEXT} = function()
- {
- global $View;
- $View->display('/page/text/edit');
- };
- //
- //
- ${$Router::ALIAS_NEW_TEXT} = function()
- {
- global $View, $App;
- if ($View->assert('err_forbidden')) { // User cannot add a new text.
- $View->display('/block/message', array('content' => 'f'));
- return;
- }
- $View->display('/page/text/edit');
- };
- //
- // Preview text.
- ${$Router::ALIAS_PREVIEW_TEXT} = function()
- {
- global $View;
- $View->display('/page/text/preview');
- };
- //
- ${$Router::ALIAS_USER_TEXT} = function()
- {
- global $Router, $Controller, $View;
- $user = $Controller->user;
- $text = $Controller->text;
- $view->set('title', $text->get_title());
- $view->set('text', $text->get_tokenized_text());
- //$is_marked_up = true;//$text->is_marked_up();
- //if ($is_marked_up) {
- // $view->set('csv_word_id', join(',', $text->get_markers()));
- //}
- //$view->set('not_in_coll', $user_id ? !$text->is_in_coll($user_id) : true);
- $view->set('is_marked_up', $text->is_marked_up());
- };
- //
- //
- ${$Router::ALIAS_ABOUT_ME} = function()
- {
- global $View;
- $View->display('/about_me');
- };
- //
- //
- ${$Router::ALIAS_ABOUT_PROJ} = function()
- {
- global $View;
- $View->display('/page/about_proj');
- };
- //
- //
- ${$Router::ALIAS_READ_TEXT} = function()
- {
- global $View, $Router, $Controller;
- $text = $Controller->get('text');
- $user = $Controller->user;
- if (!$text) {
- $View->display('/block/message', array('text' => 'We are sorry, it seems that the text has been removed or does not exists'));
- return;
- }
- $View->display('/page/text/read');
- };
- //
- //
- ${$Router::ALIAS_USER_SETTINGS_MARKER} = function()
- {
- global $View;
- $View->display('/my/settings/marker');
- };
- //
- // User word cloud.
- ${$Router::ALIAS_WORD_CLOUD} = function()
- {
- global $View;
- $View->display('/page/cloud');
- };
- if (!empty($$alias) && is_callable($$alias)) {
- $$alias();
- }
- ?>
- </td>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement