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 () | |
Definition at line 522 of file admin.sef.php.
| dummy::editTask | ( | ) |
Definition at line 524 of file admin.sef.php.
References T_().
00524 { 00525 if ($this->errorid) { 00526 } 00527 else $this->redirect('index.php?core=cor_errors', T_('Please select an item for detailed display'), _ALIRO_ERROR_WARN); 00528 }
| dummy::removeTask | ( | ) |
Definition at line 530 of file admin.sef.php.
References aliroCoreDatabase::getInstance(), and T_().
00530 { 00531 if (count($this->cid)) { 00532 foreach ($this->cid as &$item) $item = intval($item); 00533 $idlist = implode(',', $this->cid); 00534 $database = aliroCoreDatabase::getInstance(); 00535 $database->doSQL("DELETE FROM #__error_log WHERE id IN ($idlist)"); 00536 $this->redirect('index.php?core=cor_errors'); 00537 } 00538 else $this->redirect('index.php?core=cor_errors', T_('Please select an item for deletion'), _ALIRO_ERROR_WARN); 00539 }
| dummy::cancelTask | ( | ) |
| dummy::sefAdminOldStuff | ( | ) |
Definition at line 545 of file admin.sef.php.
References $_REQUEST, deletemeta(), editMetaData(), getData(), one_component(), saveComponentFuncs(), and saveMetaData().
00545 { 00546 global $database, $sefnotes; 00547 $this->database = $database; 00548 $act = mosGetParam($_REQUEST, 'act'); 00549 $task = mosGetParam($_REQUEST, 'task'); 00550 $this->cid = (array) mosGetParam($_REQUEST, 'cid', array()); 00551 if ('metasave' == $task) $this->saveMetaData($act); 00552 if ('page404' == $task OR ('page404' == $act AND 'cancel' != $task)) { 00553 if ('remove' == $task) $this->delete404(); 00554 $this->list404(); 00555 return; 00556 } 00557 elseif ('listuri' == $task OR ('listuri' == $act AND 'cancel' != $task)) { 00558 if ('metadata' == $task AND 1 == count($this->cid)) { 00559 $this->editMetaData('listuri'); 00560 return; 00561 } 00562 if ('remove' == $task) $this->deleteuri(); 00563 $this->listuri(); 00564 return; 00565 } 00566 elseif ('listmeta' == $task OR ('listmeta' == $act AND 'cancel' != $task)) { 00567 if ('metadata' == $task AND 1 == count($this->cid)) { 00568 $this->editMetaData('listmeta'); 00569 return; 00570 } 00571 if ('remove' == $task) $this->deletemeta(); 00572 $this->listmeta(); 00573 return; 00574 } 00575 elseif ('components' == $act AND 'cancel' != $task) { 00576 $this->getData(); 00577 if ($task) { 00578 if ('save' == $task) $this->saveComponentFuncs (); 00579 else $this->one_component ($task); 00580 } 00581 return; 00582 } 00583 if ('metadata' == $task AND 1 == count($this->cid)) { 00584 $type = mosGetParam($_REQUEST, 'type', 'config'); 00585 $this->editMetaData($type); 00586 return; 00587 } 00588 if ('save' == $task) $this->storeData(); 00589 }
| dummy::addCustomHeadTag | ( | $ | tag | ) |
Definition at line 591 of file admin.sef.php.
References $mainframe.
00591 { 00592 global $mainframe; 00593 $mainframe->addCustomHeadTag ($tag); 00594 }
| dummy::getUserStateFromRequest | ( | $ | array, | |
| $ | name, | |||
| $ | default | |||
| ) |
Definition at line 596 of file admin.sef.php.
References $mainframe.
00596 { 00597 global $mainframe; 00598 return $mainframe->getUserStateFromRequest ($array, $name, $default); 00599 }
| dummy::getData | ( | ) |
Definition at line 601 of file admin.sef.php.
Referenced by sefAdminOldStuff().
00601 { 00602 $configs = $this->database->doSQLget ("SELECT * FROM #__remosef_config"); 00603 $vars = get_object_vars($this); 00604 foreach ($configs as $item) { 00605 if ('options' == $item->type) { 00606 $name = $item->name; 00607 if (isset($vars[$name]) AND !is_array($this->$name)) $this->$name = $item->modified; 00608 } 00609 elseif ('components' == $item->type) { 00610 $this->custom_code[$item->name] = $item->modified; 00611 } 00612 elseif ('characters' == $item->type) { 00613 $this->sef_name_chars[] = $item->name; 00614 $this->sef_translate_chars[] = $item->modified; 00615 } 00616 elseif ('substitutions' == $item->type) { 00617 $this->sef_substitutions_exact_name[$item->id] = $item->name; 00618 $this->sef_substitutions_exact_mod[$item->id] = $item->modified; 00619 } 00620 elseif ('substitutions_in' == $item->type) { 00621 $this->sef_substitutions_in[$item->name] = $item->modified; 00622 } 00623 elseif ('substitutions_out' == $item->type) { 00624 $this->sef_substitutions_out[$item->name] = $item->modified; 00625 } 00626 elseif ('content' == $item->type) $this->sef_content_task[$item->name] = $item->modified; 00627 else $this->component_details[$item->type][$item->name] = $item->modified; 00628 } 00629 unset($configs); 00630 }
| dummy::saveMetaData | ( | $ | act | ) |
Definition at line 633 of file admin.sef.php.
References $_REQUEST, and getMetaData().
Referenced by sefAdminOldStuff().
00633 { 00634 $type = ('listmeta' == $act) ? mosGetParam ($_REQUEST, 'metatype', 'config') : $act; 00635 $id = intval(mosGetParam ($_POST, 'id', 0)); 00636 $metadata = $this->getMetaData($act, $id); 00637 $setters[] = "type = '$type'"; 00638 $values[] = $metadata->uri; 00639 $values[] = $type; 00640 $inames = 'uri, type'; 00641 foreach (array('htmltitle','robots','description','keywords') as $fieldname) { 00642 $setters[] = $fieldname." = '".$this->database->getEscaped(mosGetParam($_POST, $fieldname))."'"; 00643 $values[] = $this->database->getEscaped(mosGetParam($_POST, $fieldname)); 00644 $inames .= ', '.$fieldname; 00645 } 00646 if ($metadata->id) $sql = "UPDATE #__remosef_metadata SET ".implode(', ', $setters)." WHERE id = $metadata->id"; 00647 else $sql = "INSERT INTO #__remosef_metadata ($inames) VALUES('".implode("', '", $values)."')"; 00648 $this->database->setQuery($sql); 00649 $this->database->query(); 00650 }
| dummy::translateLine | ( | $ | type, | |
| $ | name, | |||
| $ | modified, | |||
| $ | size = 30, |
|||
| $ | link = '' | |||
| ) |
Definition at line 653 of file admin.sef.php.
References size.
00653 { 00654 echo <<<TRANSLATE_LINE 00655 00656 <div class="remosefboxes"> 00657 <input name="{$type}[]" value="$name" class="inputbox" size="$size"" /> 00658 <input name="{$type}mod[]" value="$modified" class="inputbox" size="$size" /> 00659 $link 00660 </div> 00661 00662 TRANSLATE_LINE; 00663 00664 } 00665 00666 function remosefCSS () { 00667 $css = <<<REMOSEF_CSS 00668 00669 <style type="text/css" media="all"> 00670 .remosefhead { 00671 margin: 15px 0; 00672 padding: 6px 4px 2px 4px; 00673 height: 24px; 00674 background: url(templates/joomla_admin/images/background.jpg); 00675 background-repeat: repeat; 00676 font-size: 14px; 00677 font-weight: bold; 00678 color: #000; 00679 } 00680 .remosefinput { 00681 height: 24px; 00682 padding-top: 4px; 00683 border-bottom: 1px solid #DDD; 00684 } 00685 .remosefinput label { 00686 display: box; 00687 float: left; 00688 clear: left; 00689 text-align: right; 00690 width: 35%; 00691 } 00692 .remosefinput select, .remosefinput input { 00693 display: box; 00694 float: left; 00695 margin-left: 10px; 00696 } 00697 .remosefboxes{ 00698 height: 24px; 00699 } 00700 </style> 00701 00702 REMOSEF_CSS; 00703 00704 $this->addCustomHeadTag($css); 00705 } 00706 00707 00708 // private function 00709 function htmlspecialchars_decode_php4 ($str, $quote_style = ENT_COMPAT) { 00710 return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); 00711 } 00712 00713 00714 00715 function deleteuri () { 00716 $sql = $sql = "DELETE FROM #__remosef_uri WHERE id IN (%s)"; 00717 $this->deleteByCid ($sql); 00718 }
| dummy::deletemeta | ( | ) |
Definition at line 720 of file admin.sef.php.
Referenced by sefAdminOldStuff().
00720 { 00721 $sql = $sql = "DELETE FROM #__remosef_metadata WHERE id IN (%s)"; 00722 $this->deleteByCid ($sql); 00723 }
| dummy::deleteByCid | ( | $ | sql | ) |
Definition at line 725 of file admin.sef.php.
00725 { 00726 if (count($this->cid)) { 00727 foreach ($this->cid as $i=>$id) $this->cid[$i] = intval($id); 00728 $sql = sprintf($sql, implode(',', $this->cid)); 00729 $this->database->setQuery($sql); 00730 $this->database->query(); 00731 } 00732 }
| dummy::editMetaData | ( | $ | type | ) |
Definition at line 734 of file admin.sef.php.
Referenced by sefAdminOldStuff().
00734 { 00735 $id = intval($this->cid[0]); 00736 $metadata = $this->getMetaData($type, $id); 00737 require_once($this->getCfg('absolute_path').'/administrator/components/com_sef/admin.sef.html.php'); 00738 $view = new sefAdminHTML(); 00739 $view->editMetaData($type, $id, $metadata, $this); 00740 }
| dummy::getMetaData | ( | $ | type, | |
| $ | id | |||
| ) |
Definition at line 743 of file admin.sef.php.
Referenced by saveMetaData().
00743 { 00744 if ('config' == $type) { 00745 $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"; 00746 } 00747 elseif ('listuri' == $type) { 00748 $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"; 00749 } 00750 // Remaining alternative is 'listmeta' 00751 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'" 00752 ." LEFT JOIN #__remosef_config AS c ON c.type = 'substitutions' AND m.uri = c.name WHERE m.id = $id"; 00753 $this->database->setQuery($sql); 00754 $metadata = null; 00755 $this->database->loadObject($metadata); 00756 return $metadata; 00757 }
| dummy::one_component | ( | $ | task | ) |
| dummy::saveComponentFuncs | ( | ) |
Definition at line 762 of file admin.sef.php.
Referenced by sefAdminOldStuff().
00762 { 00763 mosCache::cleanCache('aliroSEF'); 00764 $component = mosGetParam($_POST, 'component'); 00765 if (0 === strpos($component,'com_')) { 00766 $this->database->setQuery("DELETE FROM #__remosef_config WHERE type = '$component'"); 00767 $this->database->query(); 00768 $this->component_details = array(); 00769 $component = $this->database->getEscaped($component); 00770 $tags = mosGetParam($_POST, $component, array()); 00771 $modified = mosGetParam($_POST, $component.'mod', array()); 00772 foreach ($tags as $key=>$tag) { 00773 if (!empty($modified[$key])) { 00774 $tag = $this->database->getEscaped($tag); 00775 $mod = $this->database->getEscaped($modified[$key]); 00776 $this->database->setQuery("INSERT INTO #__remosef_config VALUES (0, '$component', '$tag', '$mod')"); 00777 $this->database->query(); 00778 $this->component_details[$component][$tag] = $mod; 00779 } 00780 } 00781 $this->one_component($component); 00782 } 00783 }
1.5.5