Ejemplo n.º 1
0
 public function executeList()
 {
     $title = "Most recent bug reports and feature suggestions";
     $tab = str_replace(' ', '', $this->getRequestParameter('tab', 'mostrecent'));
     $c = new Criteria();
     if ($tab == 'mostrecent') {
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
     } elseif ($tab == 'mostpopular') {
         $c2 = new Criteria();
         $c2->add(sfRecommendationPeer::RECOMMENDABLE_MODEL, 'SuggestedFeature');
         $c2->addDescendingOrderByColumn(sfRecommendationPeer::SCORE);
         $recommendations = sfRecommendationPeer::doSelect($c2);
         // this loop has got to be SUPER intensive, it has to change soon
         $features = array();
         foreach ($recommendations as $recommended) {
             $features[] = SuggestedFeaturePeer::retrieveByPK($recommended->getRecommendableId());
         }
         $title = "Most popular bug reports and feature suggestions";
     } elseif ($tab == 'bugs') {
         $c->add(SuggestedFeaturePeer::TYPE, sfConfig::get('app_feature_type_bug'));
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
         $title = 'Bug Reports';
     } elseif ($tab == 'features') {
         $c->add(SuggestedFeaturePeer::TYPE, sfConfig::get('app_feature_type_feature'));
         $c->addDescendingOrderByColumn(SuggestedFeaturePeer::CREATED_AT);
         $title = 'Feature Suggestions';
     }
     //This only works while it's not a pager, not a long term solution!
     if (!isset($features)) {
         $this->features = SuggestedFeaturePeer::doSelect($c);
     } else {
         $this->features = $features;
     }
     myToolkit::prependPageTitle($title);
 }
Ejemplo n.º 2
0
function forum_breadcrumb($params, $options = array())
{
    if (!$params) {
        return;
    }
    $first = true;
    $title = '';
    $id = isset($options['id']) ? $options['id'] : 'forum_navigation';
    $html = '<ul id="' . $id . '">';
    foreach ($params as $step) {
        $separator = $first ? '' : sfConfig::get('app_sfSimpleForumPlugin_breadcrumb_separator', ' » ');
        $first = false;
        $html .= '<li>' . $separator;
        $title .= $separator;
        if (is_array($step)) {
            $html .= link_to($step[0], $step[1]);
            $title .= $step[0];
        } else {
            $html .= $step;
            $title .= $step;
        }
        $html .= '</li>';
    }
    $html .= '</ul>';
    myToolkit::prependPageTitle($title);
    return $html;
}
Ejemplo n.º 3
0
 public function save($conn = null)
 {
     $uuid = myToolkit::customUuid(sfConfig::get('app_uuid_project_length'));
     if ($this->getUuid() == null) {
         $this->setUuid($uuid);
     }
     parent::save($conn);
 }
Ejemplo n.º 4
0
 public function save($con = null)
 {
     if ($this->getUuid() == null || strlen($this->getUuid()) > sfConfig::get('app_uuid_project_length')) {
         $this->setUuid(myToolkit::customUuid(sfConfig::get('app_uuid_project_length')));
     }
     parent::save();
     if (sfContext::getInstance()->getUser()->isAuthenticated()) {
         $user = sfContext::getInstance()->getUser();
         //$user->refreshCredentials();
     }
 }
Ejemplo n.º 5
0
 public function handleErrorSubmit()
 {
     $message = new ContactMessage();
     $message->setName($this->getRequestParameter('name'));
     $message->setEmail($this->getRequestParameter('email'));
     $message->setMessage($this->getRequestParameter('message'));
     $this->message = $message;
     $this->setTemplate('index');
     myToolkit::prependPageTitle('Contact Us');
     return sfView::SUCCESS;
 }
Ejemplo n.º 6
0
 protected function setPage($page_name = null)
 {
     // Get page from request if not given as parameter (default behaviour)
     if (is_null($page_name)) {
         $page_name = $this->getRequestParameter('page', $this->startPage);
     }
     // Handle case insensitivity
     $page_name = strtolower($page_name);
     // Support default page if not specified in namespace
     if (substr($page_name, -1) == ':') {
         if ($this->getRequestParameter('wiki') == null) {
             die('wiki not specified');
         }
         $page_name .= $this->startPage;
     }
     // Retrieve the page, or start a new one if cannot be found
     $this->page = $this->wiki->getPage($page_name);
     if (!$this->page) {
         $this->initNewPage($page_name);
     }
     // Retrieve the revision
     $revision = $this->getRequestParameter('revision', $this->page->getLatestRevision());
     $this->revision = $this->page->getRevision($revision);
     if (!$this->revision) {
         $this->initNewRevision();
     }
     // Generate the URI parameters to keep trace of the requested page
     $this->uriParams = 'slug=' . $this->slug;
     $this->uriParams .= '&page=' . $this->page->getName();
     if ($this->revision->getRevision() != $this->page->getLatestRevision()) {
         $this->uriParams .= '&revision=' . $this->revision->getRevision();
     }
     myToolkit::prependPageTitle($page_name . sfConfig::get("app_site_title_delimiter") . $this->project->getTitle() . ' Wiki');
     // Permissions management
     $this->canView = $this->page->canView($this->getUser());
     $this->canEdit = $this->page->canEdit($this->getUser());
 }
Ejemplo n.º 7
0
<?php

myToolkit::prependPageTitle(sfConfig::get('app_title_create_project'));
use_helper('Object', 'Global', 'Project', 'nifty');
?>

<?php 
include_partial("home/storage_div");
?>

<?php 
echo nav_tabs('projects', $tab);
?>

  <ul style="list-style:horizontal;">
    <li style="float:left;margin-right:5px;">1. Description</li>
    <li style="float:left;margin-right:5px;">2. Details</li>
    <li style="float:left;margin-right:5px;">3. Timeline</li>
  </ul>
  <hr class="clear" />

  <h1>Creating a project on Cothink . . .</h1>
  <div id="project-information" style="width:70%;float:left;background-color:#87B94D;color:white;padding:4px;">
    <h2>Here are a few things you should know...</h2>
    <p>
      Projects on Cothink have to meet certain requirements.<br />
      <span>1. As the project manager, you'll have to show how your proposal will benefit your community, and explain why student work will be a good fit for you.</span><br />
      <span>2. When you create your first project, we take a few extra steps to verify your identity. You might be required to upload a photo of yourself, or fill in extra fields for your profile.</span><br />
      Also, creating a project can be difficult, especially if you're not familiar with the subject area - you know what you want, but you don't know what it involves. At every step of the process, you can flag your application for help. The Cothink community, made up of experts from every field, will then be shown the page of the application you've requested help for. Everyone will make comments, and guide you, offering suggestions on setting reasonable guidelines. Only you can actually make the changes though, so no worries. Take the suggestions you like, and politely decline the ones you don't.
  </div>
Ejemplo n.º 8
0
 public function executeShowUserMailbox()
 {
     $this->folder = $this->getRequestParameter('folder');
     $this->tab = $this->folder;
     if ($this->tab == 'sent') {
         $this->messages = MessagePeer::getUserOutbox($this->getRequestParameter('page'));
     } else {
         $this->messages = MessagePeer::getUserMailbox($this->tab, $this->getRequestParameter('page'));
     }
     myToolkit::prependPageTitle(ucwords($this->folder) . sfConfig::get('app_site_title_delimiter') . ' Messages ');
 }
Ejemplo n.º 9
0
 public function executeEditProfile()
 {
     // TODO: validate via validate.yml
     // TODO: limit profile editing to user only. Current setup may work.
     $this->forward404Unless($this->getUser()->isAuthenticated(), 'not logged in, cannot edit profile, obviously');
     $this->tab = "editprofile";
     $this->profile = $this->getUser()->getProfile();
     $this->campuses = CampusPeer::doSelect(new Criteria());
     $this->departments = DepartmentPeer::doSelect(new Criteria());
     $this->subdepartments = SubdepartmentPeer::doSelect(new Criteria());
     myToolkit::prependPageTitle('Editing your profile');
 }
Ejemplo n.º 10
0
 /**
  * Executes showEvents action
  *
  */
 public function executeShowEvents()
 {
     $this->forward404Unless($this->project = ProjectPeer::retrieveBySlug($this->getRequestParameter('project')), 'Project does not exist, using slug [' . $this->getRequestParameter('project') . ']');
     $this->tab = sfConfig::get('app_tab_project_events');
     myToolkit::prependPageTitle('Calendar for project "' . $this->project->getTitle() . '"');
 }