Exemplo n.º 1
0
 function handler_review($page, $action = null, $mode = null)
 {
     // Include X-XRDS-Location response-header for Yadis discovery
     global $globals;
     header('X-XRDS-Location: ' . $globals->baseurl . '/openid/xrds');
     $this->load('review.inc.php');
     $dom = 'Review';
     if (@$GLOBALS['IS_XNET_SITE']) {
         $dom .= 'Xnet';
     }
     $wp = new PlWikiPage($dom . '.Admin');
     $conf = explode('%0a', $wp->getField('text'));
     $wiz = new PlWizard('Tour d\'horizon', PlPage::getCoreTpl('plwizard.tpl'), true);
     foreach ($conf as $line) {
         $list = preg_split('/\\s*[*|]\\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
         $wiz->addPage('ReviewPage', $list[0], $list[1]);
     }
     $wiz->apply($page, 'review', $action, $mode);
 }
Exemplo n.º 2
0
 protected function prepare()
 {
     $tpl = parent::prepare();
     global $wiz;
     $wiz = new PlWizard('Banana', PlPage::getCoreTpl('plwizard.tpl'), true, false);
     foreach ($this->pages as $name => &$mpage) {
         $wiz->addPage($this->handler, $mpage['text'], $name);
     }
     $wiz->apply(Platal::page(), $this->base, $this->page);
     return $tpl;
 }
Exemplo n.º 3
0
 function handler_p_edit($page, $hrpid = null, $opened_tab = null, $mode = null, $success = null)
 {
     global $globals;
     if (in_array($hrpid, array('general', 'adresses', 'emploi', 'poly', 'deco', 'mentor', 'deltaten'))) {
         $aux = $opened_tab;
         $opened_tab = $hrpid;
         $hrpid = $aux;
         $url_error = true;
     } else {
         $url_error = false;
     }
     $profile = $this->findProfile($hrpid);
     if (!$profile instanceof Profile && ($profile == PL_NOT_FOUND || $profile == PL_FORBIDDEN)) {
         return $profile;
     }
     if (is_null($hrpid) || $url_error) {
         pl_redirect('profile/edit/' . $profile->hrid() . (is_null($opened_tab) ? '' : '/' . $opened_tab));
     }
     // Build the page
     $page->addJsLink('jquery.ui.xorg.js');
     $page->addJsLink('education.js', true, false);
     /* dynamic content */
     $page->addJsLink('grades.js', true, false);
     /* dynamic content */
     $page->addJsLink('profile.js');
     $wiz = new PlWizard('Profil', PlPage::getCoreTpl('plwizard.tpl'), true, true, false);
     $wiz->addUserData('profile', $profile);
     $wiz->addUserData('owner', $profile->owner());
     $this->load('page.inc.php');
     $wiz->addPage('ProfilePageGeneral', 'Général', 'general');
     $wiz->addPage('ProfilePageAddresses', 'Adresses personnelles', 'adresses');
     $wiz->addPage('ProfilePageJobs', 'Informations professionnelles', 'emploi');
     $viewPrivate = S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE);
     if ($viewPrivate) {
         $wiz->addPage('ProfilePageGroups', 'Groupes X - Binets', 'poly');
     }
     $wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco');
     if ($viewPrivate) {
         $wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor');
     }
     if ($viewPrivate && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) {
         $wiz->addPage('ProfilePageDeltaten', 'Opération N N-10', 'deltaten');
     }
     $wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode);
     if (!$profile->birthdate) {
         $page->trigWarning("Ta date de naissance n'est pas renseignée, ce qui t'empêcheras de réaliser" . " la procédure de récupération de mot de passe si un jour tu le perdais.");
     }
     $page->setTitle('Mon Profil');
     $page->assign('hrpid', $profile->hrid());
     $page->assign('viewPrivate', $viewPrivate);
     $page->assign('isMe', S::user()->isMyProfile($profile));
     if (isset($success) && $success) {
         $page->trigSuccess('Ton profil a bien été mis à jour.');
     }
 }