public function executeShow(sfWebRequest $request) { $this->blog_post = Doctrine::getTable('BlogPost')->find($request->getParameter('id')); $this->forward404Unless($this->blog_post); $this->categories = Doctrine::getTable('BlogCategory')->createQuery('c')->execute(); $this->blog_about = csSettings::getSetting('Blog About'); }
public function processUpload($settings, $files) { $default_path = csSettings::getDefaultUploadPath(); foreach ($files as $slug => $file) { if ($file['name']) { $setting = Doctrine::getTable('csSetting')->findOneBySlug($slug); $target_path = $setting->getOption('upload_path'); $target_path = $target_path ? $target_path : $default_path; //If target path does not exist, attempt to create it if (!file_exists($target_path)) { $target_path = mkdir($target_path) ? $target_path : 'uploads'; } $target_path = $target_path . DIRECTORY_SEPARATOR . basename($file['name']); if (!move_uploaded_file($file['tmp_name'], $target_path)) { $this->getUser()->setFlash('error', 'There was a problem uploading your file!'); } else { $setting->setValue(basename($file['name'])); $setting->save(); } } elseif (isset($settings[$slug . '_delete'])) { $setting = Doctrine::getTable('csSetting')->findOneBySlug($slug); unlink($setting->getUploadPath() . '/' . $setting->getValue()); $setting->setValue(''); $setting->save(); } } }
public function executeAddConfirm(sfWebRequest $request) { $this->class = Doctrine::getTable('dsClass')->findOneById($this->class->id); $this->person = $this->getRoute()->getObject(); // prepare the form $this->form = new dsClassStudentAddConfirmForm(); $this->form->setDefault('fee', $this->person->getIsStudent() ? $this->class->getFeeReduced() : $this->class->getFee() ); $message = csSettings::get('message.confirm'); $this->form->setDefault('message', $message ); $this->form->setDefault('fee', $this->person->getIsStudent() ? $this->class->getFeeReduced() : $this->class->getFee() ); if ($request->isMethod(sfRequest::POST)) { $form = $this->form; $form->bind($this->getRequest()->getParameter($form->getName()) ); if ($form->isValid()) { // todo: make transaction !! // $enrollment = $this->class->enroll( $person, $role, $message ); $this->getUser()->setFlash('notice', sprintf('%s has been confirmed to the class.', $this->person )); $this->redirect('ds_class_students'); } else { $this->getUser()->setFlash('error', sprintf('An error occured. Please try again.', null )); } } //Doctrine::getTable('dsClass')->findOneById($this->class_id)); }
public function sendMailValidation($email) { $user = sfContext::getInstance()->getUser()->getUsername(); $url = csSettings::get('baseurl'); $token = sha1(sfContext::getInstance()->getUser()->getUsername() . $email); $message = sfContext::getInstance()->getMailer()->compose(array(csSettings::get('email') => csSettings::get('email_nom')), $email, '[' . csSettings::get('email_prefixe') . '] Validation de votre nouvelle adresse mail', <<<EOF Bonjour, Vous venez de changer votre adresse mail sur COPIsim. Pour valider le changement d'adresse e-mail, nous vous prions de bien vouloir aller sur le lien suivant : {$url}etudiant/mail/{$user}/{$token} Merci. L'administration. Ce message a été généré automatiquement, merci de ne pas y répondre. EOF ); sfContext::getInstance()->getMailer()->send($message); }
<li class='sf_admin_action_save_settings'> <input type="submit" name="submit" value="Save Settings"> </li> <?php if (csSettings::isAuthenticated($sf_user)) { ?> <?php echo $helper->linkToNew(array('params' => array(), 'class_suffix' => 'new', 'label' => 'New')); } ?> <li class='sf_admin_action_restore_all_defaults'> <?php echo link_to('Restore All Defaults', '@cs_setting_restore_all_defaults', array('confirm' => 'Are you sure?')); ?> </li>
?> <?php include_javascripts(); ?> </head> <body> <div id="container"> <div id="header"> <span id="titre"><a href="<?php echo url_for('@homepage'); ?> "><?php echo image_tag('copisim_logo.png', 'alt=COPIsim'); ?> <h1> <?php echo csSettings::get('titre_du_site'); ?> </h1></a></span> <span id="menu"> <ul> <li><a href="<?php echo url_for('copisim_periode/index'); ?> ">Periode</a></li> <li><a href="<?php echo url_for('copisim_poste/index'); ?> ">Poste</a></li> <li><a href="<?php echo url_for('copisim_fac/index');
<div id="sf_admin_theme_footer"> <?php if (csSettings::getSetting('Show Backend Copyright')->value == 'yes') { ?> Copyright © <?php echo symAdminTools::getProperty('site'); ?> . All rights reserved. <?php } ?> </div>
<div id="bottom"> <div class="center-wrapper"> <div class="left"> <?php if (csSettings::getSetting('Show Copyright')->value == 'yes') { ?> Copyright © 2009 by <?php echo csSettings::getSetting('Copyright')->value; ?> <span class="text-separator">|</span> <?php } ?> <a href="<?php echo url_for('@about'); ?> "><?php echo __('About', array(), 'main'); ?> </a> <span class="text-separator">|</span> <a href="#"><?php echo __('Privacy Policy', array(), 'main'); ?> </a> <span class="text-separator">|</span> <a href="#"><?php echo __('Terms of Use', array(), 'main'); ?> </a> <span class="text-separator">|</span> <a href="#"><?php echo __('Full feed', array(), 'main');
public function postDelete($event) { csSettings::clearSettingsCache(); }
/** * Executes about action */ public function executeAbout() { $this->about = csSettings::getSetting('About'); }