Location: PHPKode > projects > osSchool > osschool/include/perspectives.php
<?php
/*
    osSchool - http://www.osschoolonline.net/
    Copyright (C) 2006  Julian Young 

    This program 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
    later version.

    This program 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, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    
*/
?>
<!-- perspectives -->
<script type="text/javascript">
<!--
var perspectiveColl=0;



  //var x=document.getElementById('myTable').rows[0].cells
  //x[0].innerHTML="NEW CONTENT"

function setBlip(cell) {
    //window.status='setBlip';
    return;
    document.getElementById('currentPerspectiveBlip').innerHTML='<img height="7" border="0" src="images/trans_pixel.gif">';
    document.getElementById('perspectiveTable').rows[2].cells[cell.cellIndex].innerHTML='<img height="7" src="images/blipSet.jpg">';
   
}

function resetBlip(cell) {
 return;
  //window.status='resetBlip';
  document.getElementById('perspectiveTable').rows[2].cells[cell.cellIndex].innerHTML='<img height="7" border="0" src="images/trans_pixel.gif">';
  document.getElementById('currentPerspectiveBlip').innerHTML='<img height="7" src="images/blipSet.jpg">';
}

function submitBlip(ID) {
  window.status='submitBlip';
  document.getElementById('perspectiveID').value = ID;
  document.getElementById('perspectiveForm').submit();
}

function submitSchoolGroup() {
  //window.status='submitSchoolGroup';
  document.getElementById('schoolGroupSelectForm').submit();
}

-->
</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td>

<table border="0" cellspacing="0" cellpadding="0">
<tr><td class="perspectiveNoBorder" ><p class="perspective">
<?php echo TEXT_SCHOOL_GROUP; ?>&nbsp;
</td></tr>
<td><img height="7" src="<?php echo DIR_IMAGES . IMG_TRANS_PIXEL ?>"></td></tr>
</table>
<td>

<form id="schoolGroupSelectForm" action="index.php" method="post" style="display : inline">
 <input name="<?php echo ACTION_KEY; ?>" type="hidden" value="<?php echo ACTION_SET_SCHOOLGROUP; ?>" >
 <select name="<?php echo ACTION_PARAM_SCHOOLGROUP; ?>" onchange="submitSchoolGroup();">
 <?php
 $session=ossSystem_Session::getSession();
 $numGroups=count($session->schoolGroups);
 for($i=0;$i < $numGroups; $i++){
   echo '<option ';
   if($session->schoolGroups[$i] == $session->currentSchoolGroup) {
      echo 'selected="selected" ';
   }
   echo '>' . $session->schoolGroups[$i] .'</option>';
 }
 ?>
 </select>
</form>

</td>
</td><td><img width="25" src="<?php echo DIR_IMAGES . IMG_TRANS_PIXEL ?>"></td><td>
  <table id="perspectiveTable" cellspacing="0" cellpadding="0">
  <FORM ACTION="index.php" id="perspectiveForm" method="POST">
  <input name="<?php echo ACTION_KEY; ?>" type="hidden" value="<?php echo ACTION_SET_PERSPECTIVE; ?>" >
  <input name="<?php echo ACTION_PARAM_PERSPECTIVE; ?>"  id="perspectiveID" type="HIDDEN"></FORM>
  <?php
    $session = ossSystem_Session::getSession();
    $perspectives = $session->getPerspectives();
    $perspectiveCount = count($perspectives);
    $perspectiveID = $session->getCurrentPerspectiveID();
    echo '<tr>';
    for($i = 0 ; $i < $perspectiveCount; $i++) {
       echo '<td><img height="7" src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td><td><img height="7" src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td>';
    }
    echo '</tr><tr>';
    for($i=0 ; $i < $perspectiveCount; $i++) {
      if($i == $perspectiveID){
        echo '<td id="currentPerspective"><input type="button" ';
      } else {
        echo '<td class="perspective"><input type="button" ';
      }
      echo 'class="pbut" height="20" onMouseOver=" hov(this,\'pbuth\');" onclick="submitBlip(\''. $i . '\')" onMouseOut="hov(this,\'pbut\');" value="';
      echo $perspectives[$i];
      echo '" /></td><td><img border="0" width="10" src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td>'."\n";
    }
    echo "</tr><tr>\n";
    for($i = 0 ; $i < $perspectiveCount; $i++) {
	    if($i == $perspectiveID){
           echo '<td id="currentPerspectiveBlip" class="blipCell" height="7" valign="top" align="center"><img  height="7"  src="' . DIR_IMAGES . IMG_BLIP . '"><td align="center"><img   border="0"  src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td>' . "\n";
      } else {
           echo '<td align="center" class="blipCell" ><img  border="0" src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td><td align="center"><img   border="0"  src="' . DIR_IMAGES . IMG_TRANS_PIXEL . '"></td>' . "\n";
      }
    }
    ?>
   </tr>
  </table>
  </td>
 </tr>
 </table>
<!-- perspectives -->
Return current item: osSchool