protected function LoadDriver($Driver) { if (!isset($this->CacheCache[$Driver])) { $ClassName = 'RD_Cache_' . $Driver; RD::RequireClass($ClassName); $this->CacheCache[$Driver] = RDC::CreateObject($ClassName, array($this->main)); $this->CacheCache[$Driver]->Setup(); } return; }
public function Store() { $count = func_num_args(); $args = func_get_args(); if (!isset($this->StoreCache[$this->DefaultStoreDriver])) { $ClassName = 'RD_Store_' . $this->DefaultStoreDriver; RD::RequireClass($ClassName); $this->StoreCache[$this->DefaultStoreDriver] = new $ClassName($this->main); $this->StoreCache[$this->DefaultStoreDriver]->Setup(); } if ($count == 1) { return $this->StoreCache[$this->DefaultStoreDriver]->Load($args[0]); } elseif ($count == 2) { return $this->StoreCache[$this->DefaultStoreDriver]->Save($args[0], &$args[1]); } else { throw new RDE('RDM_Store: cant do anything'); } }
<?php RD::RequireClass('RD_RapiDev_Module_Form'); class RDM_Form extends RD_RapiDev_Module_Form { }
public function Setup() { $this->LoadDataobject2(); $options =& PEAR::getStaticProperty('DB_DataObject2', 'options'); if (!is_array($options)) { $options = array(); } $locations = array(); foreach ($this->getRoots() as $ROOT) { if (is_dir($ROOT . DIR_SEP . 'daos')) { $locations[] = $ROOT . DIR_SEP . 'daos'; } } if (empty($locations)) { RDD::Log('DAO needs a location to work'); return; } $options['db_driver'] = $this->Driver; $options['schema_location'] = $locations; $options['class_location'] = $locations; // TODO // $options['require_prefix'] = $options['class_prefix'] = $this->Prefix; $options['extends'] = $this->Extends; $options['extends_location'] = ''; $options['debug'] = 0; $options['generator_class_rewrite'] = true; $options['quote_identifiers'] = 1; $options['proxy'] = false; RD::RequireClass($this->Extends); return; }
<?php RD::RequireClass('RD_RapiDev_View'); class RD_View extends RD_RapiDev_View { }
<?php RD::RequireClass('RD_RapiDev_Module_View'); class RDM_View extends RD_RapiDev_Module_View { }
<?php RD::RequireClass('RD_RapiDev_Module_Compression'); class RDM_Compression extends RD_RapiDev_Module_Compression { }
<?php RD::RequireClass('RD_RapiDev_Data'); class RD_Data extends RD_RapiDev_Data { }
<?php RD::RequireClass('RD_RapiDev_Module_User'); class RDM_User extends RD_RapiDev_Module_User { }
public function ViewGenerate() { RDD::Log('Generate new View', TRACE, 1200); $this->LoadSmarty(); RD::RequireClass('RD_View'); $RD_View = new RD_View($this->main); return $RD_View; }
<?php RD::RequireClass('RD_RapiDev_Module_Element'); class RDM_Element extends RD_RapiDev_Module_Element { }
<?php RD::RequireClass('RD_RapiDev_Module_Cache'); class RDM_Cache extends RD_RapiDev_Module_Cache { }
<?php RD::RequireClass('RD_RapiDev_Module_Page'); class RDM_Page extends RD_RapiDev_Module_Page { }
<?php RD::RequireClass('RD_RapiDev_Module_Area'); class RDM_Area extends RD_RapiDev_Module_Area { }
<?php RD::RequireClass('RD_DAO'); class RD_DAO_History extends RD_DAO { public function insert($update = false, $dataObject = false, $delayed = false) { $Return = parent::insert($update, $dataObject, $delayed); $this->MakeHistoryEntry('insert'); return $Return; } public function update($dataObject = false, $return = false) { $Return = parent::update($dataObject, $return); $this->MakeHistoryEntry('update'); return $Return; } public function delete($useWhere = false) { $Array = $this->toArray(); $Return = parent::delete($useWhere); $this->MakeHistoryEntry('delete', $Array, true); return $Return; } public function MakeHistoryEntry($Command, $Array = false, $delete = false) { if (isset(DB_DataObject2::$INI[$this->_database][$this->__table . '_History'])) { $History = RD::$Self->DB($this->_database, $this->__table . '_History'); if (!$Array) { $Array = $this->toArray(); }
<?php RD::RequireClass('RD_RapiDev_Page_CRUD'); abstract class RD_Page_CRUD extends RD_RapiDev_Page_CRUD { }
<?php RD::RequireClass('RD_RapiDev_Module_Store'); class RDM_Store extends RD_RapiDev_Module_Store { }
<?php RD::RequireClass('RD_Util_Paging'); function smarty_function_pager($params, &$smarty) { if (!isset($params['PageSize'])) { $params['PageSize'] = 1; } if (!isset($params['CurrentPage'])) { $params['CurrentPage'] = 1; } if (!isset($params['PageVar'])) { $params['PageVar'] = 'paging_page'; } if (!isset($params['URL'])) { $params['URL'] = $_SERVER['PHP_SELF'] . '?' . $params['PageVar'] . '=%d'; } if (!isset($params['Max'])) { $params['Count'] = 1; } else { $params['Count'] = $params['Max']; } if (isset($params['Template'])) { $Template = $params['Template']; unset($params['Template']); } $Paging = new RD_Util_Paging(); $Paging->SetFrom($params); $OldTplVars = $smarty->_tpl_vars; $smarty->assign($params); $smarty->assign($Paging->GetPaging());
<?php RD::RequireClass('RD_RapiDev_Module_Validate'); class RDM_Validate extends RD_RapiDev_Module_Validate { }
<?php RD::RequireClass('RD_RapiDev_Module_Title'); class RDM_Title extends RD_RapiDev_Module_Title { }
public function Setup() { RD::RequireClass('RD_Element'); return; }
<?php RD::RequireClass('RD_RapiDev_Module_DAO'); class RDM_DAO extends RD_RapiDev_Module_DAO { }
/** * Creates needed object and loads all needed methods for the object **/ public function CallPage() { if ($this->PagesAllowed === false) { return; } if (!$this->GoToCheck()) { return; } if ($this->PagesAllowed !== true && is_array($this->PagesAllowed)) { $Access = false; foreach ($this->PagesAllowed as $PageAllowed) { $Length = strlen($PageAllowed); if (substr($this->Page, 0, $Length) == $PageAllowed) { $Access = true; break; } } if (!$Access) { throw new Exception('RDM_Page: not allowed to access the Page: "' . $this->Page . '"'); } } $this->Hook('PageStart'); $RunCache = array(); foreach ($this->Pages as $Key => $PagePart) { $FileName = self::$Directory; $ClassName = self::$ClassPrefix; for ($i = 0; $i <= $Key; $i++) { $FileName .= DIR_SEP . $this->Pages[$i]; $ClassName .= '_' . ucfirst($this->Pages[$i]); } if (!isset($this->PageCache[$ClassName])) { try { RD::RequireClass($ClassName); } catch (Exception $e) { $FileName .= '.php'; if ($File = $this->File($FileName)) { require_once $File; } } if (class_exists($ClassName)) { RDD::Log('Page class ' . $ClassName . ' loaded into RunCache', TRACE, 1221); $this->PageCache[$ClassName] = new $ClassName($this->main); } else { RDD::Log('Page class ' . $ClassName . ' or file ' . $FileName . ' not exist', WARN); continue; } } $RunCache[$ClassName] = $this->PageCache[$ClassName]; } if (!empty($RunCache)) { $MethodStack = array(self::$PageStart); $PageDepth = count($this->Pages); $TempPageStack = array(); for ($i = 0; $i < $PageDepth - 1; $i++) { $TempPageStack[] = $this->Pages[$i]; $MethodStack[] = implode(self::$FunctionSeparator, $TempPageStack) . self::$FunctionSeparator . self::$PageStart; } $MethodStack[] = implode(self::$FunctionSeparator, $this->Pages); while (!empty($TempPageStack)) { $MethodStack[] = implode(self::$FunctionSeparator, $TempPageStack) . self::$FunctionSeparator . self::$PageEnd; array_pop($TempPageStack); } $MethodStack[] = self::$PageEnd; foreach ($MethodStack as $Method) { foreach ($RunCache as $PageClass) { $PageMethod = self::$FunctionPrefix . $Method; RDD::Log('Trying PageMethod: "' . $PageMethod . '" on "' . get_class($PageClass) . '"', TRACE, 1211); if ($PageClass->MethodExists($PageMethod)) { $PageClass->{$PageMethod}(); if (!$this->GoToCheck()) { return; } } } } } }
<?php RD::RequireClass('RD_RapiDev_Module_Pear'); class RDM_Pear extends RD_RapiDev_Module_Pear { }