<?php $objFeatureBox = $this->newObject('featurebox', 'navigation'); $userMenu =& $this->newObject('usermenu', 'toolbar'); $objUser = $this->getObject('user', 'security'); $link = $this->loadClass('href', 'htmlelements'); // Create an instance of the css layout class $cssLayout =& $this->newObject('csslayout', 'htmlelements'); // Set columns to 2 $cssLayout->setNumColumns(2); $header = new htmlheading(); $header->type = 1; $header->str = $this->objLanguage->languageText('mod_errors_heading', 'errors'); // Add Post login menu to left column $leftSideColumn = ''; if ($objUser->isLoggedIn()) { $leftSideColumn = $userMenu->show(); } else { $linkhome = new href($this->objConfig->getSiteRoot(), $this->objLanguage->languageText("word_home", 'system', 'Home')); $leftSideColumn = $linkhome->show(); } $midcol = $header->show(); // Add Left column $cssLayout->setLeftColumnContent($leftSideColumn); $midcol .= $objFeatureBox->show($this->objLanguage->languageText("word_error", "system"), $this->objLanguage->languagetext("mod_errors_spammeralert", "errors")); $cssLayout->setMiddleColumnContent($midcol); echo $cssLayout->show();
$noIcon = $this->objIcon->setIcon('redcross'); $noIcon = $this->objIcon->show(); $memcache->addServer($servers['ip'], $servers['port']); if ($memcache->getServerStatus($servers['ip'], $servers['port']) != 0) { $status = $yesIcon; } else { $status = $noIcon; } $extStatsLink = new href($this->uri(array('action' => 'displaystats', 'id' => $servers['ip'] . ":" . $servers['port']), 'cache'), $this->objLanguage->languageText("mod_cache_viewstats", "cache")); $tbl->startRow(); $tbl->addCell($servers['ip']); $tbl->addCell($servers['port']); // get a status icon and show it here $tbl->addCell($status); // get a stats icon $tbl->addCell($extStatsLink->show()); // edit/delete option... $tbl->addCell(''); //$edIcon.$delIcon); $tbl->endRow(); } //print_r($cache); $middleColumn .= $cform . $tbl->show(); if (isset($stats)) { // print_r($stats); $stbl = $this->newObject('htmltable', 'htmlelements'); $stbl->cellpadding = 3; $stbl->width = "100%"; $stbl->align = "center"; //set up the header row $stbl->startHeaderRow();
$str .= $this->registerdata['MODULE_STATUS']; $str .= "</b>\n"; $objTbl2->addRow(array('<b>' . $this->objLanguage->languageText('mod_modulecatalogue_status', 'modulecatalogue') . ':</b>', $str)); } $str = '<b>' . $this->objLanguage->languageText('mod_modulecatalogue_tables', 'modulecatalogue') . ":</b>\n"; if (isset($this->registerdata['TABLE'])) { $str .= "<ul>\n"; foreach ($this->registerdata['TABLE'] as $table) { $str .= "<li>{$table}</li>\n"; } $str .= "</ul>\n"; } $objTbl3->addRow(array($str)); // Finally we put the tables together and print out the result: $objTblClass->addRow(array($objTbl2->show(), $objTbl3->show()), 'even', "valign='top'"); // Link back $link1 = "<a href='" . $this->uri(array('cat' => $this->getParm('cat')), 'modulecatalogue') . "'>" . $this->objLanguage->languageText('mod_modulecatalogue_return', 'modulecatalogue') . "</a>"; $link2 = ''; $space = ''; if ($this->objModFile->findController($this->modname)) { $link2 = "<a href='" . $this->uri(array(), $this->modname) . "'>" . $this->objLanguage->languageText('mod_modulecatalogue_go', 'modulecatalogue') . " <b>" . ucwords($this->modname) . "</b></a>"; $space = ' <b>/</b> '; } $link3 = " <b>/</b> <a href='" . $this->uri(array('action' => 'reloaddefaultdata', 'moduleid' => $this->registerdata['MODULE_ID'])) . "'>" . $this->objLanguage->languageText('mod_modulecatalogue_reloaddefault', 'modulecatalogue') . "</a>"; $this->loadClass('href', 'htmlelements'); $instButton = new href($this->uri(array('action' => 'install', 'mod' => $this->modname, 'cat' => $activeCat), 'modulecatalogue'), $this->objLanguage->languageText('word_install'), NULL); $instButtonShow = $instButton->show(); $objTblClass->startRow(); $objTblClass->addCell($link2 . $space . $link1 . $link3 . $space . $instButtonShow, "", NULL, 'center', NULL, 'colspan="2"'); $objTblClass->endRow(); echo $objTblClass->show();
/** * * Method to parse the string * @param String $str The string to parse * @return The parsed string * */ public function parse($txt) { // check that the sysadmin has enabled this filter... $this->sysConfig = $this->getObject('dbsysconfig', 'sysconfig'); $this->enableparser = $this->sysConfig->getValue('mod_filters_wikipediaparser', 'filters'); if ($this->enableparser == 'ON') { $tarr = explode(" ", strip_tags($txt)); foreach ($tarr as $words) { $words = trim($words); if ($words != '' || !isset($words) || !empty($words)) { // do the wikipedia lookup $url = 'http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=' . trim($words) . '&rvprop=content&format=xml'; // set up for a cURL...THERE IS A CURL WRAPPER THAT DOES THIS IN ONE LINE $this->objProxy = $this->getObject('proxyparser', 'utilities'); $proxyArr = $this->objProxy->getProxy(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if (!empty($proxyArr) && $proxyArr['proxy_protocol'] != '') { curl_setopt($ch, CURLOPT_PROXY, $proxyArr['proxy_host'] . ":" . $proxyArr['proxy_port']); curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyArr['proxy_user'] . ":" . $proxyArr['proxy_pass']); } $code = curl_exec($ch); curl_close($ch); // use simplexml to load the string... $xml = simplexml_load_string($code); // $xml->error will exist on bad pages (i.e. no page exists) if ($xml->error) { continue; } else { $page = $xml->query; if ($page->normalized || $page->pages) { $title = $page->pages->page['title']; $linker = new href('http://en.wikipedia.org/wiki/' . $title, $words, " target=_blank"); $link[] = array('word' => $words, 'url' => $linker->show()); } } } else { continue; } } // look for and replace the word (linked) in the text. foreach ($link as $thing) { $orig = $thing['word']; $txt = preg_replace("/ {$orig} /", " " . $thing['url'] . " ", $txt); } } return $txt; }
/** * Method to show a license * * @return string Rendered Input */ public function show($license = '') { $objModules = $this->getObject('modules', 'modulecatalogue'); if (!$objModules->checkIfRegistered('creativecommons')) { return ''; } if ($license != '') { $this->license = $license; } // Get All Licenses $licenseInfo = $this->objCC->getLicense($this->license); if ($licenseInfo == FALSE) { return NULL; } $iconsFolder = 'icons/creativecommons_v3'; // Get List of Icons $icons = explode(',', $licenseInfo['images']); // Add nowrap class to prevent overflow $iconList = '<span class="nowrap">'; if ($this->icontype == 'big') { $filename = $licenseInfo['code'] . '_big'; } else { $filename = $licenseInfo['code']; } $filename = str_replace('/', '_', $filename); $this->objIcon->setIcon($filename, NULL, $iconsFolder); $this->objIcon->alt = $licenseInfo['title']; $this->objIcon->title = $licenseInfo['title']; $iconList .= $this->objIcon->show(); // End Span $iconList .= '</span>'; // Show as link if it has a link, else just show icons if (trim($licenseInfo['url']) == '') { return $iconList . $this->getRdf($this->license); //$radio->show(); } else { $this->loadClass('href', 'htmlelements'); $link = new href($licenseInfo['url'], $iconList, 'rel="license"'); return $link->show() . $this->getRdf($this->license); } }
public function layoutUsers($users, $grId, $numperRow = 5) { $utable = $this->newObject('htmltable', 'htmlelements'); $utable->cellpadding = 5; $inners = NULL; $row = 0; $utable->startRow(); foreach ($users as $user) { $itable = $this->newObject('htmltable', 'htmlelements'); $itable->cellpadding = 2; $icon = $this->newObject('geticon', 'htmlelements'); $icon->setIcon('delete'); $href = $this->loadClass('href', 'htmlelements'); $lnk = new href($this->uri(array('action' => 'removeuser', 'id' => $user['perm_user_id'], 'grid' => $grId)), $icon->show(), NULL); $image = $this->objUser->getUserImage($user['auth_user_id']); $username = $this->objUser->fullName($user['auth_user_id']); $itable->startRow(); $itable->addCell($image); $itable->startRow(); $itable->addCell($username . " " . $lnk->show()); $itable->endRow(); // if the $row var is divisible by 4, start a new row if (is_int($row / $numperRow)) { $utable->endRow(); $utable->startRow(); } $utable->addCell($itable->show()); $row++; } $utable->endRow(); return $utable->show(); }