aliroHTML Class Reference

List of all members.

Public Member Functions

 makeOption ($value, $text='', $selected=false, $valuename='value', $textname='text')
 selectList ($selections, $tag_name, $tag_attribs='', $key='value', $text='text', $selected=NULL)
 radioList ($arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text')
 yesnoRadioList ($tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO)
 idBox ($rowNum, $recId, $checkedOut=false, $name='cid')
 toolTip ($tooltip, $title='', $width='', $image='tooltip.png', $text='', $href='#')
 formatDate ($date, $format='', $offset='')
 checkedOutProcessing ($row, $i)
 publishedProcessing ($row, $i)
 loadCalendar ()

Static Public Member Functions

static getInstance ()

Private Member Functions

 checkedOut ($row, $overlib=1)

Static Private Attributes

static $instance = __CLASS__


Detailed Description

Definition at line 43 of file aliroHTML.php.


Member Function Documentation

static aliroHTML::getInstance (  )  [static]

aliroHTML::makeOption ( value,
text = '',
selected = false,
valuename = 'value',
textname = 'text' 
)

Definition at line 50 of file aliroHTML.php.

Referenced by aliroAuthoriser::get_group_children_tree(), and yesnoRadioList().

00050                                                                                                          {
00051         $obj = new stdClass;
00052         $obj->$valuename = $value;
00053         $obj->$textname = trim($text) ? $text : $value;
00054         $obj->selected = $selected;
00055         return $obj;
00056     }

aliroHTML::selectList ( selections,
tag_name,
tag_attribs = '',
key = 'value',
text = 'text',
selected = NULL 
)

Definition at line 59 of file aliroHTML.php.

References name.

00059                                                                                                                       {
00060         if (!is_array($selections)) return '';
00061         $selectproperties = array();
00062         if (is_array($selected)) foreach ($selected as $select) {
00063             if (is_object($select)) $selectproperties[] = $select->$key;
00064             else $selectproperties[] = $select;
00065         }
00066         else $selectproperties = array($selected);
00067         $selecthtml = '';
00068         foreach ($selections as $selection) {
00069             $select = ((isset($selection->selected) AND $selection->selected) OR in_array($selection->$key, $selectproperties, true)) ? 'selected="selected"' : '';
00070             $selecthtml .= <<<AN_OPTION
00071             <option value="{$selection->$key}" $select>
00072                 {$selection->$text}
00073             </option>
00074 AN_OPTION;
00075         }
00076         return <<<THE_SELECT
00077         <select name="$tag_name" $tag_attribs>
00078             $selecthtml
00079         </select>
00080 THE_SELECT;
00081     }

aliroHTML::radioList ( arr,
tag_name,
tag_attribs,
selected = null,
key = 'value',
text = 'text' 
)

Definition at line 83 of file aliroHTML.php.

References name.

Referenced by yesnoRadioList().

00083                                                                                                           {
00084         $html = '';
00085         foreach ($arr as $choice) {
00086             $extra = @$choice->id ? " id=\"$choice->id\"" : '';
00087             if (is_array($selected)) foreach ($selected as $obj) {
00088                 if ($choice->$key == $obj->$key) {
00089                     $extra .= ' selected="selected"';
00090                     break;
00091                 }
00092             }
00093             else $extra .= ($choice->$key == $selected ? " checked=\"checked\"" : '');
00094             $html .= <<<RADIO
00095             <input type="radio" name="$tag_name" value="{$choice->$key}" $extra $tag_attribs />
00096             {$choice->$text}
00097 RADIO;
00098         }
00099         return $html;
00100     }

aliroHTML::yesnoRadioList ( tag_name,
tag_attribs,
selected,
yes = _CMN_YES,
no = _CMN_NO 
)

Definition at line 102 of file aliroHTML.php.

References makeOption(), and radioList().

00102                                                                                                      {
00103         $arr = array(
00104         $this->makeOption( '0', $no, true ),
00105         $this->makeOption( '1', $yes, true )
00106         );
00107         return $this->radioList ($arr, $tag_name, $tag_attribs, $selected);
00108     }

aliroHTML::idBox ( rowNum,
recId,
checkedOut = false,
name = 'cid' 
)

Definition at line 110 of file aliroHTML.php.

References name.

Referenced by checkedOutProcessing().

00110                                                                             {
00111         return $checkedOut ? '' : <<<IDBOX
00112         <input type="checkbox" id="cb$rowNum" name="{$name}[]" value="$recId" onclick="isChecked(this.checked);" />
00113 IDBOX;
00114     }

aliroHTML::toolTip ( tooltip,
title = '',
width = '',
image = 'tooltip.png',
text = '',
href = '#' 
)

Definition at line 116 of file aliroHTML.php.

References aliroCore::getInstance().

00116                                                                                                         {
00117         if ($width) $width = ', WIDTH, \''.$width .'\'';
00118         if ($title) $title = ', CAPTION, \''.$title .'\'';
00119         if (!$text) {
00120             $image = aliroCore::getInstance()->getCfg('live_site').'/includes/js/ThemeOffice/'.$image;
00121             $text = '<img src="'.$image.'" alt="Tool Tip" />';
00122         }
00123         // $style = $href ? '' : 'style="text-decoration: none; color: #333;"';
00124         return <<<CTOOLTIP
00125         <a href="$href"> $text <span class="tooltip">$tooltip</span></a>
00126 CTOOLTIP;
00127         return <<<TOOLTIP
00128         <a href="$href" onmouseover="return overlib('$tooltip' $title, BELOW, RIGHT $width );" onmouseout="return nd();" $style > $text </a>
00129 TOOLTIP;
00130     }

aliroHTML::checkedOut ( row,
overlib = 1 
) [private]

Definition at line 132 of file aliroHTML.php.

References formatDate().

Referenced by checkedOutProcessing().

00132                                                   {
00133         if ($overlib) {
00134             if (!isset($row->editor)) {
00135                 $user = new mosUser();
00136                 $user->load($row->checked_out);
00137                 $row->editor = $user->name;
00138             }
00139             $date = $this->formatDate( $row->checked_out_time, '%A, %d %B %Y' );
00140             $time = $this->formatDate( $row->checked_out_time, '%H:%M' );
00141             $checked_out_text   = <<<CHECKED_OUT
00142 <table><tr><td>$row->editor</td></tr><tr><td>$date</td></tr><tr><td>$time</td></tr></table>
00143 CHECKED_OUT;
00144             $hover = 'onmouseover="return overlib(\''. $checked_out_text .'\', CAPTION, \'Checked Out\', BELOW, RIGHT);" onMouseOut="return nd();"';
00145         }
00146         else $hover = '';
00147         return '<img src="images/checked_out.png" '. $hover .' alt="Checked Out"/>';
00148     }

aliroHTML::formatDate ( date,
format = '',
offset = '' 
)

Definition at line 150 of file aliroHTML.php.

References aliroLanguage::getInstance(), and aliroCore::getInstance().

Referenced by checkedOut().

00150                                                               {
00151         $core = aliroCore::getInstance();
00152         // Format was originally set to %Y-%m-%d %H:%M:%S
00153         if (!$offset) $offset = $core->getCfg('offset');
00154         if ($date AND ereg( "([0-9]{4})-([0-9]{2})-([0-9]{2})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})", $date, $regs ) ) {
00155             $date = mktime( $regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1] );
00156             $date = $date > -1 ? aliroLanguage::getInstance()->getDate($format, $date + ($offset*60*60)) : '-';
00157         }
00158         return $date;
00159     }

aliroHTML::checkedOutProcessing ( row,
i 
)

Definition at line 161 of file aliroHTML.php.

References checkedOut(), aliroUser::getInstance(), and idBox().

00161                                                     {
00162         if ($row->checked_out) $checked = $this->checkedOut ($row);
00163         else $checked = $this->idBox ($i, $row->id, ($row->checked_out AND $row->checked_out != aliroUser::getInstance()->id));
00164         return $checked;
00165     }

aliroHTML::publishedProcessing ( row,
i 
)

Definition at line 167 of file aliroHTML.php.

References T_().

00167                                                    {
00168         $img    = $row->published ? 'publish_g.png' : 'publish_x.png';
00169         $task   = $row->published ? 'unpublish' : 'publish';
00170         $alt    = $row->published ? T_('Published') : T_('Unpublished');
00171         $action = $row->published ? T_('Unpublish Item') : T_('Publish item');
00172         return <<<PUBLISH_LINK
00173         <a href="javascript: void(0);" onclick="return listItemTask('cb$i','$task')" title="$action">
00174         <img src="images/$img" border="0" alt="$alt" />
00175         </a>
00176 PUBLISH_LINK;
00177 
00178     }

aliroHTML::loadCalendar (  ) 

Definition at line 180 of file aliroHTML.php.

References aliroRequest::getInstance(), and aliroCore::getInstance().

00180                                    {
00181         $live_site = aliroCore::getInstance()->getCfg('live_site');
00182         $tags = <<<END_TAGS
00183         <link rel="stylesheet" type="text/css" media="all" href="$live_site/extclasses/js/calendar/calendar-mos.css" title="green" />
00184         <!-- import the calendar script -->
00185         <script type="text/javascript" src="$live_site/extclasses/js/calendar/calendar.js"></script>
00186         <!-- import the language module -->
00187         <script type="text/javascript" src="$live_site/extclasses/js/calendar/lang/calendar-en.js"></script>
00188 END_TAGS;
00189         aliroRequest::getInstance()->addCustomHeadTag ($tags);
00190     }


Member Data Documentation

aliroHTML::$instance = __CLASS__ [static, private]

Definition at line 44 of file aliroHTML.php.


The documentation for this class was generated from the following file:

Generated on Wed May 14 13:01:59 2008 for ALIRO by  doxygen 1.5.5