/home/balatona/public_html/controller/class/db/query.php
print 'console.log(' . $query . ')';
print 'console.array(' . $values . ')';
print 'console.log(' . \CO\SYSTEM\DB::boundQuery($this->getConnection(), $query, $values) . ')';
print '</script>';
}
}
if (\CO\SYSTEM\DEV::getStoreSQLQueries()) {
self::storeSQLQueryToSession(\CO\SYSTEM\DB::boundQuery($this->getConnection(), $query, $values));
}
// var_dump($query);
$pstmt->execute($values);
if ($pstmt->errorCode() !== '00000') {
// var_dump(debug_backtrace());
$er = $pstmt->errorInfo();
$er = $er[1] . ': ' . $er[2];
\CO\SYSTEM\ERROR::throwError(\CO\SYSTEM\HTTP\CODE\CODE500::createInstance()
->setMessage($er)
->addData($query, 'query')
->addData($values, 'values')
->addData(\CO\SYSTEM\DB::boundQuery($this->getConnection(), $query, $values), 'boundedQuery')
);
}
// var_dump($pstmt->errorInfo());
// var_dump($pstmt->errorCode());
switch ($this->type) {
case 'show':
case 'select':
// if ($this->class) {
// $ret = new $this->class();
// } else {
// if ($this->collectionClass) {
//
// }
if ($ret == NULL) {
$ret = new COLLECTION();
}
// $ret = new COLLECTION();
// $cc = $this->collectionClass;
// $ret = new $cc();
// $ret = new MYSQL_COLLECTION();
/home/balatona/public_html/sites/admin/modules/content/class/field/field.php
try {
$id = \CO\SYSTEM\CRYPT::decryptLocal($id);
return self::get($id, $language);
} catch (\Exception $e) {
return NULL;
}
}
/**
* @param FIELD\COLLECTION\BUILDER|NULL $builder
* @return FIELD\COLLECTION
* @throws \CO\SYSTEM\DB\EXCEPTION\CANT_CONNECT_TO_DATABASE
*/
public static function getCollection(\CO\CONTENT\FIELD\COLLECTION\BUILDER $builder = NULL) {
if ($builder == NULL) {
$builder = new \CO\CONTENT\FIELD\COLLECTION\BUILDER();
}
$query = self::getCollectionQuery($builder);
$ret = new \CO\CONTENT\FIELD\COLLECTION();
$query->execute($ret);
return $ret;
}
public static function getCollectionQuery(\CO\CONTENT\FIELD\COLLECTION\BUILDER $builder = NULL) {
if ($builder == NULL) {
$builder = new \CO\CONTENT\FIELD\COLLECTION\BUILDER();
}
$subquery = \CO\SYSTEM\DB::getInstance()
->select()
->from('content_field cf')
->leftJoin('content_field_lang cfl', 'cf.cf_id=cfl.content_field')
->orderByAdminLanguages($builder->getLanguage())
;
$subquery->setLimit(PHP_INT_MAX);
if ($builder->getId()) {
$subquery->andWhere('cf_id=?', $builder->getId());
}
if ($builder->getContentType()) {
$subquery->andWhere('content_type=?', $builder->getContentType()
/home/balatona/public_html/sites/admin/modules/content/class/type/type.php
$fields = array_flip($fields);
$fields = array_flip($fields);
if (count($fields) != 1) {
$builder->setOrderBy('order_num ASC');
} else {
$builder->setOrderBy($fields[0] . ' ' . $cob[1]);
}
}
}
$builder->setContentType($this);
return \CO\CONTENT::getCollectionQuery($builder);
}
/**
* @return FIELD\COLLECTION|FIELD[]|IFIELD[]
*/
public function getFields() {
$builder = new \CO\CONTENT\FIELD\COLLECTION\BUILDER();
$builder->setContentType($this);
return FIELD::getCollection($builder);
}
/**
* @return FIELD|IFIELD|null
*/
public function getPrimaryField() {
foreach ($this->getFields() as $field) {
if ($field->isPrimaryField()) {
return $field;
}
}
return NULL;
}
public function setContentOrderBy($value) {
$this->row->content_order_by = $value;
}
public function getContentOrderBy() {
return $this->row->content_order_by;
/home/balatona/public_html/sites/admin/modules/content/class/type/type.php
}
}
$builder->setContentType($this);
return \CO\CONTENT::getCollectionQuery($builder);
}
/**
* @return FIELD\COLLECTION|FIELD[]|IFIELD[]
*/
public function getFields() {
$builder = new \CO\CONTENT\FIELD\COLLECTION\BUILDER();
$builder->setContentType($this);
return FIELD::getCollection($builder);
}
/**
* @return FIELD|IFIELD|null
*/
public function getPrimaryField() {
foreach ($this->getFields() as $field) {
if ($field->isPrimaryField()) {
return $field;
}
}
return NULL;
}
public function setContentOrderBy($value) {
$this->row->content_order_by = $value;
}
public function getContentOrderBy() {
return $this->row->content_order_by;
}
private static $fieldMap = array();
/**
* @param $variable
/home/balatona/public_html/sites/admin/modules/content/class/content/content.php
$str = $pf->getValue();
$str = strip_tags($str);
if (mb_strlen($str) > 100) {
$str = mb_substr($str, 0, 100) . '...';
}
return $str;
} else {
return NULL;
}
break;
default:
return $pf->getValue();
}
}
return NULL;
}
public function getPrimaryField() {
$pf = $this->getContentType()
->getPrimaryField();
if ($pf) {
$pf->setContent($this);
return $pf;
}
return NULL;
}
// private static $fieldMap = array();
public function __get($name) {
$field = $this->getContentType()
->getFieldByVariable($name);
$field->setContent($this);
switch (true) {
case $field instanceof \CO\CONTENT\FIELD\IMAGE:
return $field->getValue();
case $field instanceof \CO\CONTENT\FIELD\IMAGES:
return $field->getValue();
case $field instanceof \CO\CONTENT\FIELD\FILE:
return $field->getValue();
/home/balatona/public_html/sites/admin/modules/content/class/content/content.php
public function getFieldValue(\CO\CONTENT\FIELD $field) {
$fieldname = $field->getFieldName();
return $this->row->{$fieldname};
}
public function setFieldValue(\CO\CONTENT\FIELD $field, $value = NULL) {
$this->row->{$field->getFieldName()} = $value;
}
public function getAdminPreview() {
$template = $this->getContentType()
->getAdminPreviewTemplate();
$tc = \CO\SYSTEM\TEMPLATE_COMPILER::getInstance();
$tc->assign('content', $this);
return $tc->renderText($template);
}
public function getPrimaryFieldHTML($withID = false) {
$pf = $this->getPrimaryField();
if ($pf) {
switch (true) {
case $pf instanceof \CO\CONTENT\FIELD\IMAGE:
if ($pf->getValue()) {
return '<img src="' . $pf->getValue()
->setSize('150x100')
->getURL() . '">';
} else {
return NULL;
}
break;
case $pf instanceof \CO\CONTENT\FIELD\YOUTUBE_VIDEO:
if ($pf->getValue()) {
$ret = '[nincs cím]';
if ($withID) {
$ret = '#' . $this->getId() . ' ' . $ret;
}
return $ret;
} else {
return NULL;
/home/balatona/public_html/sites/admin/modules/content/class/link-group/type-contents.php
if ($this->insertEnabled) {
$link = new \CO\MENU\LINK\INSERT();
$link->setInsertClass(\CO\SITES\ADMIN\CONTENT::class);
$link->setName('Új ' . $type->getName() . ' létrehozása');
$link->setParameter('type', (int)$type->getId(), $this->addToCatalog);
$link->setClass($this->class);
// $link->setModule($this->module);
$link->setFunction($this->function);
$this->links[] = $link;
}
// var_dump($type);
// var_dump($type->getContents());die;
$builder = new \CO\CONTENT\COLLECTION\BUILDER();
$builder->setLanguageStrict(false);
foreach ($type->getContents($builder) as $content) {
$link = new \CO\MENU\LINK();
$link->setClass($this->class);
$link->setFunction($this->function);
$link->setEditLink(\CO\SYSTEM\URL::co('/content/content/edit?id=' . $content->getEncryptedId()));
$link->setName('#' . $content->getId() . ' - ' . $content->getPrimaryFieldHTML());
$link->setParameter((int)$content->getId());
$this->links[] = $link;
if ($content->getCatalog() and $content->getCatalog()->isCloningEnabled()) {
$link = new \CO\MENU\LINK\CLONE_ITEM();
$link->setCloneClass(\CO\SITES\ADMIN\CONTENT::class);
$link->setName(' └ '.$content->getPrimaryFieldHTML().' másolata');
$link->setParameter('source', (int)$content->getId());
$link->setClass($this->class);
$link->setFunction($this->function);
$this->links[] = $link;
}
}
return $this->links;
}
public function getName() {
$ct = \CO\CONTENT\TYPE::get($this->typeID);
/home/balatona/public_html/sites/admin/modules/menu/class/link-base.php
}
// public function json() {
// $r = new \stdClass();
// $r->site = $this->getSite();
// $r->module = $this->getModule();
// $r->function = $this->getFunction();
// $r->parameters = $this->getParameters();
// $r->type = $this->type;
// return json_encode($r);
// }
private static $glc = NULL;
public static function fromJSON($json) {
// var_dump($json);
if (self::$glc == NULL) {
self::$glc = \CO\SITES\ADMIN\MENU::getLGC();
}
foreach (self::$glc as $lg) {
foreach ($lg->getLinks() as $l) {
// var_dump($l);
// var_dump($l->json());
if ($l->json() == $json) {
return $l;
}
}
}
return NULL;
//
//
// return $ret;
}
public function setParameter() {
$this->parameters = func_get_args();
}
public function getParameters() {
return $this->parameters;
}
/home/balatona/public_html/sites/admin/modules/menu/class/menu-item-type.php
<?php
namespace CO\MENU\ITEM\TYPE;
class LINK extends \CO\MENU\ITEM {
use \CO\SITES\ADMIN\LANGUAGE_NAVIGATOR;
public function setLink(\CO\MENU\LINK $link) {
$this->row->link = $link->json();
}
public function getLink() {
return \CO\MENU\LINK::fromJSON($this->row->link);
}
}
class REFERENCE extends \CO\MENU\ITEM {
use \CO\SITES\ADMIN\LANGUAGE_NAVIGATOR;
/**
* @return \CO\MENU\ITEM|LINK|REFERENCE|URL|null
*/
public function getReference() {
// var_dump($this->row->reference);
return \CO\MENU\ITEM::get($this->row->reference, $this->getLanguage());
}
public function setReference(\CO\MENU\ITEM $item = NULL) {
if ($item == NULL) {
$this->row->reference = NULL;
} else {
$this->row->reference = $item->getId();
}
}
}
class URL extends \CO\MENU\ITEM {
use \CO\SITES\ADMIN\LANGUAGE_NAVIGATOR;
/home/balatona/public_html/sites/admin/modules/menu/class/menu.php
break;
case $item instanceof \CO\MENU\ITEM\TYPE\LINK:
\CO\SYSTEM\HTTP\HEADER::sendByCode(\CO\SYSTEM\HTTP\CODE\CODE200::createInstance());
$url = \CO\SYSTEM\URL::getCurrent('*');
$modifierClass = \CO\SITES\ADMIN\MENU\CONFIG::get()
->getURLModifier()
;
if ($modifierClass) {
$modifier = new $modifierClass();
$url = $modifier->CoAdminMenu_UrlModifier_Modify($item, $url);
}
$itemURL = $original ? $original->getURL() : $item->getURL();
$additional = substr($url, strlen($itemURL) + 1);
$additional = explode('/', $additional);
self::$urlHandled = true;
// var_dump($item);
// var_dump($item->getLink());die;
$link = $item->getLink();
// var_dump($item->getLink());die;
if ($item->getLink() == NULL) {
return false;
}
$lparameters = $link->getParameters() ? $link->getParameters() : array();
if (count($additional) and $additional[0] != '') {
$lparameters = array_merge($lparameters, $additional);
}
$tmp = $link->getClass();
$tmp = new $tmp;
return \CO\SYSTEM\CONTROLLER::getInstance()
->executeSiteModuleFunction($tmp->getSite(), $tmp->getModule(), $link->getFunction(), $lparameters)
;
}
return false;
}
public function getAllItemIDs(\CO\MENU\ITEM $item = NULL, $ids = array()) {
if ($item) {
$items = $item->getItems();
/home/balatona/public_html/sites/admin/modules/menu/class/menu.php
* @return SYSTEM\DOMAIN|null
*/
public function getDomain() {
if ($this->row->co_domain_id) {
return \CO\SYSTEM\DOMAIN::get($this->row->co_domain_id);
}
return NULL;
}
private static $urlHandled = false;
public static function handleURL() {
if (self::$urlHandled) {
return false;
}
$item = \CO\MENU\ITEM::getCurrent();
if ($item == NULL) {
return false;
}
return self::handleItem($item);
}
public static function getItemIDSsOnCurrentDomain() {
$menus = MENU::getCollection();
$ids = array();
foreach($menus as $menu) {
$ids = array_merge($ids, $menu->getAllItemIDs());
}
return $ids;
}
public static function handleItem(\CO\MENU\ITEM $item, \CO\MENU\ITEM $original = NULL) {
switch (true) {
case $item instanceof \CO\MENU\ITEM\TYPE\REFERENCE:
\CO\SYSTEM\HTTP\HEADER::sendByCode(\CO\SYSTEM\HTTP\CODE\CODE200::createInstance());
self::$urlHandled = true;
return self::handleItem($item->getReference(), $original ? $original : $item);
case $item instanceof \CO\MENU\ITEM\TYPE\URL:
\CO\SYSTEM\HTTP\HEADER::sendByCode(\CO\SYSTEM\HTTP\CODE\CODE200::createInstance());
self::$urlHandled = true;
/home/balatona/public_html/sites/site/modules/index/index.php
$page->addClass('index');
$page->show();
}
public function asideMenuPage() {
$this->assign('mi', \CO\MENU\ITEM::getCurrent());
$page = new \CO\SITES\SITE\LAYOUT\REGULAR();
$page->setContent($this->render('aside-menu-page.html'));
$page->setScrollToBlock('content');
$page->addClass('aside-menu-page');
$page->show();
}
public function after() {
// TODO: Implement after() method.
}
public function error(\CO\SYSTEM\HTTP\CODE $error) {
if ($error->getCodeNumber() == 404) {
if (\CO\MENU::handleURL()) {
exit;
}
$item = \CO\MENU\ITEM::getCurrent();
if ($item) {
$this->asideMenuPage();
exit;
}
}
}
private function convertImages($content) {
// $content = preg_replace_callback('|<noscript>\s*(<img[^/>]*)\s*<\/noscript>\s*<img[^>]+>|Uis', function ($matches) {
$content = preg_replace_callback('/<noscript>\s*(<img.+(\/>|>))\s*<\/noscript>\s*<img.+(\/>|>)/Uis', function ($matches) {
// var_dump($matches);
// $content = preg_replace_callback('/<noscript>\s*<img[^\/>]*(\/>|>)/Uis', function ($matches) {
return $matches[1];
// print $matches[1];
// $cimage = $this->downloadImage($matches[1]);
// if ($cimage) {
// return '<img src="' . $cimage->getURL() . '"/>';
/home/balatona/public_html/controller/class/controller/controller.php
if (CONTROLLER::getInstance()
->getConfig()
->getDomainConfig() == NULL) {
throw new \Exception("A default domain nincs konfigurálva", \CO\CONSTANT\HTTP::CODE_500);
}
if (CONTROLLER::getInstance()
->getConfig()
->getDomainConfig()
->hasSiteModuleConfig(REQUEST_HANDLER::getSite(), REQUEST_HANDLER::getModule()) == false and file_exists('sites/' . REQUEST_HANDLER::getSite() . '/modules/' . REQUEST_HANDLER::getModule() . '/config.php') == true) {
// die;
// ERROR::throwError(\CO\SYSTEM\HTTP\CODE\CODE500::createInstance()->setMessage(REQUEST_HANDLER::getSite() . ' / ' . REQUEST_HANDLER::getModule() . " modul nincs konfigurálva, vagy url loginnál nincs csoporthoz adva a felhasználó" ));
// print '<span style="color: red;">' . REQUEST_HANDLER::getSite() . ' / ' . REQUEST_HANDLER::getModule() . " modul nincs konfigurálva</span>";
// die;
throw new \Exception(REQUEST_HANDLER::getSite() . ' / ' . REQUEST_HANDLER::getModule() . " modul nincs konfigurálva", \CO\CONSTANT\HTTP::CODE_500);
}
$this->executeSiteModuleFunction(REQUEST_HANDLER::getSite(), REQUEST_HANDLER::getModule(), REQUEST_HANDLER::getFunction(), REQUEST_HANDLER::getParams());
} else {
$this->callBefores();
ERROR::throwError(new \CO\SYSTEM\HTTP\CODE\CODE404());
$this->callAfters();
}
exit;
}
public function executeSiteModuleFunction($site, $module, $function, $params = NULL) {
$modulename = '\CO\SITES\\' . strtoupper($site) . '\\' . strtoupper($module);
$indexname = '\CO\SITES\\' . strtoupper($site) . '\\INDEX';
$moduleInstance = new $modulename();
if ($modulename == $indexname) {
$indexInstance = $moduleInstance;
} else {
if (class_exists($indexname)) {
$indexInstance = new $indexname();
} else {
$indexInstance = NULL;
}
}
ob_start();
self::$logEntry = $this->logExecuteSiteModuleFunction($site, $module, $function, $params);
/home/balatona/public_html/index.php
<?php
if (php_sapi_name() === 'cli') {
define('ARGV1', isset($argv[1]) ? $argv[1] : '');
}
define('TIMEZONE', 'Europe/Budapest');
require_once(__DIR__ .'/functions.php');
require_once(__DIR__ .'/controller/class/controller/controller.php');
$controller = new CO\SYSTEM\CONTROLLER();
//$controller->useMemcached('127.0.0.1', 11211);
$controller->init();
$controller->execute();
//ctodo angol / német