本文整理汇总了PHP中owa_coreAPI::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::singleton方法的具体用法?PHP owa_coreAPI::singleton怎么用?PHP owa_coreAPI::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::singleton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
function action()
{
// Load the core API
$api =& owa_coreAPI::singleton($this->params);
if ($this->params['site_id']) {
//get site labels
$s = owa_coreAPI::entityFactory('base.site');
$s->getByColumn('site_id', $this->getParam('site_id'));
$this->set('site_name', $s->get('name'));
$this->set('site_description', $s->get('description'));
} else {
$this->set('site_name', 'All Sites');
$this->set('site_description', 'All Sites Tracked by OWA');
}
//setup Metrics
$m = owa_coreApi::metricFactory('base.latestVisits');
$m->setConstraint('site_id', $this->getParam('site_id'));
$m->setPeriod($this->getPeriod());
$m->setOrder(OWA_SQL_DESCENDING);
$m->setLimit(15);
$results = $m->generate();
$this->set('latest_visits', $results);
$this->setView('base.kmlVisitsGeolocation');
return;
}
示例2: render
function render($data)
{
//page title
$this->t->set('page_title', 'OWA Options');
// load body template
$this->body->set_template('options.tpl');
// fetch admin links from all modules
// need api call here.
$this->body->set('headline', 'OWA Settings');
// get admin panels
$api = owa_coreAPI::singleton();
$panels = $api->getAdminPanels();
//print_r($panels);
$this->body->set('panels', $panels);
// Assign config data
$this->body->set('config', $this->config);
$this->setJs('jquery', 'base/js/includes/jquery/jquery-1.6.4.min.js', '1.6.4');
$this->setJs("sprintf", "base/js/includes/jquery/jquery.sprintf.js", '', array('jquery'));
// needed anymore?
$this->setJs("jquery-ui", "base/js/includes/jquery/jquery-ui-1.8.12.custom.min.js", '1.8.12', array('jquery'));
$this->setJs("owa", "base/js/owa.js");
$this->setCss('base/css/owa.admin.css');
}
示例3: action
function action()
{
// Load the core API
$api =& owa_coreAPI::singleton($this->params);
$data = array();
$data['params'] = $this->params;
if ($this->params['site_id']) {
//get site labels
$s = owa_coreAPI::entityFactory('base.site');
$s->getByColumn('site_id', $this->params['site_id']);
$data['site_name'] = $s->get('name');
$data['site_description'] = $s->get('description');
$data['site_domain'] = $s->get('domain');
} else {
$data['site_name'] = 'All Sites';
$data['site_description'] = 'Visits for all sitess tracked by OWA.';
$data['site_domain'] = 'owa';
}
$data['view'] = 'base.kmlVisitsGeolocationNetworkLink';
$data['user_name'] = $this->params['u'];
$data['passkey'] = $this->params['pk'];
return $data;
}