next()){ if(!self::is_loaded($row,$substate,$state_name,$row['parent_id'])){ continue;} if( ($row['login'] == 1 && !\SYSTEM\SECURITY\security::isLoggedIn()) || ($row['login'] == 2 && \SYSTEM\SECURITY\security::isLoggedIn())){ continue;} $row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars); $row['url'] = \SYSTEM\PAGE\replace::clean($row['url']); //clean url of empty variables //$row['url'] = preg_replace('/&.*?=(&|$)/', '&', $row['url']); $row['url'] = preg_replace('/[^=&]+=(&|$)/', '&', $row['url']); $row['url'] = preg_replace('/&&$/', '', $row['url']); $row['css'] = $row['js'] = array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){ $row['css'] = array_merge($row['css'], \call_user_func($row['php_class'].'::css'));} $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'scss') && \is_callable($row['php_class'].'::scss')){ $scss = \call_user_func($row['php_class'].'::scss'); foreach($scss as $s){ $row['css'][] = \SYSTEM\CACHE\cache_scss::url($s);} } if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){ $row['js'] = array_merge($row['js'], \call_user_func($row['php_class'].'::js'));} $row['js'] = count($row['js']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'title') && \is_callable($row['php_class'].'::title')){ $row['title'] = \call_user_func($row['php_class'].'::title');} if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'meta') && \is_callable($row['php_class'].'::meta')){ $row['meta'] = \call_user_func($row['php_class'].'::meta');} unset($row['php_class']); $skip = false; for($i=0;$iparse($substate);} /** * Is the substate loaded alrdy(for result set) * (recursive) * * @param array $row Substate Database row. * @param array $substate Array with substates * @param string $state_name Name of the main state * @param int $parent_id Id of parent * @return bool Returns true or false. */ private static function is_loaded($row,&$substate,$state_name,$parent_id = -1){ for($i=0;$i