admin.sef.html.php

Go to the documentation of this file.
00001 <?php
00002 
00003 class sefAdminHTML {
00004 
00005     function sefNotes () {
00006         return <<<SEF_NOTES
00007 
00008 <form action="index2.php" method="post" name="adminForm">
00009 <table class="adminheading">
00010     <thead>
00011     <tr>
00012         <th>ReMOSef SEO component</th>
00013     </tr>
00014     </thead>
00015     <tbody>
00016     <tr>
00017         <td>
00018         ReMOSef component provides an advanced search engine optimisation framework.  It is
00019         designed particularly to work with sef_ext.php files - the interface it uses
00020         to these files is an extended version of that used by SEF Advance.  Any sef_ext.php
00021         file that works with one should work with the other, although those that do not have
00022         the Remosef extended interface will not provide full functionality.  That will affect
00023         the ability to translate task/function codes, and the forcing of unique ID codes.
00024         There are suitable files
00025         at http://www.remository.com for a number of standard components, written specifically
00026         to work with Remosef.  Support for sef_ext.php files is the responsibility of their
00027         respective authors!
00028         </td>
00029     </tr>
00030     <tr>
00031         <td>
00032         Remosef provides the SEF framework, but the individual sef_ext files carry out
00033         the translation of a URI between the basic form and the SEF form, as this work
00034         is specific to each component.  Although there are similarities, reliable SEF
00035         requires knowledge of how a component works.
00036         </td>
00037     </tr>
00038     <tr>
00039         <td>
00040             <tr>
00041         <td>
00042         Note that Remosef on its own provides only basic SEF (similar to Joomla) for
00043         all modules - only when sef_ext.php files are installed will advanced SEF
00044         come into action.  This applies even to the content component and to Remository.
00045         The content component must NOT be included in the list of components - it will
00046         be given basic SEF by default, and advanced SEF if its sef_ext.php file (from
00047         http://www.remository.com) is installed.
00048         </td>
00049     </tr>
00050 
00051         </td>
00052     </tr>
00053     <tr>
00054         <td>
00055         Where there are lists of similar items below, a number of empty boxes provide for
00056         additions.  When you save additions, new empty boxes will be provided, so there is
00057         no limit on the total number of items - provided you save additions a few at a time.
00058         </td>
00059     </tr>
00060     </tbody>
00061 </table>
00062 
00063 SEF_NOTES;
00064 
00065     }
00066 
00067     function listuris ($uris, $pageNav, $controller) {
00068         $urihtml = '';
00069         if ($uris) {
00070             $total = count($uris);
00071             $i = 0;
00072             foreach ($uris as $uri) {
00073                 $showage = time() - $uri->refreshed;
00074                 $uritext = htmlspecialchars($uri->uri, ENT_QUOTES, 'UTF-8');
00075                 $seftext = htmlspecialchars($uri->sef, ENT_QUOTES, 'UTF-8');
00076                 $urihtml .= <<<URI_LINE
00077 
00078             <tr>
00079                 <td>
00080                     <input type="checkbox" id="cb$i" name="cid[]" value="$uri->id" onclick="isChecked(this.checked);" />
00081                 </td>
00082                 <td>
00083                     $showage
00084                 </td>
00085                 <td>
00086                     $uritext
00087                 </td>
00088                 <td>
00089                     $seftext
00090                 </td>
00091             </tr>
00092 
00093 URI_LINE;
00094 
00095                 $i++;
00096             }
00097         }
00098         else $total = 0;
00099         echo <<<URI_LIST
00100 
00101     <h3>Standard Links Converted to SEF</h3>
00102     <form action="index2.php" method="post" name="adminForm">
00103         <div id="urifilters" style="padding-bottom:5px">
00104             <label for="origuri">Filter on raw URI:</label>
00105             <input type="text" name="origuri" id="origuri" value="{$controller->filters['origuri']}" size="40" class="inputbox" onChange="document.adminForm.submit();" />
00106             <label for="sefuri">Filter on SEF URI:</label>
00107             <input type="text" name="sefuri" id="sefuri" value="{$controller->filters['sefuri']}" size="40" class="inputbox" onChange="document.adminForm.submit();" />
00108         </div>
00109         <table class="adminlist">
00110             <thead>
00111                 <tr>
00112                     <th width="20">
00113                         <input type="checkbox" name="toggle" value="" onClick="checkAll($total);" />
00114                     </th>
00115                     <th align="left">Age (secs)</th>
00116                     <th align="left">Joomla URI</th>
00117                     <th align="left">SEF URI</th>
00118                 </tr>
00119             </thead>
00120             <tbody>
00121                 $urihtml
00122             </tbody>
00123         </table>
00124         {$pageNav->getListFooter()}
00125         <input type="hidden" name="core" value="cor_sef" />
00126         <input type="hidden" name="act" value="uri" />
00127         <input type="hidden" name="boxchecked" value="0" />
00128     </form>
00129     <!-- End of code from Remosef -->
00130 
00131 URI_LIST;
00132 
00133 
00134     }
00135 
00136     function listmeta ($metas, $pageNav, $controller) {
00137         $metahtml = '';
00138         if ($metas) {
00139             $total = count($metas);
00140             $i = 0;
00141             foreach ($metas as $meta) {
00142                 $typename = ('listuri' == $meta->type) ? 'Listed URIs' : 'Config spec';
00143                 $link = "index.php?core=cor_sef&act=listmeta&task=metadata&type=$meta->type&cid=$meta->id";
00144                 $uritext = htmlspecialchars($meta->uri, ENT_QUOTES, 'UTF-8');
00145                 $sef = ('config' == $meta->type) ? $meta->modified : $meta->sef;
00146                 $seftext = htmlspecialchars($sef, ENT_QUOTES, 'UTF-8');
00147                 $metahtml .= <<<META_LINE
00148 
00149             <tr>
00150                 <td>
00151                     <input type="checkbox" id="cb$i" name="cid[]" value="$meta->id" onclick="isChecked(this.checked);" />
00152                 </td>
00153                 <td>
00154                     $typename
00155                 </td>
00156                 <td>
00157                     <a href="$link">$uritext</a>
00158                 </td>
00159                 <td>
00160                     $seftext
00161                 </td>
00162                 <td>
00163                     $meta->htmltitle
00164                 </td>
00165                 <td>
00166                     $meta->robots
00167                 </td>
00168             </tr>
00169 
00170 META_LINE;
00171 
00172                 $i++;
00173             }
00174         }
00175         else $total = 0;
00176         echo <<<META_LIST
00177 
00178     <h3>Metadata overrides</h3>
00179     <form action="index2.php" method="post" name="adminForm">
00180         <div id="urifilters" style="padding-bottom:5px">
00181             <label for="origuri">Filter on raw URI:</label>
00182             <input type="text" name="origuri" id="origuri" value="{$controller->filters['origuri']}" size="40" class="inputbox" onChange="document.adminForm.submit();" />
00183             <label for="sefuri">Filter on SEF URI:</label>
00184             <input type="text" name="sefuri" id="sefuri" value="{$controller->filters['sefuri']}" size="40" class="inputbox" onChange="document.adminForm.submit();" />
00185         </div>
00186         <table class="adminlist">
00187             <thead>
00188                 <tr>
00189                     <th width="20">
00190                         <input type="checkbox" name="toggle" value="" onClick="checkAll($total);" />
00191                     </th>
00192                     <th align="left">Type</th>
00193                     <th align="left">Joomla URI</th>
00194                     <th align="left">SEF URI</th>
00195                     <th align="left">Title</th>
00196                     <th align="left">Robots</th>
00197                 </tr>
00198             </thead>
00199             <tbody>
00200                 $metahtml
00201             </tbody>
00202         </table>
00203         {$pageNav->getListFooter()}
00204         <input type="hidden" name="core" value="cor_sef" />
00205         <input type="hidden" name="act" value="listmeta" />
00206         <input type="hidden" name="boxchecked" value="0" />
00207     </form>
00208     <!-- End of code from Remosef -->
00209 
00210 META_LIST;
00211 
00212 
00213     }
00214 
00215     function editMetaData ($type, $id, $metadata, $controller) {
00216         $act = mosGetParam($_REQUEST, 'act');
00217         $act = ('listuri' == $act) ? 'listuri' : 'config';
00218         $css = <<<META_CSS
00219 
00220         <style type="text/css" media="screen">
00221         #sefmetadata div {
00222             padding: 10px 0;
00223         }
00224         #sefmetadata label {
00225             display: block;
00226             width: 25%;
00227             float: left;
00228             clear: left;
00229             margin: 5px 0 0 0;
00230             text-align: right;
00231         }
00232         #sefmetadata div input, #sefmetadata div textarea {
00233             float: left;
00234             /* display: inline; inline display must not be set or will hide submit buttons in IE 5x mac */
00235             margin:5px 0 0 10px; /* set margin on left of form elements rather than right of
00236                                     label aligns textarea better in IE */
00237             text-align: left;
00238         }
00239         #unsefd {
00240             color: green;
00241             font-size: 14px;
00242         }
00243         </style>
00244 
00245 META_CSS;
00246 
00247         $controller->addCustomHeadTag($css);
00248         $uritext = htmlspecialchars($metadata->uri, ENT_QUOTES, 'UTF-8');
00249         $sef = ('config' == $type) ? $metadata->modified : $metadata->sef;
00250         $seftext = htmlspecialchars($sef, ENT_QUOTES, 'UTF-8');
00251         echo <<<META_EDIT
00252 
00253     <table class="adminheading">
00254         <tr>
00255             <th>
00256                 $seftext <span id="unsefd">($uritext)</span>
00257             </th>
00258         </tr>
00259     </table>
00260     <table class="adminlist">
00261             <tr>
00262                 <th>
00263                     <h3>Metadata</h3>
00264                 </th>
00265             </tr>
00266     </table>
00267 
00268     <form action="index2.php" method="post" name="adminForm">
00269     <div id="sefmetadata">
00270         <div>
00271             <label for="htmltitle">HTML Title:</label>
00272             <input type="text" name="htmltitle" id="htmltitle" class="inputbox" size="60" value="$metadata->htmltitle" />
00273         </div>
00274         <div>
00275             <label for="robots">Robots:</label>
00276             <input type="text" name="robots" id="robots" class="inputbox" size="60" value="$metadata->robots" />
00277         </div>
00278         <div>
00279             <label for="description">Description:</label>
00280             <textarea name="description" id="description" rows="5" cols="60">$metadata->description</textarea>
00281         </div>
00282         <div>
00283             <label for="keywords">Keywords:</label>
00284             <textarea name="keywords" id="keywords" rows="5" cols="60">$metadata->keywords</textarea>
00285         </div>
00286         <div>
00287             <input type="hidden" name="core" value="cor_sef" />
00288             <input type="hidden" name="act" value="$type" />
00289             <input type="hidden" name="metatype" value="$metadata->type" />
00290             <input type="hidden" name="id" value="$id" />
00291             <input type="hidden" name="boxchecked" value="0" />
00292         </div>
00293     </div>
00294     </form>
00295 
00296 META_EDIT;
00297 
00298     }
00299 
00300 }

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