loadEngineFile('LinkBuildingLib.class.php'); $class['LinkBuildingLib'] = LinkBuildingLib::getInstance();*/ $retArray = array(); $data = array(); $localization_id = $class['Languages']->getLocalizationId(); // ------------------------------ $cacheIdent = 'HTML:'.$page_id.':'.$localization_id; if(!isset($this->module_conf['cachetime'])) $this->module_conf['cachetime'] = 86400; $class['Modules']->loadEngineFile('CacheLib.class.php'); $class['CacheLib'] = CacheLib::getInstance(); // ------------------------------ // vratit nacacheovany obsah if(!$class['Engine']->isWebAdminActivated() // kdyz neni aktivovana administrace && ($cachedData = $class['CacheLib']->loadCachedData($cacheIdent, intval($this->module_conf['cachetime']))) !== false) { $retArray['items'] = $cachedData; return $retArray; } // ------------------------------ $query = "SELECT h.html_id, h.content, pc.content_type FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("pages_content")." AS pc ON (h.html_id=pc.item_id ) WHERE pc.content_type='" . $this->module_name . "' AND pc.page_id=" . intval($page_id) . " AND h.localization_id=". $localization_id ."";//AND h.localization_id=pc.localization_id $query .= " ORDER BY pc.list_order ASC"; // vybrat obsah bloku $SQL = $class['SQL']->sqlQuery($query); $count = $class['SQL']->sqlNumRows($SQL); for($x = 0; $x < $count; $x++) { $html = $class['SQL']->sqlResult($SQL, $x, 'h.content'); /* // ---------------------------------------------------- // hledat relativni CMS linky v textu if(strpos($html, "{CMS_URL ") !== false || strpos($html, "{CMS_Link ") !== false) { $html = $class['LinkBuildingLib']->rewriteRelativeCMSLinks($html); } // ---------------------------------------------------- // rozmistit linkbuilding odkazy primo do textu $html = $class['LinkBuildingLib']->insertLinks2Content($html); // ---------------------------------------------------- // tipy dne $class['Modules']->loadAdminModuleFile('DayTips', 'DayTipsTexts.class.php'); $_DayTipsTexts = new DayTipsTexts_admin(); $tiphtml = $_DayTipsTexts->getPageDayTip($page_id, $localization_id); // ---------------------------------------------------- // vlozit tip dne na konkretni misto if(!empty($tiphtml)) { $html = $class['LinkBuildingLib']->insertHTML2Content($tiphtml, $html); } // ---------------------------------------------------- // nacist clanky $class['Modules']->loadWebModule('Articles2Pages'); $_Articles2Pages = new Articles2Pages(); $arts = $_Articles2Pages->getDataBlockContent(0, 'Y'); if(count($arts['items']) > 0) { $html .= '

'; $html .= '
'; $str = $class['Languages']->getWebTextString('common', 'related_articles'); if(!empty($str)) $html .= '

'.$str.'

'; $html .= ''; }*/ // ---------------------------------------------------- // srovnat html /*$class['Modules']->loadEngineFile('HTMLParser.class.php'); $class['HTMLParser'] = new HTMLParser(); $html = $class['HTMLParser']->expandHTML($html);*/ // ---------------------------------------------------- $data[$x] = array( 'item_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'html_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'content_type' => $class['SQL']->sqlResult($SQL, $x, 'pc.content_type'), 'content' => $html ); // -------------------------------------------------------- // sprava editovatelnych prvku pro administraci na webu if(isset($class['Engine']) && $class['Engine']->isWebAdminActivated() && isset($class['Session']) && $class['Session']->findPermission('HTML_EDIT')) { $class['Engine']->addEditableArea(array( 'item_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'content_type' => $class['SQL']->sqlResult($SQL, $x, 'pc.content_type'), 'granted_actions' => array( array( 'label' => 'Upravit text', 'type' => 'edit', 'link' => $class['URL']->createAdminURL(array( "URL" => "index.php", "mod" => $this->module_name, "switch" => 'edit', "item" => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), "webAdmin" => '1', "ESCAPE" => "NO" )) ) ) ), $data[$x]); } // -------------------------------------------------------- } $class['SQL']->sqlFreeResult($SQL); // ----------------------------- $retArray['items'] = $data; // ulozit do cache if($this->module_conf['cachetime'] > 0) $class['CacheLib']->cacheCachedData($cacheIdent, $data); return $retArray; } function getDataAjaxPageContent($page_id = 0, $page_dynamic = 'N') { return $this->getDataPageContent($page_id, $page_dynamic); } // ----------------------------------------------------------------- // funkce vraci data podle nastaveni function getDataBlockContent($block_id = 0, $block_dynamic = 'N') { global $class; /*$class['Modules']->loadEngineFile('LinkBuildingLib.class.php'); $class['LinkBuildingLib'] = LinkBuildingLib::getInstance();*/ $retArray = array(); $data = array(); $localization_id = $class['Languages']->getLocalizationId(); // ------------------------------ $cacheIdent = 'HTML:'.$block_id.':'.$localization_id; if(!isset($this->module_conf['cachetime'])) $this->module_conf['cachetime'] = 86400; $class['Modules']->loadEngineFile('CacheLib.class.php'); $class['CacheLib'] = CacheLib::getInstance(); // ------------------------------ // vratit nacacheovany obsah if(!$class['Engine']->isWebAdminActivated() // kdyz neni aktivovana administrace && ($cachedData = $class['CacheLib']->loadCachedData($cacheIdent, intval($this->module_conf['cachetime']))) !== false) { $retArray['items'] = $cachedData; return $retArray; } // ------------------------------ $query = "SELECT h.html_id, h.content, bc.content_type FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("blocks_content")." AS bc ON (h.html_id=bc.item_id ) WHERE bc.content_type='" . $this->module_name . "' AND bc.block_id=" . intval($block_id) . " AND h.localization_id=". $localization_id .""; $query .= " ORDER BY bc.list_order ASC";//AND h.localization_id=bc.localization_id // vybrat obsah bloku $SQL = $class['SQL']->sqlQuery($query); $count = $class['SQL']->sqlNumRows($SQL); for($x = 0; $x < $count; $x++) { $html = $class['SQL']->sqlResult($SQL, $x, 'h.content'); // ---------------------------------------------------- // hledat relativni CMS linky v textu /*if(strpos($html, "{CMS_URL ") !== false || strpos($html, "{CMS_Link ") !== false) { $html = $class['LinkBuildingLib']->rewriteRelativeCMSLinks($html); }*/ // ---------------------------------------------------- $data[$x] = array( 'item_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'html_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'content_type' => $class['SQL']->sqlResult($SQL, $x, 'bc.content_type'), 'content' => $html ); // -------------------------------------------------------- // sprava editovatelnych prvku pro administraci na webu if(isset($class['Engine']) && $class['Engine']->isWebAdminActivated() && isset($class['Session']) && $class['Session']->findPermission('HTML_EDIT')) { $class['Engine']->addEditableArea(array( 'item_id' => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), 'content_type' => $class['SQL']->sqlResult($SQL, $x, 'bc.content_type'), 'granted_actions' => array( array( 'label' => 'Upravit text', 'type' => 'edit', 'link' => $class['URL']->createAdminURL(array( "URL" => "index.php", "mod" => $this->module_name, "switch" => 'edit', "item" => $class['SQL']->sqlResult($SQL, $x, 'h.html_id'), "webAdmin" => '1', "ESCAPE" => "NO" )) ) ) ), $data[$x]); } // -------------------------------------------------------- } $class['SQL']->sqlFreeResult($SQL); // ----------------------------- $retArray['items'] = $data; // ulozit do cache if($this->module_conf['cachetime'] > 0) $class['CacheLib']->cacheCachedData($cacheIdent, $data); return $retArray; } function getDataAjaxBlockContent($block_id = 0, $block_dynamic = 'N') { $retArray = $this->getDataBlockContent($block_id, $block_dynamic); if (isset($_REQUEST['fnc']) && !empty($_REQUEST['fnc'])) $retArray['content_type'] = $this->module_name .':Ajax:'. $_REQUEST['fnc']; return $retArray; } // ----------------------------------------------------------------- // funkce je vyvolana zalozenim nove stranky. Fce ma za ukol zalozit // odpovidajici obsah nove strance function setUpNewPageContent($page_id, $page_dynamic = 'N', $localization_ids) { global $class; if (!is_array($localization_ids)) { trigger_error('page_localizations neni pole: page_localizations='.print_r($page_localizations, true)); return false; } if (empty($localization_ids)) { trigger_error('pole page_localizations je prazdne: page_localizations='.print_r($page_localizations, true)); return false; } // ------------------------------------------- // vlozit HTML $html_id = ($class['SQL']->getAutoincrementID('html', 'html_id')); foreach ($localization_ids as $loc_id) { $query = "INSERT INTO ".$class['SQL']->getTableName("html")." " ."(html_id, content, localization_id) " ."VALUES (". intval($html_id) .", '', ". $loc_id .") "; $SQL = $class['SQL']->sqlQuery($query); } // ------------------------------------------- // vlozit obsah stranky $query = "REPLACE INTO ".$class['SQL']->getTableName("pages_content")." " ."(page_id,item_id,content_type,list_order) " ."VALUES (".$page_id.",".$html_id.",'".$this->module_name."',1) "; $SQL = $class['SQL']->sqlQuery($query); // ------------------------------------------- return true; } /** * Je vyvolana lokalizovanim stavajici stranky z administrace. * Fce ma za ukol zlokalizovat obsah zaradeny do stranky * @param int $page_id číslo stránky * @param enum $page_dynamic zda se jedná o dynamickou stránku * @param array $localization_ids seznam lokalizaci pro danou stranku * @return boolean výsledek * @access public * @author Petr Kovacik */ function localizePageContent($page_id, $page_dynamic = 'N', $localization_ids) { global $class; $localization_id = intval($class['Languages']->getLocalizationID()); $query = "SELECT DISTINCT h.html_id, h.content, pc.content_type FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("pages_content")." AS pc ON (h.html_id=pc.item_id ) WHERE pc.content_type='" . $this->module_name . "' AND pc.page_id=" . intval($page_id) . " "; $list = $class['SQL']->sqlFetchAssocFromSelect($query); foreach($list as $row) { // ----------------------------------------------------------------------- // lokalizace polozky $translate = 'changes'; $class['Localizations']->localize('edit', 'html', array( 'html_id' => intval($row['html_id']) ), $localization_id, $localization_ids, null, null, $translate, array()); } return true; } // ----------------------------------------------------------------- // funkce je vyvolana zalozenim noveho bloku. Fce ma za ukol zalozit // odpovidajici obsah noveho bloku function setUpNewBlockContent($block_id, $block_dynamic = 'N', $localization_ids) { global $class; if (!is_array($localization_ids)) { trigger_error('block_localizations neni pole'); return false; } if (empty($localization_ids)) { trigger_error('pole block_localizations je prazdne'); return false; } // ------------------------------------------- // vlozit HTML $html_id = ($class['SQL']->getAutoincrementID('html', 'html_id')); foreach ($localization_ids as $loc_id) { $query = "INSERT INTO ".$class['SQL']->getTableName("html")." " ."(html_id, content, localization_id) " ."VALUES (". intval($html_id) .", '', ". $loc_id .") "; $SQL = $class['SQL']->sqlQuery($query); } // ------------------------------------------- // vlozit obsah bloku $query = "INSERT INTO ".$class['SQL']->getTableName("blocks_content")." " ."(block_id,item_id,content_type,list_order) " ."VALUES (".$block_id.",".$html_id.",'".$this->module_name."', 1) "; $SQL = $class['SQL']->sqlQuery($query); // ------------------------------------------- return true; } /** * Je vyvolana lokalizovanim stavajiciho bloku z administrace. * Fce ma za ukol zlokalizovat obsah zaradeny do bloku * @param int $block_id číslo bloku * @param enum $block_dynamic zda se jedná o dynamický blok * @param array $localization_ids seznam lokalizaci pro dany blok * @return boolean výsledek * @access public * @author Petr Kovacik */ function localizeBlockContent($block_id, $block_dynamic = 'N', $localization_ids) { global $class; $localization_id = intval($class['Languages']->getLocalizationID()); $query = "SELECT DISTINCT h.html_id, h.content, bc.content_type FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("blocks_content")." AS bc ON (h.html_id=bc.item_id ) WHERE bc.content_type='" . $this->module_name . "' AND bc.block_id=" . intval($block_id) . " "; $list = $class['SQL']->sqlFetchAssocFromSelect($query); foreach($list as $row) { // ----------------------------------------------------------------------- // lokalizace polozky $translate = 'changes'; $class['Localizations']->localize('edit', 'html', array( 'html_id' => intval($row['html_id']) ), $localization_id, $localization_ids, null, null, $translate, array()); } return true; } // ----------------------------------------------------------------- // funkce je vyvolana odstranenim stranky. Fce ma za ukol odstranit // odpovidajici obsah stranky function setUpDeletedPageContent($page_id, $localization_ids) { global $class; if (!is_array($localization_ids)) { trigger_error('page_localizations neni pole'); return false; } if (empty($localization_ids)) { trigger_error('pole page_localizations je prazdne'); return false; } // vybrat obsah stranky $query = "SELECT DISTINCT h.html_id FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("pages_content")." AS pc ON (h.html_id=pc.item_id ) WHERE pc.content_type='" . $this->module_name . "' AND pc.page_id=" . intval($page_id) . " ";//AND h.localization_id=pc.localization_id $SQL = $class['SQL']->sqlQuery($query); $count = $class['SQL']->sqlNumRows($SQL); for($x = 0; $x < $count; $x++) { $html_id = intval($class['SQL']->sqlResult($SQL, $x, 'h.html_id')); $localization_id_str = implode(",", $localization_ids); // smazat HTML $query = "DELETE FROM ".$class['SQL']->getTableName("html")." " ."WHERE html_id=". $html_id ." AND localization_id IN (". $localization_id_str .") "; $class['SQL']->sqlQuery($query); } $class['SQL']->sqlFreeResult($SQL); return true; } // ----------------------------------------------------------------- // funkce je vyvolana odstranenim bloku. Fce ma za ukol odstranit // odpovidajici obsah bloku function setUpDeletedBlockContent($block_id, $localization_ids) { global $class; if (!is_array($localization_ids)) { trigger_error('block_localizations neni pole'); return false; } if (empty($localization_ids)) { trigger_error('pole block_localizations je prazdne'); return false; } // vybrat obsah bloku $query = "SELECT h.html_id FROM ".$class['SQL']->getTableName("html")." AS h JOIN ".$class['SQL']->getTableName("blocks_content")." AS bc ON (h.html_id=bc.item_id ) WHERE bc.content_type='" . $this->module_name . "' AND bc.block_id=" . intval($block_id) . " ";//AND h.localization_id=bc.localization_id $SQL = $class['SQL']->sqlQuery($query); $count = $class['SQL']->sqlNumRows($SQL); for($x = 0; $x < $count; $x++) { $html_id = intval($class['SQL']->sqlResult($SQL, $x, 'h.html_id')); $localization_id_str = implode(",", $localization_ids); // smazat HTML $query = "DELETE FROM ".$class['SQL']->getTableName("html")." " ."WHERE html_id=". $html_id ." AND localization_id IN (". $localization_id_str .") "; $class['SQL']->sqlQuery($query); } $class['SQL']->sqlFreeResult($SQL); return true; } // ----------------------------------------------------------------- } ?>
Fatal error: Class 'HTML' not found in /var/www/vhosts/czechproject.cz/iq-testy-melker/www/engine/URL.class.php(443) : eval()'d code on line 1