00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/Display.php';
00027
00028
00029
00030
00041
00042 class FF_Action_Display_Links extends FF_Action {
00043
00044
00052 function run()
00053 {
00054 $this->o_output->setPageName($this->getPluralText());
00055
00056 $s_searchLetter = strtolower(FF_Request::getParam('letter', 'g', 'a'));
00057 if (!preg_match('/[a-z]/', $s_searchLetter)) {
00058 $s_searchLetter = 'a';
00059 }
00060
00061
00062 $o_widget =& new FF_Smarty('linksNav');
00063 $o_widget->assign(array(
00064 'T_links_navTitle' => _('Alumni web sites sorted by last name'),
00065 'T_links_navHelp' => sprintf(_('If you are an alumnus of %s and would like to have your web site linked here select "update" from the menu at the left.'), $this->o_registry->getConfigParam('alumni/school_name'))));
00066
00067 $s_count = 0;
00068 foreach(range('A', 'Z') as $s_letter) {
00069 $s_break = (++$s_count % 6 == 0) ? '<br />' : '';
00070 $o_widget->append('links_navLetter', $this->o_output->link(
00071 FastFrame::selfURL(array('letter' => $s_letter)), $s_letter) . $s_break);
00072 }
00073
00074 $this->o_output->o_tpl->append('content_right', $o_widget->fetch());
00075
00076
00077 $o_widget =& new FF_Smarty('links');
00078 $o_widget->assign('I_letter', $this->o_output->imgTag(
00079 $s_searchLetter . '.gif', 'letters',
00080 array('app' => 'alum_website', 'name' => $s_searchLetter)));
00081
00082 $o_result =& $this->o_model->getWebSites($s_searchLetter);
00083 if ($o_result->numRows() == 0) {
00084 $o_widget->append('links_row', array('T_alumni_site' => '',
00085 'T_alumni_name' => '<span style="font-style: italic;">' .
00086 sprintf(_('There are no %s to display'), strtolower($this->getPluralText())) .
00087 '</span>'));
00088 }
00089 else {
00090 while ($a_row = $o_result->fetchRow()) {
00091 $this->o_model->reset();
00092 $this->o_model->importFromArray($a_row);
00093 $o_widget->append('links_row', array(
00094 'T_alumni_name' => $this->o_model->getFirstName() . ' ' . $this->o_model->getLastName(),
00095 'T_alumni_site' => $this->o_output->link($this->o_model->getWebSite(),
00096 $this->o_model->getWebSite(), array('target' => '_blank'))));
00097 }
00098 }
00099
00100 $this->o_output->o_tpl->append('content_middle', $o_widget->fetch());
00101 return $this->o_nextAction;
00102 }
00103
00104
00105
00106
00113 function getPluralText()
00114 {
00115 return _('Links');
00116 }
00117
00118
00119 }
00120 ?>