Пример #1
0
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     if (!helperFunctions::isLoggedIn($request)) {
         $this->redirect("siteadmin/login");
     }
     $this->sectionNames = subMenuOptions::getMaintenanceSectionNames();
     $this->sectionDetails = subMenuOptions::getMaintenanceSectionDetails();
 }
Пример #2
0
 public function get()
 {
     $returnStr = "<div id='left'>";
     $returnStr .= $this->getMenuStud();
     if ($this->_menuOption < subMenuOptions::MAINTENANCE) {
         // courses and search menu styling
         $conn = Propel::getConnection();
         if (isset($this->_courseId)) {
             if (!isset($this->_ratingYearArray)) {
                 // get rating data
                 $this->_ratingYearArray = AutoCourseRatingPeer::getAvailableYearsForCourseId($this->_courseId, $conn);
             }
             if (!isset($this->_examYearArray)) {
                 // get exam data
                 $this->_examYearArray = ExamPeer::getAvailableYearsForCourseId($this->_courseId, $conn);
             }
             if ($this->_menuOption == subMenuOptions::COURSE) {
                 $returnStr .= "<dl><dt>" . $this->_courseId . "</dt>";
             } else {
                 $returnStr .= "<dl><dt>" . link_to($this->_courseId, "course/index?id=" . $this->_courseId) . "</dt>";
             }
             // critique
             $returnStr .= "<div class='popupmenu' id='subCritique' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>";
             if (count($this->_ratingYearArray) == 0) {
                 $returnStr .= "<a>None Available</a>";
             } else {
                 foreach ($this->_ratingYearArray as $year) {
                     $returnStr .= link_to(helperFunctions::translateTerm($year), "course/critique?id=" . $this->_courseId . "&year=" . $year);
                 }
             }
             $returnStr .= "</div>\n\t        \t<dd><a class='pointer' onmouseover='mopen(\"subCritique\")' onmouseout='mclosetime()'>Course Critiques</a></dd>";
             // exams
             $returnStr .= "<div class='popupmenu' id='subExam' onmouseover='mcancelclosetime()' onmouseout='mclosetime()'>";
             if (count($this->_examYearArray) == 0) {
                 $returnStr .= "<a>None Available</a>";
             } else {
                 foreach ($this->_examYearArray as $year) {
                     $returnStr .= link_to(helperFunctions::translateTerm($year), "course/exam?id=" . $this->_courseId . "&year=" . $year);
                 }
             }
             $returnStr .= "<a onclick='grayout(\"submitExam\");'>Submit Exams</a>";
             $returnStr .= "</div>\n\t        \t<dd><a class='pointer' onmouseover='mopen(\"subExam\")' onmouseout='mclosetime()'>Exams Repository</a></dd></dl>";
         }
     } elseif ($this->_menuOption == subMenuOptions::MAINTENANCE) {
         //TODO: make maintenance menu
         $returnStr .= "<dl><dt>" . link_to("Maintenance", "maintenance/index") . "</dt>";
         foreach (subMenuOptions::getMaintenanceSections() as $key => $value) {
             $returnStr .= "<dd>" . link_to($key, $value) . "</dd>";
         }
     } elseif ($this->_menuOption == subMenuOptions::ERROR) {
         $returnStr .= "<dl><dt>Error</dt></dl>";
     }
     $returnStr .= "</div>";
     return $returnStr;
 }
Пример #3
0
<?php

use_helper('Object');
include_partial("global/submenu", array("menuOption" => subMenuOptions::MAINTENANCE));
?>
<div id="main"><div id="critique_content">
<h2>Skule Courses Maintenance</h2>
<p>This section provides means to manage SkuleCourses. Please note that modifications to the system are irreversible once saved. 
Please pay due diligence when accessing this section.</p>
<p>Editable Sections:</p>
<table style='width:100%'>
<?php 
$counter = 0;
foreach (subMenuOptions::getMaintenanceSections() as $key => $value) {
    ?>
	<?php 
    if ($counter % 2 == 0) {
        ?>
		</tr>
		<tr>
	<?php 
    }
    ?>
	<td width="50%">
		<h3><?php 
    echo link_to($sectionNames[$key], $value);
    ?>
</h3>
		<p>
		<?php 
    echo $sectionDetails[$key];
Пример #4
0
				<dt><?php 
        echo link_to("Maintenance", "siteadmin/index");
        ?>
</dt>
			<?php 
    }
    ?>
			
			<?php 
    if ($menuOption != subMenuOptions::MAINTENANCE_LOGIN) {
        ?>
				<?php 
        foreach (subMenuOptions::getMaintenanceSections() as $key => $value) {
            ?>
				<?php 
            $names = subMenuOptions::getMaintenanceSectionNames();
            ?>
				<?php 
            if ($menuOption == $key) {
                ?>
		        <dd><?php 
                echo $names[$key];
                ?>
</dd>
		        <?php 
            } else {
                ?>
		        <dd><?php 
                echo link_to($names[$key], $value);
                ?>
</dd>