本文整理汇总了PHP中createobject函数的典型用法代码示例。如果您正苦于以下问题:PHP createobject函数的具体用法?PHP createobject怎么用?PHP createobject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createobject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nextmatchs
function nextmatchs($website = False)
{
if (!$website) {
$this->template = createobject('phpgwapi.Template', PHPGW_TEMPLATE_DIR);
$this->template->set_file(array('_nextmatchs' => 'nextmatchs.tpl'));
$this->template->set_block('_nextmatchs', 'nextmatchs');
$this->template->set_block('_nextmatchs', 'filter');
$this->template->set_block('_nextmatchs', 'form');
$this->template->set_block('_nextmatchs', 'icon');
$this->template->set_block('_nextmatchs', 'link');
$this->template->set_block('_nextmatchs', 'search');
$this->template->set_block('_nextmatchs', 'cats');
$this->template->set_block('_nextmatchs', 'search_filter');
$this->template->set_block('_nextmatchs', 'cats_search_filter');
}
if (isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) && (int) $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0) {
$this->maxmatches = (int) $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
} else {
$this->maxmatches = 15;
}
$this->_start = (int) get_var('start', array('GLOBAL', 'POST', 'GET'));
foreach (array('menuaction', 'filter', 'qfield', 'order', 'sort') as $name) {
$var = '_' . $name;
$this->{$var} = get_var($name, array('GLOBAL', 'POST', 'GET'));
if (!preg_match('/^[a-z0-9_. -]*$/i', $this->{$var})) {
$this->{$var} = '';
}
}
if (!is_object($GLOBALS['phpgw']->html)) {
$GLOBALS['phpgw']->html = CreateObject('phpgwapi.html');
}
}
示例2: cat_id
function cat_id($cats)
{
if (!$cats) {
return '';
}
$ids = array();
foreach (split(' *[,;] *', $cats) as $cat) {
if (isset($cat2id[$cat])) {
$ids[$cat] = $cat2id[$cat];
// cat is in cache
} else {
if (!is_object($GLOBALS['phpgw']->categories)) {
$GLOBALS['phpgw']->categories = createobject('phpgwapi.categories');
}
if (is_numeric($cat) && $GLOBALS['phpgw']->categories->id2name($cat) != '--') {
$cat2id[$cat] = $ids[$cat] = $cat;
} elseif ($id = $GLOBALS['phpgw']->categories->name2id(addslashes($cat))) {
// cat exists
$cat2id[$cat] = $ids[$cat] = $id;
} else {
// create new cat
$GLOBALS['phpgw']->categories->add(array('name' => $cat, 'descr' => $cat));
$cat2id[$cat] = $ids[$cat] = $GLOBALS['phpgw']->categories->name2id(addslashes($cat));
}
}
}
$id_str = implode(',', $ids);
if (count($ids) > 1) {
$id_str = ",{$id_str},";
}
return $id_str;
}
示例3: uimessenger
function uimessenger()
{
$this->bo = CreateObject('messenger.bomessenger');
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
$this->broadcaster = $GLOBALS['phpgw']->acl->get_specific_rights($GLOBALS['phpgw']->accounts->name2id('Broadcast'), 'phpgw_group');
$this->multicaster = $GLOBALS['phpgw']->acl->get_specific_rights($GLOBALS['phpgw']->accounts->name2id('Multicast'), 'phpgw_group');
}
示例4: list_history
public function list_history()
{
if ($GLOBALS['phpgw']->acl->check('access_log_access', 1, 'admin')) {
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$bo = createobject('admin.boaccess_history');
$nextmatches = createobject('phpgwapi.nextmatchs');
$account_id = phpgw::get_var('account_id', 'int', 'REQUEST');
$start = phpgw::get_var('start', 'int', 'GET', 0);
$sort = phpgw::get_var('sort', 'int', 'POST', 0);
$order = phpgw::get_var('order', 'int', 'POST', 0);
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('View access log');
$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin::access_log';
$GLOBALS['phpgw']->common->phpgw_header(true);
$t =& $GLOBALS['phpgw']->template;
$t->set_root(PHPGW_APP_TPL);
$t->set_file('accesslog', 'accesslog.tpl');
$t->set_block('accesslog', 'list');
$t->set_block('accesslog', 'row');
$t->set_block('accesslog', 'row_empty');
$total_records = $bo->total($account_id);
$var = array('nextmatchs_left' => $nextmatches->left('/index.php', $start, $total_records, '&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'nextmatchs_right' => $nextmatches->right('/index.php', $start, $total_records, '&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'showing' => $nextmatches->show_hits($total_records, $start), 'lang_loginid' => lang('LoginID'), 'lang_ip' => lang('IP'), 'lang_login' => lang('Login'), 'lang_logout' => lang('Logout'), 'lang_total' => lang('Total'));
if ($account_id) {
$var['link_return_to_view_account'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.view', 'account_id' => $account_id)) . '">' . lang('Return to view account') . '</a>';
$var['lang_last_x_logins'] = lang('Last %1 logins for %2', $total_records, $GLOBALS['phpgw']->common->grab_owner_name($account_id));
} else {
$var['lang_last_x_logins'] = lang('Last %1 logins', $total_records);
}
$t->set_var($var);
$records = $bo->list_history($account_id, $start, $order, $sort);
if (is_array($records)) {
foreach ($records as &$record) {
$nextmatches->template_alternate_row_class($t);
$var = array('row_loginid' => $record['loginid'], 'row_ip' => $record['ip'], 'row_li' => $record['li'], 'row_lo' => $record['account_id'] ? $record['lo'] : '<b>' . lang($record['sessionid']) . '</b>', 'row_total' => $record['lo'] ? $record['total'] : ' ');
$t->set_var($var);
$t->fp('rows_access', 'row', true);
}
}
if (!$total_records && $account_id) {
$nextmatches->template_alternate_row_class($t);
$t->set_var('row_message', lang('No login history exists for this user'));
$t->fp('rows_access', 'row_empty', true);
}
$loggedout = $bo->return_logged_out($account_id);
if ($total_records) {
$percent = round($loggedout / $total_records * 100);
} else {
$percent = '0';
}
$var = array('footer_total' => lang('Total records') . ': ' . $total_records);
if ($account_id) {
$var['lang_percent'] = lang('Percent this user has logged out') . ': ' . $percent . '%';
} else {
$var['lang_percent'] = lang('Percent of users that logged out') . ': ' . $percent . '%';
}
// create the menu on the left, if needed
$var['rows'] = createObject('admin.uimenuclass')->createHTMLCode('view_account');
$t->set_var($var);
$t->pfp('out', 'list');
}
示例5: module_guestbook
function module_guestbook()
{
$this->i18n = False;
$this->post = array('name' => array('type' => 'textfield'), 'comment' => array('type' => 'textarea'), 'save' => array('type' => 'submit', 'value' => lang('Save')));
$this->arguments = array('book' => array('type' => 'select', 'label' => lang('Choose a guestbook'), 'options' => array()));
$this->properties = array('allownew' => array('type' => 'checkbox', 'label' => lang('Are contributors allowed to define new guestbooks?')));
$this->bo = createobject('sitemgr_module_guestbook.guestbook_BO');
}
示例6: add_welkome_message
/**
* Add welkome message to new users
*
* @return void
*/
public function add_welkome_message($data)
{
$message['to'] = $data['account_lid'];
$message['subject'] = lang('Welcome');
$message['content'] = $data['message'];
$so = createobject('messenger.somessenger');
$so->send_message($message, True);
}
示例7: kill
function kill()
{
if (isset($_GET['ksession']) && $_GET['ksession'] && $GLOBALS['sessionid'] != $_GET['ksession'] && !$GLOBALS['phpgw']->acl->check('current_sessions_access', 8, 'admin')) {
$GLOBALS['phpgw']->session->destroy($_GET['ksession']);
}
$this->ui = createobject('admin.uicurrentsessions');
$this->ui->list_sessions();
}
示例8: uicurrentsessions
function uicurrentsessions()
{
if ($GLOBALS['phpgw']->acl->check('current_sessions_access', 1, 'admin')) {
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$this->template = createobject('phpgwapi.Template', PHPGW_APP_TPL);
$this->bo = createobject('admin.bocurrentsessions');
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
}
示例9: __construct
function __construct()
{
$this->template = $GLOBALS['phpgw']->template;
$this->bo = CreateObject('messenger.bomessenger');
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
if (!$this->bo->is_connected()) {
$this->_error_not_connected();
}
}
示例10: clear_reg_accounts
/**
* Clear reg_accounts either as part of a cron-job or logout hook
*
* @return void
*/
public function clear_reg_accounts()
{
$c = createobject('phpgwapi.config', 'registration');
$c->read();
if ($c->config_data['activate_account'] == 'pending_approval') {
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_reg_accounts WHERE reg_dla <= '" . (time() - 7200) . "' AND reg_info IS NULL", __LINE__, __FILE__);
} else {
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_reg_accounts WHERE reg_dla <= '" . (time() - 7200) . "'", __LINE__, __FILE__);
}
}
示例11: get_content
function get_content(&$arguments, $properties)
{
if ($arguments['expanded']) {
$expandedcats = array_keys($arguments['expanded']);
} else {
$expandedcats = array();
}
$bo = createobject('bookmarks.bo');
return $bo->export($arguments['category'], 'xbel', $expandedcats);
}
示例12: __construct
function __construct()
{
if (isset($GLOBALS['phpgw_setup']->db) && is_object($GLOBALS['phpgw_setup']->db)) {
$this->db = clone $GLOBALS['phpgw_setup']->db;
} else {
// $this->db = clone($GLOBALS['phpgw']->db);
$this->db = createobject('felamimail.egw_db');
}
// $this->db->set_app('emailadmin');
}
示例13: uiexport
function uiexport()
{
$this->bo = createobject('news_admin.boexport', True);
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->order = $this->bo->order;
$this->sort = $this->bo->sort;
$this->exporttypes = array(0 => lang('No RSS export'), 1 => 'RSS 0.91', 2 => 'RSS 1.0', 3 => 'RSS 2.0');
$this->itemsyntaxtypes = array(0 => '?item=n', 1 => '&item=n', 2 => '?news%5Bitem%5D=n', 3 => '&news%5Bitem%5D=n');
}
示例14: uiacl
function uiacl()
{
$this->bo = createobject('news_admin.boacl', True);
$this->accounts = $GLOBALS['phpgw']->accounts->get_list();
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->order = $this->bo->order;
$this->sort = $this->bo->sort;
$this->cat_id = $this->bo->cat_id;
}
示例15: uinews
function uinews()
{
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
$this->template = $GLOBALS['phpgw']->template;
$this->bo = CreateObject('news_admin.bonews', True);
$this->sbox = createObject('phpgwapi.sbox');
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->order = $this->bo->order;
$this->sort = $this->bo->sort;
$this->cat_id = $this->bo->cat_id;
}