dummy Class Reference

List of all members.

Public Member Functions

 editTask ()
 removeTask ()
 cancelTask ()
 sefAdminOldStuff ()
 addCustomHeadTag ($tag)
 getUserStateFromRequest ($array, $name, $default)
 getData ()
 saveMetaData ($act)
 translateLine ($type, $name, $modified, $size=30, $link='')
 deletemeta ()
 deleteByCid ($sql)
 editMetaData ($type)
 getMetaData ($type, $id)
 one_component ($task)
 saveComponentFuncs ()


Detailed Description

Definition at line 528 of file admin.sef.php.


Member Function Documentation

dummy::editTask (  ) 

Definition at line 530 of file admin.sef.php.

References T_().

00530                                 {
00531         if ($this->errorid) {
00532         }
00533         else $this->redirect('index.php?core=cor_errors', T_('Please select an item for detailed display'), _ALIRO_ERROR_WARN);
00534     }

dummy::removeTask (  ) 

Definition at line 536 of file admin.sef.php.

References aliroCoreDatabase::getInstance(), and T_().

00536                                   {
00537         if (count($this->cid)) {
00538             foreach ($this->cid as &$item) $item = intval($item);
00539             $idlist = implode(',', $this->cid);
00540             $database = aliroCoreDatabase::getInstance();
00541             $database->doSQL("DELETE FROM #__error_log WHERE id IN ($idlist)");
00542             $this->redirect('index.php?core=cor_errors');
00543         }
00544         else $this->redirect('index.php?core=cor_errors', T_('Please select an item for deletion'), _ALIRO_ERROR_WARN);
00545     }

dummy::cancelTask (  ) 

Definition at line 547 of file admin.sef.php.

00547                                   {
00548         $this->redirect('index.php?core=cor_sef');
00549     }

dummy::sefAdminOldStuff (  ) 

Definition at line 551 of file admin.sef.php.

References $_REQUEST, deletemeta(), editMetaData(), getData(), one_component(), saveComponentFuncs(), and saveMetaData().

00551                                  {
00552         global $database, $sefnotes;
00553         $this->database = $database;
00554         $act = mosGetParam($_REQUEST, 'act');
00555         $task = mosGetParam($_REQUEST, 'task');
00556         $this->cid = (array) mosGetParam($_REQUEST, 'cid', array());
00557         if ('metasave' == $task) $this->saveMetaData($act);
00558         if ('page404' == $task OR ('page404' == $act AND 'cancel' != $task)) {
00559             if ('remove' == $task) $this->delete404();
00560             $this->list404();
00561             return;
00562         }
00563         elseif ('listuri' == $task OR ('listuri' == $act AND 'cancel' != $task)) {
00564             if ('metadata' == $task AND 1 == count($this->cid)) {
00565                 $this->editMetaData('listuri');
00566                 return;
00567             }
00568             if ('remove' == $task) $this->deleteuri();
00569             $this->listuri();
00570             return;
00571         }
00572         elseif ('listmeta' == $task OR ('listmeta' == $act AND 'cancel' != $task)) {
00573             if ('metadata' == $task AND 1 == count($this->cid)) {
00574                 $this->editMetaData('listmeta');
00575                 return;
00576             }
00577             if ('remove' == $task) $this->deletemeta();
00578             $this->listmeta();
00579             return;
00580         }
00581         elseif ('components' == $act AND 'cancel' != $task) {
00582             $this->getData();
00583             if ($task) {
00584                 if ('save' == $task) $this->saveComponentFuncs ();
00585                 else $this->one_component ($task);
00586             }
00587             return;
00588         }
00589         if ('metadata' == $task AND 1 == count($this->cid)) {
00590             $type = mosGetParam($_REQUEST, 'type', 'config');
00591             $this->editMetaData($type);
00592             return;
00593         }
00594         if ('save' ==  $task) $this->storeData();
00595     }

dummy::addCustomHeadTag ( tag  ) 

Definition at line 597 of file admin.sef.php.

References $mainframe.

00597                                      {
00598         global $mainframe;
00599         $mainframe->addCustomHeadTag ($tag);
00600     }

dummy::getUserStateFromRequest ( array,
name,
default 
)

Definition at line 602 of file admin.sef.php.

References $mainframe.

00602                                                                {
00603         global $mainframe;
00604         return $mainframe->getUserStateFromRequest ($array, $name, $default);
00605     }

dummy::getData (  ) 

Definition at line 607 of file admin.sef.php.

Referenced by sefAdminOldStuff().

00607                         {
00608         $configs = $this->database->doSQLget ("SELECT * FROM #__remosef_config");
00609         $vars = get_object_vars($this);
00610         foreach ($configs as $item) {
00611             if ('options' == $item->type) {
00612                 $name = $item->name;
00613                 if (isset($vars[$name]) AND !is_array($this->$name)) $this->$name = $item->modified;
00614             }
00615             elseif ('components' == $item->type) {
00616                 $this->custom_code[$item->name] = $item->modified;
00617             }
00618             elseif ('characters' == $item->type) {
00619                 $this->sef_name_chars[] = $item->name;
00620                 $this->sef_translate_chars[] = $item->modified;
00621             }
00622             elseif ('substitutions' == $item->type) {
00623                 $this->sef_substitutions_exact_name[$item->id] = $item->name;
00624                 $this->sef_substitutions_exact_mod[$item->id] = $item->modified;
00625             }
00626             elseif ('substitutions_in' == $item->type) {
00627                 $this->sef_substitutions_in[$item->name] = $item->modified;
00628             }
00629             elseif ('substitutions_out' == $item->type) {
00630                 $this->sef_substitutions_out[$item->name] = $item->modified;
00631             }
00632             elseif ('content' == $item->type) $this->sef_content_task[$item->name] = $item->modified;
00633             else $this->component_details[$item->type][$item->name] = $item->modified;
00634         }
00635         unset($configs);
00636     }

dummy::saveMetaData ( act  ) 

Definition at line 639 of file admin.sef.php.

References $_REQUEST, and getMetaData().

Referenced by sefAdminOldStuff().

00639                                  {
00640         $type = ('listmeta' == $act) ? mosGetParam ($_REQUEST, 'metatype', 'config') : $act;
00641         $id = intval(mosGetParam ($_POST, 'id', 0));
00642         $metadata = $this->getMetaData($act, $id);
00643         $setters[] = "type = '$type'";
00644         $values[] = $metadata->uri;
00645         $values[] = $type;
00646         $inames = 'uri, type';
00647         foreach (array('htmltitle','robots','description','keywords') as $fieldname) {
00648             $setters[] = $fieldname." = '".$this->database->getEscaped(mosGetParam($_POST, $fieldname))."'";
00649             $values[] = $this->database->getEscaped(mosGetParam($_POST, $fieldname));
00650             $inames .= ', '.$fieldname;
00651         }
00652         if ($metadata->id) $sql = "UPDATE #__remosef_metadata SET ".implode(', ', $setters)." WHERE id = $metadata->id";
00653         else $sql = "INSERT INTO #__remosef_metadata ($inames) VALUES('".implode("', '", $values)."')";
00654         $this->database->setQuery($sql);
00655         $this->database->query();
00656     }

dummy::translateLine ( type,
name,
modified,
size = 30,
link = '' 
)

Definition at line 659 of file admin.sef.php.

References size.

00659                                                                          {
00660         echo <<<TRANSLATE_LINE
00661 
00662         <div class="remosefboxes">
00663             <input name="{$type}[]" value="$name" class="inputbox" size="$size"" />
00664             <input name="{$type}mod[]" value="$modified" class="inputbox" size="$size" />
00665             $link
00666         </div>
00667 
00668 TRANSLATE_LINE;
00669 
00670     }
00671 
00672     function remosefCSS () {
00673         $css = <<<REMOSEF_CSS
00674 
00675 <style type="text/css" media="all">
00676 .remosefhead {
00677     margin: 15px 0;
00678     padding: 6px 4px 2px 4px;
00679     height: 24px;
00680     background: url(templates/joomla_admin/images/background.jpg);
00681     background-repeat: repeat;
00682     font-size: 14px;
00683     font-weight: bold;
00684     color: #000;
00685 }
00686 .remosefinput {
00687     height: 24px;
00688     padding-top: 4px;
00689     border-bottom: 1px solid #DDD;
00690 }
00691 .remosefinput label {
00692     display: box;
00693     float: left;
00694     clear: left;
00695     text-align: right;
00696     width: 35%;
00697 }
00698 .remosefinput select, .remosefinput input {
00699     display: box;
00700     float: left;
00701     margin-left: 10px;
00702 }
00703 .remosefboxes{
00704     height: 24px;
00705 }
00706 </style>
00707 
00708 REMOSEF_CSS;
00709 
00710         $this->addCustomHeadTag($css);
00711     }
00712 
00713 
00714     // private function
00715     function htmlspecialchars_decode_php4 ($str, $quote_style = ENT_COMPAT) {
00716        return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
00717     }
00718 
00719 
00720 
00721     function deleteuri () {
00722         $sql = $sql = "DELETE FROM #__remosef_uri WHERE id IN (%s)";
00723         $this->deleteByCid ($sql);
00724     }

dummy::deletemeta (  ) 

Definition at line 726 of file admin.sef.php.

Referenced by sefAdminOldStuff().

00726                            {
00727         $sql = $sql = "DELETE FROM #__remosef_metadata WHERE id IN (%s)";
00728         $this->deleteByCid ($sql);
00729     }

dummy::deleteByCid ( sql  ) 

Definition at line 731 of file admin.sef.php.

00731                                 {
00732         if (count($this->cid)) {
00733             foreach ($this->cid as $i=>$id) $this->cid[$i] = intval($id);
00734             $sql = sprintf($sql, implode(',', $this->cid));
00735             $this->database->setQuery($sql);
00736             $this->database->query();
00737         }
00738     }

dummy::editMetaData ( type  ) 

Definition at line 740 of file admin.sef.php.

Referenced by sefAdminOldStuff().

00740                                   {
00741         $id = intval($this->cid[0]);
00742         $metadata = $this->getMetaData($type, $id);
00743         require_once($this->getCfg('absolute_path').'/administrator/components/com_sef/admin.sef.html.php');
00744         $view = new sefAdminHTML();
00745         $view->editMetaData($type, $id, $metadata, $this);
00746     }

dummy::getMetaData ( type,
id 
)

Definition at line 749 of file admin.sef.php.

Referenced by saveMetaData().

00749                                       {
00750         if ('config' == $type) {
00751             $sql = "SELECT c.name AS uri, c.modified AS sef, m.id, m.htmltitle, m.robots, m.description, m.keywords FROM #__remosef_config AS c LEFT JOIN #__remosef_metadata AS m ON m.uri = c.name WHERE c.id = $id";
00752         }
00753         elseif ('listuri' == $type) {
00754             $sql = "SELECT u.uri, u.sef, m.id, m.htmltitle, m.robots, m.description, m.keywords FROM #__remosef_uri AS u LEFT JOIN #__remosef_metadata AS m ON m.uri = u.uri WHERE u.id = $id";
00755         }
00756         // Remaining alternative is 'listmeta'
00757         else $sql = "SELECT m.*, u.sef, c.modified FROM #__remosef_metadata AS m LEFT JOIN #__remosef_uri AS u ON m.uri = u.uri AND m.type = 'listuri'"
00758         ." LEFT JOIN #__remosef_config AS c ON c.type = 'substitutions' AND m.uri = c.name WHERE m.id = $id";
00759         $this->database->setQuery($sql);
00760         $metadata = null;
00761         $this->database->loadObject($metadata);
00762         return $metadata;
00763     }

dummy::one_component ( task  ) 

Definition at line 765 of file admin.sef.php.

Referenced by sefAdminOldStuff().

00765                                    {
00766     }

dummy::saveComponentFuncs (  ) 

Definition at line 768 of file admin.sef.php.

Referenced by sefAdminOldStuff().

00768                                    {
00769         mosCache::cleanCache('aliroSEF');
00770         $component = mosGetParam($_POST, 'component');
00771         if (0 === strpos($component,'com_')) {
00772             $this->database->setQuery("DELETE FROM #__remosef_config WHERE type = '$component'");
00773             $this->database->query();
00774             $this->component_details = array();
00775             $component = $this->database->getEscaped($component);
00776             $tags = mosGetParam($_POST, $component, array());
00777             $modified = mosGetParam($_POST, $component.'mod', array());
00778             foreach ($tags as $key=>$tag) {
00779                 if (!empty($modified[$key])) {
00780                     $tag = $this->database->getEscaped($tag);
00781                     $mod = $this->database->getEscaped($modified[$key]);
00782                     $this->database->setQuery("INSERT INTO #__remosef_config VALUES (0, '$component', '$tag', '$mod')");
00783                     $this->database->query();
00784                     $this->component_details[$component][$tag] = $mod;
00785                 }
00786             }
00787             $this->one_component($component);
00788         }
00789     }


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

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