/** * Gets a resource out of the Wax runtime. * * @param mixed $block Either a WaxBlock or the name of the block that the resource should be retrieved from. * @param string $resource_type One of the WaxBlock resource types (js/lib/views/css/etc...) * @param string $resource_name The name of the resource to retrieve * @return string */ function _resource($block, $resource_type, $resource_name) { if (!$block instanceof WaxBlock) { $block = BlockManager::GetBlock($block); } $resource = $block->GetResource($resource_type, $resource_name); return $resource; }
static function modify(rDynamicModelHandler $self) { $ddm = DSM::Get(); $view = array(); $dmodel = $ddm->ExamineType($self->GetType(), true); foreach ($dmodel as $name => $details) { if (is_array($details['options'])) { $dmodel[$name]['options'] = $details['options']; } } $view['model'] = $dmodel; // scan attributes dirs $attr_types = array(); $attr_block = BlockManager::GetBlock("attributes"); foreach (scandir($attr_block->GetBaseDir() . "/views/") as $attr_type) { if ($attr_type[0] == '.' || $attr_type[0] == '_') { continue; } $attr_types[] = $attr_type; } $view['attr_types'] = $attr_types; return $view; }
static function GetBlock($block) { return BlockManager::GetBlock($block); }