Beispiel #1
0
    protected function column_col3()
    {
        $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
        echo '
<h3>Hellouniverse Calculator!</h3>
        ';
        if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) {
            // nothing, this is a fresh calculator page
        } else {
            // result from calculation
            echo '
<p>
Result from last calculation: ' . $mem_redirect->x . ' + ' . $mem_redirect->y . ' = ' . $mem_redirect->z . '
</p>
            ';
        }
        echo '
<p>
<form method="POST" action="' . $page_url . '">
' . $this->layoutkit->formkit->setPostCallback('HellouniverseController', 'calculatorCallback') . '
<input name="x"/> + <input name="y"/> = ?
<input type="submit" value="send"/>
</form>
</p>
        ';
    }
 protected function column_col3()
 {
     $trip = $this->trip;
     $trip_data = $this->trip_data;
     $words = new MOD_words();
     $layoutbits = new MOD_layoutbits();
     $member = $this->model->getLoggedInMember();
     $google_conf = PVars::getObj('config_google');
     $Model = new Blog();
     $callback = $this->getCallbackOutput('BlogController', 'createProcess');
     // get the saved post vars
     // todo: grab from page model
     $vars = array();
     $request = PRequest::get()->request;
     $errors = array();
     $lang = array();
     //$tripIt = $Model->getTripFromUserIt($member->id);
     //$defaultVis = A PP_User::getSetting($User->getId(), 'APP_blog_defaultVis');
     // defaults to public then
     $defaultVis = false;
     if (!$member) {
         $isOwnTrip = false;
     } else {
         $isOwnTrip = $trip->IdMember == $member->id;
     }
     require 'templates/singletrip_details.php';
     require 'templates/singletrip.php';
     $shoutsCtrl = new ShoutsController();
     $shoutsCtrl->shoutsList('trip', $trip->trip_id);
 }
    protected function column_col3()
    {
        $words = $this->words;
        $cnt_pictures = $this->cnt_pictures;
        $statement = $this->statement;
        $gallery = $this->gallery;
        $mem_redirect = $this->layoutkit->formkit->getMemFromRedirect();
        $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
        $formkit = $this->layoutkit->formkit;
        $callback_tag = $formkit->setPostCallback('GalleryController', 'updateGalleryCallback');
        if ($this->myself && $this->upload) {
            // Display the upload form
            require SCRIPT_BASE . 'build/gallery/templates/uploadform.php';
        }
        $this->thumbsize = 1;
        echo '<form method="POST" action="">' . $callback_tag;
        require SCRIPT_BASE . 'build/gallery/templates/imagefixedcolumns.list.php';
        if ($this->myself) {
            echo <<<HTML
        <p class="small">
            <input type="checkbox" name="selectAllRadio" class="checker" onclick="common.selectAll(this);">
            &nbsp;&nbsp;{$words->get('SelectAll')}
            &nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;
            {$words->get('GalleryWithSelected')}: &nbsp;&nbsp;&nbsp;&nbsp;

            <input name="gallery" type="hidden" value="{$gallery->id}">
            <input name="removeOnly" type="hidden" value="1">
            <input type="submit" name="button" value="{$words->getBuffered('GalleryRemoveImagesFromPhotoset')}" class="button" style="cursor:pointer"/>
            <a href="gallery/show/sets/{$this->gallery->id}/upload" class="button" /><img src="images/icons/picture_add.png">{$words->get('GalleryUploadPhotos')}</a>

        </p>
        </form>
HTML;
        }
    }
Beispiel #4
0
 /**
  * content of the middle column - this is the most important part
  */
 protected function body()
 {
     // get the translation module
     $words = $this->getWords();
     $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
     $request = PRequest::get()->request;
     $callbacktag = $this->layoutkit->formkit->setPostCallback('GeoController', 'SelectorCallback');
     if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) {
         $locations_print = '';
     } elseif ($mem_redirect->location) {
         $Geo = new GeoController();
         $locations_print = $Geo->GeoSearch($mem_redirect->location, 40, false, $callbacktag);
     } else {
         $Geo = new GeoController();
         $locations_print = $Geo->GeoSearch(' ', 40, false, $callbacktag);
     }
     // Just for testing:
     // if (isset($_SESSION['GeoVars'])) var_dump($_SESSION['GeoVars']);
     // if (isset($_SESSION['GeoVars']['geonamename'])) var_dump($_SESSION['GeoVars']['geonamename']);
     // if (isset($request[2]) && $request[2] == 'save' && $mem_redirect->geolocation) {
     // $geolocation = $mem_redirect->geolocation;
     // list($geonameid, $geonamename) = preg_split('/[//]/', $geolocation);
     // $_SESSION['SignupBWVars']['geonameid'] = $geonameid;
     // $_SESSION['SignupBWVars']['geonamename'] = $geonamename;
     // print 'GEO SET';
     // } else {
     // print 'GEO NOT SET';
     // }
     require 'templates/popup.php';
 }
 public static function get()
 {
     if (!isset(self::$_instance)) {
         $c = __CLASS__;
         self::$_instance = new $c();
     }
     return self::$_instance;
 }
Beispiel #6
0
 /**
  * Loading login form template
  *
  * @param void
  */
 public function loginForm($redirect_url = false)
 {
     if (!$redirect_url) {
         $request = PRequest::get()->request;
         $redirect_url = PVars::getObj('env')->baseuri . implode('/', $request);
     }
     require 'templates/loginform.php';
 }
Beispiel #7
0
 protected function getTableColumns()
 {
     $request_str = implode('/', PRequest::get()->request);
     $dir_str = isset($_GET['dir']) && $_GET['dir'] != 'ASC' ? 'ASC' : 'DESC';
     $words = new MOD_words();
     return array('select' => '', 'from' => '<a href="' . $request_str . '?sort=sender&amp;dir=' . $dir_str . '">' . $words->getSilent('From') . '</a> / <a href="' . $request_str . '?sort=date&amp;dir=' . (isset($_GET['dir']) ? $dir_str : 'ASC') . '">' . $words->getSilent('Date') . '</a>' . $words->flushBuffer(), 'message' => $words->get('MessagesText'));
     return array('select' => '', 'from' => 'From/To', 'message' => 'Text');
 }
Beispiel #8
0
    protected function column_col3()
    {
        // get translation module
        $layoutkit = $this->layoutkit;
        $words = $layoutkit->getWords();
        $model = $this->getModel();
        $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
        $formkit = $layoutkit->formkit;
        $callback_tag = $formkit->setPostCallback('NotifyController', 'NotifyAdminCallback');
        $formstart = '<form name="msgform" id="msgform" action="' . $page_url . '" method="post">';
        $formstart .= $callback_tag;
        $formend = '</form>';
        $widget = $layoutkit->createWidget(new NotifyAdminWidget());
        $widget->model = $model;
        $widget->items_per_page = 20;
        $widget->active_page = $this->active_page;
        $widget->visible_range = 2;
        ?>

        <div id="notes">
            <h3>Administer notes</h3>
            <form action="<?php 
        echo $page_url;
        ?>
" method="post">
                <?php 
        if ($widget->needsPagination()) {
            $widget->showPagination();
        }
        ?>
                <?php 
        $widget->render();
        ?>
                <?php 
        if ($widget->needsPagination()) {
            $widget->showPagination();
        }
        ?>
                <input type="hidden" name="action" value="delete"/>
                <?php 
        echo $callback_tag;
        ?>
                <input type="submit" name="button" value="Delete" id="button" />
            </form>
                <hr />
            <form action="<?php 
        echo $page_url;
        ?>
" method="post">
                <?php 
        $this->notesActions($callback_tag);
        ?>
            </form>
        </div>
        <?php 
    }
Beispiel #9
0
 protected function column_col2()
 {
     $request = PRequest::get()->request;
     if (!isset($request[1]) || $request[1] == '') {
         $step = 'tour';
     } else {
         $step = $request[1];
     }
     require 'templates/precontent_tour.php';
 }
Beispiel #10
0
 /**
  * Columns for messages table.
  * The $key of a column is used as a suffix for method tableCell_$key
  *
  * @return array table columns, as $name => Column title
  */
 protected function getTableColumns()
 {
     // We don't mark the link of the current sortorder yet, but we could:
     // $sort_current = isset($_GET['sort']) ? $_GET['sort'] : 'date';
     // This would lgo in the a-tag: '.(($sort_current == 'date') ? 'class="sort_selected"' : '').'
     $request_str = implode('/', PRequest::get()->request);
     $dir_str = isset($_GET['dir']) && $_GET['dir'] != 'ASC' ? 'ASC' : 'DESC';
     $words = new MOD_words();
     return array('select' => '', 'from' => '<a href="' . $request_str . '?sort=sender&amp;dir=' . $dir_str . '">' . $words->getSilent('From') . '</a> / <a href="' . $request_str . '?sort=date&amp;dir=' . (isset($_GET['dir']) ? $dir_str : 'ASC') . '">' . $words->getSilent('Date') . '</a>' . $words->flushBuffer(), 'message' => $words->get('MessagesText'));
 }
Beispiel #11
0
 protected function teaserContent()
 {
     $request = PRequest::get()->request;
     if (!isset($request[0])) {
         $redirect_url = false;
         require 'templates/teaser.php';
     } else {
         require 'templates/teaser.php';
     }
 }
Beispiel #12
0
 public function index()
 {
     if (!$this->_model->hasRightsAccess()) {
         die('You cannot access this app');
     }
     $roles = $this->_model->getAllRoles();
     $request = PRequest::get()->request;
     $page->member = $this->_model->getLoggedInMember();
     $page->model = $this->_model;
     return $page;
 }
Beispiel #13
0
 /**
  * decide which page to show.
  * This method is called automatically
  */
 public function index($args = false)
 {
     $request = PRequest::get()->request;
     // look at the request.
     if (!isset($request[0])) {
         $page = new HellouniverseSimplePage();
     } else {
         switch ($request[0]) {
             case 'calculator':
                 $page = new HellouniverseCalculatorPage();
                 break;
             case 'hellouniverse':
             default:
                 if (!isset($request[1])) {
                     // simple, ugly page
                     $page = new HellouniverseSimplePage();
                 } else {
                     switch ($request[1]) {
                         case 'advanced':
                             // fully decorated page
                             $page = new HellouniversePage();
                             break;
                         case 'tab1':
                         case 'tab2':
                         case 'tab3':
                             // page with submenu
                             $page = new HellouniverseTabbedPage($request[1]);
                             break;
                         case 'child':
                             $page = new HellouniverseChildPage();
                             break;
                         case 'wp':
                         case 'blog':
                         case 'wordpress':
                             $page = new HellouniverseWordpressPage();
                             $page->setExternalURL('http://blogs.bevolunteer.org/', $args->get);
                             $page->get = $args->get;
                             break;
                         case 'post':
                         case 'calculator':
                             $page = new HellouniverseCalculatorPage();
                             break;
                         default:
                             // simple, ugly page
                             $page = new HellouniverseSimplePage();
                             break;
                     }
                 }
         }
     }
     // return the $page object, so the "$page->render()" function can be called somewhere else.
     return $page;
 }
 protected function column_col3()
 {
     $statement = $this->statement;
     $words = $this->getWords();
     $member = $this->loggedInMember;
     $galleries = $this->galleries;
     $mem_redirect = $this->layoutkit->formkit->getMemFromRedirect();
     $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
     $formkit = $this->layoutkit->formkit;
     $callback_tag = $formkit->setPostCallback('GalleryController', 'manageCallback');
     $itemsPerPage = 12;
     require SCRIPT_BASE . 'build/gallery/templates/gallerymanage.column_col3.php';
 }
Beispiel #15
0
 protected function getTableColumns()
 {
     $columns = parent::getTableColumns();
     $columns['from'] = 'To';
     // We don't mark the link of the current sortorder yet, but we could:
     // $sort_current = isset($_GET['sort']) ? $_GET['sort'] : 'date';
     // This would lgo in the a-tag: '.(($sort_current == 'date') ? 'class="sort_selected"' : '').'
     $request_str = implode('/', PRequest::get()->request);
     $dir_str = isset($_GET['dir']) && $_GET['dir'] != 'ASC' ? 'ASC' : 'DESC';
     $words = new MOD_words();
     $columns['from'] = '<a href="' . $request_str . '?sort=receiver&amp;dir=' . $dir_str . '">' . $words->getSilent('To') . '</a> / <a href="' . $request_str . '?sort=date&amp;dir=' . (isset($_GET['dir']) ? $dir_str : 'ASC') . '">' . $words->getSilent('Date') . '</a>' . $words->flushBuffer();
     return $columns;
 }
Beispiel #16
0
 public function displayTrips($trips, $trip_data, $page = 1)
 {
     $pages = PFunctions::paginate($trips, $page);
     $trips = $pages[0];
     $maxPage = $pages[2];
     $pages = $pages[1];
     $currentPage = $page;
     require 'templates/alltrips.php';
     $request = PRequest::get()->request;
     $requestStr = implode('/', $request);
     $requestStr = str_replace('/page' . $page, '', $requestStr);
     $this->pages($pages, $currentPage, $maxPage, $requestStr . '/page%d');
 }
Beispiel #17
0
 public function index()
 {
     $P = PVars::getObj('page');
     $vw = new ViewWrap($this->_view);
     $cw = new ViewWrap($this);
     // index is called when http request = ./blog
     if (PPostHandler::isHandling()) {
         return;
     }
     $request = PRequest::get()->request;
     $User = APP_User::login();
     if (!isset($request[1])) {
         $request[1] = '';
     }
 }
    protected function column_col3()
    {
        $member = $this->member;
        $ww = $this->ww;
        $layoutkit = $this->layoutkit;
        $formkit = $layoutkit->formkit;
        $callback_tag = $formkit->setPostCallback('MembersController', 'deleteTranslationCallback');
        $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
        $lang = $this->model->get_profile_language();
        $profile_language = $lang->id;
        ?>
		<form method="post" action="<?php 
        echo $page_url;
        ?>
" name="signup" id="profile" enctype="multipart/form-data">
		<input type="hidden"  name="memberid"  value="<?php 
        echo $member->id;
        ?>
" />
		<input type="hidden"  name="profile_language"  value="<?php 
        echo $profile_language;
        ?>
" />
		<?php 
        echo $callback_tag;
        ?>
			<h3><?php 
        echo $ww->deleteProfileTranslation;
        ?>
: <?php 
        echo $lang->Name;
        ?>
</h3>
			<p><?php 
        echo $ww->AreYouSure;
        ?>
</p>
			<button class="button" type="submit" name="choice" value="yes" ><?php 
        echo $ww->yes;
        ?>
</button>
			<button class="button" type="submit" name="choice" value="no" ><?php 
        echo $ww->no;
        ?>
</button>
		</form>
		<?php 
    }
Beispiel #19
0
 public function index()
 {
     $request = PRequest::get()->request;
     if (!isset($request[1])) {
         $this->_redirect('');
     }
     switch ($request[1]) {
         case 'admin':
             $BW_Rights = new MOD_right();
             if (!$BW_Rights->hasRight('Admin') || !$BW_Rights->hasRight('Notify')) {
                 $this->_redirect('');
             }
             $page = new NotifyAdminPage();
             $page->setModel($this->_model);
             if (isset($_GET['sort'])) {
                 $page->sortorder = $_GET['sort'];
             }
             $page->active_page = $this->getPageNumber($request, 2);
             return $page;
             break;
         case 'search':
             $terms = isset($_GET['GroupsSearchInput']) ? $_GET['GroupsSearchInput'] : '';
             $resultpage = isset($_GET['Page']) ? $_GET['Page'] : 0;
             $order = isset($_GET['Order']) ? $_GET['Order'] : 'nameasc';
             $page = new GroupsSearchPage();
             $page->search_result = $this->_model->findGroups($terms, $resultpage, $order);
             $page->result_page = $resultpage;
             $page->result_order = $order;
             $page->search_terms = $terms;
             break;
         default:
             // check wether there's a note with id = $request[1]
             if ($note = $this->_model->findNote($request[1])) {
                 switch ($request[2]) {
                     case 'check':
                         // Ajax function
                         $this->checkNote($note);
                         PPHP::PExit();
                     default:
                         break;
                 }
             }
     }
     $page->member = $this->_model->getLoggedInMember();
     $page->model = $this->_model;
     return $page;
 }
Beispiel #20
0
 public function index()
 {
     $request = PRequest::get()->request;
     if (!isset($request[1])) {
         if ($User = APP_User::login()) {
             $page = new LastcommentsPage($this->_model->GetLastComments());
             $page->model = $this->_model;
         } else {
             $page = new MembersMustloginPage();
         }
         //            $page->member = $this->_model->getLoggedInMember();
         return $page;
     }
     $page->member = $this->_model->getLoggedInMember();
     $page->model = $this->_model;
     return $page;
 }
Beispiel #21
0
    /**
     * Processing creation of a comment
     *
     * This is a POST callback function.
     *
     * Sets following errors in POST vars:
     * title        - invalid(empty) title.
     * textlen      - too short or long text.
     * inserror     - db error while inserting.
     */
    public function shoutProcess($table = false, $table_id = false)
    {
        $callbackId = PFunctions::hex2base64(sha1(__METHOD__));
        if (PPostHandler::isHandling()) {
            if (!$_SESSION['IdMember']) {
                return false;
            }
            $vars =& PPostHandler::getVars();
            $request = PRequest::get()->request;
            if (!$table) {
                $table = $vars['table'];
            }
            if (!$table_id) {
                $table_id = $vars['table_id'];
            }
            // validate
            if (!isset($vars['ctxt']) || strlen($vars['ctxt']) == 0 || strlen($vars['ctxt']) > 5000) {
                $vars['errors'] = array('textlen');
                return false;
            }
            $shoutId = $this->dao->nextId('shouts');
            $query = '
INSERT INTO `shouts`
SET
    `id`=' . $shoutId . ',
    `table`=\'' . $table . '\',
    `table_id`=\'' . $table_id . '\',
    `member_id_foreign`=' . $_SESSION['IdMember'] . ',
    `title`=\'' . (isset($vars['ctit']) ? $this->dao->escape($vars['ctit']) : '') . '\',
    `text`=\'' . $this->dao->escape($vars['ctxt']) . '\',
    `created`=NOW()';
            $s = $this->dao->query($query);
            if (!$s) {
                $vars['errors'] = array('inserror');
                return false;
            }
            PPostHandler::clearVars();
            return PVars::getObj('env')->baseuri . implode('/', $request) . '#c' . $shoutId;
        } else {
            PPostHandler::setCallback($callbackId, __CLASS__, __FUNCTION__);
            return $callbackId;
        }
    }
Beispiel #22
0
 protected function column_col3()
 {
     // get translation module
     $layoutkit = $this->layoutkit;
     $words = $layoutkit->getWords();
     $model = $this->getModel();
     $page_url = PVars::getObj('env')->baseuri . htmlspecialchars(implode('/', PRequest::get()->request), ENT_QUOTES);
     $formkit = $layoutkit->formkit;
     $callback_tag = $formkit->setPostCallback('MessagesController', 'mailBoxCallback');
     $this->mailboxDescription();
     $formstart = '<form name="msgform" id="msgform" action="' . $page_url . '" method="post">';
     $formstart .= $callback_tag;
     $formend = '</form>';
     $widget = $this->getMailboxWidget();
     if ($widget->needsPagination()) {
         echo $formstart;
         echo '<div class="subcolumns">';
         echo '<div class="c50l">';
         $this->messageActions();
         echo '</div>';
         echo '<div class="c50r">';
         $widget->showPagination();
         echo '</div>';
         echo '</div>';
         $widget->render();
         echo '<div class="subcolumns">';
         echo '<div class="c50l">';
         $this->messageActions();
         echo '</div>';
         echo '<div class="c50r">';
         $widget->showPagination();
         echo '</div>';
         echo '</div>';
         echo $formend;
     } else {
         echo $formstart;
         $this->messageActions();
         $widget->render();
         $this->messageActions();
         echo $formend;
     }
 }
Beispiel #23
0
 protected function column_col3()
 {
     $member = $this->_model->getLoggedInMember();
     $Blog = new Blog();
     $callback = $this->getCallbackOutput('BlogController', 'createProcess');
     // get the saved post vars
     // get current request
     $request = PRequest::get()->request;
     $errors = array();
     $lang = array();
     $words = new MOD_words();
     $i18n = new MOD_i18n('apps/blog/editcreate.php');
     $errors = $i18n->getText('errors');
     $lang = $i18n->getText('lang');
     $monthNames = array();
     $i18n = new MOD_i18n('date.php');
     $monthNames = $i18n->getText('monthNames');
     $catIt = $this->_model->getCategoryFromUserIt($member->id);
     $tripIt = $this->_model->getTripFromUserIt($member->id);
     $google_conf = PVars::getObj('config_google');
     $defaultVis = new StdClass();
     $defaultVis->valueint = 2;
     // hack: TB settings are disabled as they reference app_user - default visibility is public
     //$defaultVis = A PP_User::getSetting($member->id, 'APP_blog_defaultVis');
     if (!isset($vars['errors']) || !is_array($vars['errors'])) {
         $vars['errors'] = array();
     }
     if (!isset($request[2]) || $request[2] != 'finish') {
         $actionUrl = 'blog/create';
         $submitName = '';
         $submitValue = $words->getSilent('BlogCreateSubmit');
         echo '<h2>' . $words->get('Blog_CreateEntry') . '</h2>';
     } else {
         // $request[2] == 'finish'
         echo '<h2>' . $words->get('BlogCreateFinishTitle') . "</h2>\n";
         echo '<p>' . $words->get('BlogCreateFinishText') . "</p>\n";
         echo '<p>' . $words->get('BlogCreateFinishInfo') . "</p>\n";
     }
     $disableTinyMCE = $this->_model->getTinyMCEPreference();
     require SCRIPT_BASE . 'build/blog/templates/editcreateform.php';
 }
Beispiel #24
0
function MustLogIn()
{
    // TODO: This is not a good place to include something! It has been here before, so whatever.
    require_once 'FunctionsLogin.php';
    if (IsLoggedIn()) {
        // all is fine, move on in program
    } else {
        // not logged in, redirect to a login page
        // TODO: Why do we have to log out here?
        // I would assume the user IS already logged out!
        // APP_User::get()->logout();
        $request = PRequest::get()->request;
        if (isset($_SERVER['PHP_SELF']) and strpos($_SERVER['PHP_SELF'], '/admin/') !== 0) {
            $redirect_url = PVars::getObj('env')->baseuri . 'login' . $_SERVER['PHP_SELF'];
        } else {
            $redirect_url = PVars::getObj('env')->baseuri . 'login/bw/' . implode('/', $request);
        }
        $redirect_url .= empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'];
        header("Location: " . $redirect_url);
        PPHP::PExit();
    }
}
Beispiel #25
0
    /**
     * content of the middle column - this is the most important part
     */
    protected function column_col3()
    {
        // get the translation module
        $words = $this->getWords();
        echo '
<h3>Admin Links</h3>

<p>
Rebuildin the Tree of links
</p>
        ';
        $type = PRequest::get()->request;
        $model = new LinkModel();
        switch ($type[1]) {
            case 'rebuild':
                $model->rebuildLinks();
                break;
            case 'rebuildmissing':
                $model->rebuildMissingLinks();
                break;
        }
    }
Beispiel #26
0
 /**
  * decide which page to show.
  * This method is called automatically
  */
 public function index($args = false)
 {
     $request = PRequest::get()->request;
     $model = new NewsletterModel();
     // look at the request.
     if (!isset($request[1])) {
         $Data = $model->PreviousLetters();
         $page = new NewsletterPage($Data);
     } else {
         $Data = $model->Load($request[1]);
         if (isset($request[2])) {
             $Data->Lang = $request[2];
         } else {
             $Data->Lang = 'en';
         }
         if (empty($Data)) {
             $page = new EmptyLetterPage($request[1]);
         } else {
             $page = new OneNewsLetterPage($Data);
         }
     }
     // return the $page object, so the "$page->render()" function can be called somewhere else.
     return $page;
 }
Beispiel #27
0
 /**
  * decide which view page to show.
  * This method is called automatically
  */
 public function index()
 {
     $request = PRequest::get()->request;
     $model = new TourModel();
     $page = new TourPage();
     // look at the request.
     if (!isset($request[1])) {
         $page->page_number = '';
     } else {
         switch ($request[1]) {
             case 'share':
                 $page->page_number = 3;
                 break;
             case 'meet':
                 $page->page_number = 4;
                 break;
             case 'trips':
                 $page->page_number = 5;
                 break;
             case 'maps':
                 $page->page_number = 6;
                 break;
             case 'openness':
                 $page->page_number = 2;
                 break;
             default:
                 $page->page_number = '';
                 break;
         }
     }
     // finally display the page.
     // the render() method will call other methods to render the page.
     $page->model = $model;
     PVars::getObj('page')->output_done = true;
     return $page;
 }
Beispiel #28
0
 public function index()
 {
     $vw = new ViewWrap($this->_view);
     $P = PVars::getObj('page');
     $request = PRequest::get()->request;
     if (!isset($request[1])) {
         $request[1] = '';
     }
     $TDonationArray = false;
     $error = false;
     $sub = '';
     $sub = $request[1];
     // static pages
     switch ($request[1]) {
         case 'done':
             $error = $this->_model->returnFromPayPal();
             $TDonationArray = $this->_model->getDonations();
             break;
         case 'cancel':
             if (isset($_SESSION["PaypalBW_key"])) {
                 // Log to track wrong donation
                 MOD_log::get()->write("Donation cancelled  [\$_SESSION[\"PaypalBW_key\"]=" . $_SESSION["PaypalBW_key"] . "]", "Donation");
                 break;
             }
         default:
             $TDonationArray = $this->_model->getDonations();
             break;
     }
     $P->content .= $vw->donate($sub, $TDonationArray, $error);
     // teaser content
     $P->teaserBar .= $vw->ShowSimpleTeaser('Donate', $TDonationArray);
     // submenu
     $P->subMenu .= $vw->submenu($sub);
     // User bar on the left
     $P->newBar .= $vw->donateBar($TDonationArray);
 }
Beispiel #29
0
This file is part of BW Rox.
BW Rox is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
BW Rox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/> or
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.
*/
// get current request
$request = PRequest::get()->request;
if (!isset($vars['errors']) || !is_array($vars['errors'])) {
    $vars['errors'] = array();
}
$words = new MOD_words();
$styles = array('highlight', 'blank');
// alternating background for table rows
$iiMax = count($list);
// This retrieve the list of the verifiers
?>

<p><?php 
echo $words->getFormatted("MemberHasVerificationLevel", "<a class=\"username\" href=\"members/" . htmlspecialchars($this->VerifierUsername, ENT_QUOTES) . "\">" . htmlspecialchars($this->VerifierUsername, ENT_QUOTES) . "</a>", "<strong>" . $words->getFormatted($VerificationMaxLevel) . "</strong>");
?>
</p>
<?php

// get translation module
$layoutkit = $this->layoutkit;
$words = $layoutkit->getWords();
$model = $this->getModel();
$page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
$formkit = $layoutkit->formkit;
$callback_tag = $formkit->setPostCallback('GroupsController', 'createGroupCallback');
if ($redirected = $formkit->mem_from_redirect) {
    $Group_ = !empty($redirected->post['Group_']) ? $redirected->post['Group_'] : '';
    $GroupDesc_ = !empty($redirected->post['GroupDesc_']) ? $redirected->post['GroupDesc_'] : '';
    $Type = !empty($redirected->post['Type']) ? $redirected->post['Type'] : false;
    $problems = is_array($redirected->problems) ? $redirected->problems : array();
} else {
    $Group_ = '';
    $GroupDesc_ = '';
    $Type = false;
    $problems = array();
}
?>
    <div id="groups">
        <h3><?php 
echo $words->get('GroupsNewHeading');
?>
</h3>
        <form method="post" action="" enctype='multipart/form-data'>
        <?php 
echo $callback_tag;
?>
            <?php