public function query($query) { if (!($result = $this->db[0]->query(clm_core::$load->db_add_prefix($query, $this->db[1])))) { clm_core::addError("sql invalid", $query . " (" . $this->db[0]->error . ")" . " Backtrace: " . clm_core::getBacktrace()); } else { return $result; } }
private function autoInclude($api) { if (!function_exists("clm_api_" . $api)) { $path = clm_core::$path . DS . "api" . DS . $api . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addError("api missing", $path . " (" . $api . ")" . " Backtrace: " . clm_core::getBacktrace()); } } }
function clm_function_load_view($view, $args, $div = true) { clm_core::$load->load_css("reset"); if (!function_exists("clm_view_" . $view)) { $path = clm_core::$path . DS . "views" . DS . $view . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addError("view missing", $path . " (" . $view . ")" . " Backtrace: " . clm_core::getBacktrace()); } } ob_start(); $out[0] = call_user_func_array("clm_view_" . $view, $args); if ($div) { $out[1] = '<div class="clm_view_' . $view . '">' . ob_get_contents() . "</div>"; } else { $out[1] = ob_get_contents(); } ob_end_clean(); return $out; }
public static function autoload($class) { if (!class_exists($class) && substr($class, 0, 10) == "clm_class_") { $path = clm_core::$path . DS . "classes" . DS . substr($class, 10) . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addError("class missing", $path . " (" . $class . ")" . " Backtrace: " . self::getBacktrace()); } } }