本文整理汇总了PHP中createObject函数的典型用法代码示例。如果您正苦于以下问题:PHP createObject函数的具体用法?PHP createObject怎么用?PHP createObject使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::property';
$this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$this->account = $GLOBALS['phpgw_info']['user']['account_id'];
$this->bo = CreateObject('property.boadmin', true);
$this->bopreferences = createObject('preferences.boadmin_acl', true);
$this->bocommon = CreateObject('property.bocommon');
$this->acl =& $GLOBALS['phpgw']->acl;
$this->acl_location = '.admin';
$this->acl_read = $this->acl->check($this->acl_location, PHPGW_ACL_READ, 'property');
$this->acl_add = $this->acl->check($this->acl_location, PHPGW_ACL_ADD, 'property');
$this->acl_edit = $this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'property');
$this->acl_delete = $this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'property');
$this->acl_manage = $this->acl->check($this->acl_location, 16, 'property');
// $this->acl_app = $this->bo->acl_app;
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
$this->order = $this->bo->order;
$this->filter = $this->bo->filter;
$this->cat_id = $this->bo->cat_id;
$this->location = $this->bo->location;
$this->granting_group = $this->bo->granting_group;
$this->allrows = $this->bo->allrows;
}
示例2: 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');
}
示例3: __construct
public function __construct($session = False)
{
$this->currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so = createObject('phpgwapi.custom_fields');
if ($session) {
$this->read_sessiondata();
$this->use_session = True;
}
$start = phpgw::get_var('start', 'int');
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter');
$location = phpgw::get_var('location');
$allrows = phpgw::get_var('allrows', 'bool');
$appname = phpgw::get_var('appname');
if ($start) {
$this->start = $start;
} else {
$this->start = 0;
}
$this->query = $query;
$this->filter = $filter;
$this->sort = $sort;
$this->order = $order;
$this->location = $location;
$this->appname = $appname;
$this->allrows = $allrows;
}
示例4: __construct
public function __construct()
{
if (stristr(PHP_OS, 'WIN')) {
$sep = ';';
// Win
} else {
$sep = ':';
// Other
}
$java_classpath = "{$sep}.{$sep}";
foreach (glob(JASPER_LIBS . "*.jar") as $filename) {
$java_classpath .= $filename . $sep;
}
$this->java_classpath = $java_classpath;
$_key = $GLOBALS['phpgw_info']['server']['setup_mcrypt_key'];
$_iv = $GLOBALS['phpgw_info']['server']['mcrypt_iv'];
$crypto = createObject('phpgwapi.crypto', array($_key, $_iv));
$db_host = $crypto->decrypt($GLOBALS['phpgw_info']['server']['db_host']);
$db_name = $crypto->decrypt($GLOBALS['phpgw_info']['server']['db_name']);
$this->db_user = $crypto->decrypt($GLOBALS['phpgw_info']['server']['db_user']);
$this->db_pass = $crypto->decrypt($GLOBALS['phpgw_info']['server']['db_pass']);
$this->connection_string = "";
if ($GLOBALS['phpgw_info']['server']['db_type'] == "postgres") {
$this->connection_string = "jdbc:postgresql://" . $db_host . ":5432/" . $db_name;
} elseif ($GLOBALS['phpgw_info']['server']['db_type'] == "mysql") {
$this->connection_string = "jdbc:postgresql://" . $db_host . ":3306/" . $db_name;
}
}
示例5: setupBimCss
private function setupBimCss()
{
if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) {
$GLOBALS['phpgw']->css = createObject('phpgwapi.css');
}
$GLOBALS['phpgw']->css->add_external_file('bim/templates/base/css/bim.css');
}
示例6: __construct
function __construct($debug = False)
{
$this->debug = $debug;
$this->title_font_size = 3;
$this->line_font_size = 2;
$this->x_font_size = 1;
$this->title = 'Gantt Chart';
$this->legend_title = 'Color Legend';
$this->caption_x = 'x';
$this->caption_y = 'y';
$this->num_lines_x = 30;
$this->num_lines_y = 10;
$this->split_val = 1;
$this->line_captions_x = array();
$this->line_captions_y = array();
$this->data = array();
$this->colors = array('red', 'green', 'blue', 'bright green', 'bright blue', 'dark green', 'dark blue', 'olivedrab4', 'dove', 'seagreen', 'midnightblue');
$this->color_legend = array();
$this->color_extra = 'yellow';
$this->legend_bottom = 40;
$this->graph_width = 800;
$this->graph_height = 400;
$this->margin_top = 70;
$this->margin_left = 150;
$this->margin_bottom = 40;
$this->margin_right = 20;
$this->img = createObject('phpgwapi.gdimage');
$this->temp_file = $this->img->temp_file;
}
示例7: __construct
function __construct()
{
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
require_once PHPGW_SERVER_ROOT . '/felamimail/inc/xajax.inc.php';
$xajax = new xajax($GLOBALS['phpgw']->link('/felamimail/xajax.php', false, true), 'xajax_', 'utf-8');
$xajax->waitCursorOff();
$xajax->registerFunction("doXMLHTTP");
$GLOBALS['phpgw_info']['flags']['java_script'] .= $xajax->getJavascript($GLOBALS['phpgw_info']['server']['webserver_url'] . '/felamimail/js/');
$GLOBALS['phpgw']->js->validate_file('jsapi', 'jsapi', 'felamimail');
$this->displayCharset = 'utf-8';
if (!isset($_POST['composeid']) && !isset($_GET['composeid'])) {
// create new compose session
$this->bocompose = CreateObject('felamimail.bocompose', '', $this->displayCharset);
$this->composeID = $this->bocompose->getComposeID();
} else {
// reuse existing compose session
if (isset($_POST['composeid'])) {
$this->composeID = $_POST['composeid'];
} else {
$this->composeID = $_GET['composeid'];
}
$this->bocompose = CreateObject('felamimail.bocompose', $this->composeID, $this->displayCharset);
}
$this->t = CreateObject('phpgwapi.Template', PHPGW_APP_TPL);
$this->bofelamimail = CreateObject('felamimail.bofelamimail', $this->displayCharset);
$this->mailPreferences = ExecMethod('felamimail.bopreferences.getPreferences');
$this->t->set_unknowns('remove');
$this->rowColor[0] = $GLOBALS['phpgw_info']["theme"]["bg01"];
$this->rowColor[1] = $GLOBALS['phpgw_info']["theme"]["bg02"];
if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) {
$GLOBALS['phpgw']->css = createObject('phpgwapi.css');
}
$GLOBALS['phpgw']->css->validate_file('app', 'felamimail');
}
示例8: __construct
function __construct()
{
$this->season_so = CreateObject('booking.soseason');
$this->resource_so = CreateObject('booking.soresource');
$this->customer_id = CreateObject('booking.customer_identifier');
parent::__construct('bb_completed_reservation', array('id' => array('type' => 'int'), 'reservation_type' => array('type' => 'string', 'required' => True, 'nullable' => False), 'reservation_id' => array('type' => 'int', 'required' => True, 'nullable' => False), 'season_id' => array('type' => 'int'), 'cost' => array('type' => 'decimal', 'required' => true), 'from_' => array('type' => 'timestamp', 'required' => true), 'to_' => array('type' => 'timestamp', 'required' => true), 'organization_id' => array('type' => 'int'), 'customer_type' => array('type' => 'string', 'nullable' => False), 'customer_identifier_type' => array('type' => 'string', 'required' => False), 'customer_organization_number' => array('type' => 'string', 'precision' => '9', 'sf_validator' => createObject('booking.sfValidatorNorwegianOrganizationNumber', array(), array('invalid' => '%field% is invalid'))), 'customer_ssn' => array('type' => 'string', 'sf_validator' => createObject('booking.sfValidatorNorwegianSSN')), 'exported' => array('type' => 'int'), 'description' => array('type' => 'string', 'required' => True, 'nullable' => False), 'article_description' => array('type' => 'string', 'required' => True, 'nullable' => False, 'precision' => 35), 'building_id' => array('type' => 'string', 'required' => True), 'building_name' => array('type' => 'string', 'required' => True), 'export_file_id' => array('type' => 'int'), 'invoice_file_order_id' => array('type' => 'string'), 'season_name' => array('type' => 'string', 'query' => true, 'join' => array('table' => 'bb_season', 'fkey' => 'season_id', 'key' => 'id', 'column' => 'name')), 'organization_name' => array('type' => 'string', 'query' => true, 'join' => array('table' => 'bb_organization', 'fkey' => 'organization_id', 'key' => 'id', 'column' => 'name')), 'resources' => array('type' => 'int', 'required' => True, 'manytomany' => array('table' => 'bb_completed_reservation_resource', 'key' => 'completed_reservation_id', 'column' => 'resource_id'))));
}
示例9: importDir
function importDir($parent, $path)
{
global $abspath;
$logtext = "";
$node_id = getNode($parent->getPath()."/".basename($path));
if ($node_id <= 0)
{
$node_id = createObject($parent, basename($path), "file_folder");
$logtext .= "Created ".$parent->getPathInTree()."/".basename($path)."<br/>";
if ($node_id === false)
return false;
}
$new_parent = new mObject($node_id);
$subitems = GetSubfilesAndSubfolders($path);
foreach ($subitems as $subitem)
{
if (is_dir("$path/$subitem"))
$logtext .= importDir($new_parent, "$path/$subitem");
else
{
createObject($new_parent, $subitem, "file", array("file" => "$subitem:$path/$subitem"));
$logtext .= "Created ".$new_parent->getPathInTree()."/$subitem<br/>";
}
}
return $logtext;
}
示例10: __construct
function __construct()
{
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
$GLOBALS['phpgw_info']['flags']['headonly'] = true;
$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
$this->bo = CreateObject('property.bolookup', true);
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
$this->order = $this->bo->order;
$this->filter = $this->bo->filter;
$this->cat_id = $this->bo->cat_id;
$this->part_of_town_id = $this->bo->part_of_town_id;
$this->district_id = $this->bo->district_id;
phpgwapi_yui::load_widget('tabview');
phpgwapi_yui::load_widget('dragdrop');
phpgwapi_yui::load_widget('datatable');
phpgwapi_yui::load_widget('menu');
phpgwapi_yui::load_widget('connection');
phpgwapi_yui::load_widget('loader');
phpgwapi_yui::load_widget('tabview');
phpgwapi_yui::load_widget('paginator');
phpgwapi_yui::load_widget('animation');
if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) {
$GLOBALS['phpgw']->css = createObject('phpgwapi.css');
}
// Prepare CSS Style
$GLOBALS['phpgw']->css->validate_file('datatable');
$GLOBALS['phpgw']->css->validate_file('property');
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
}
示例11: __construct
function __construct($dbms)
{
switch ($dbms) {
case 'mysql':
$this->m_oTranslator = createObject('phpgwapi.schema_proc_mysql');
break;
case 'postgres':
$this->m_oTranslator = createObject('phpgwapi.schema_proc_pgsql');
break;
case 'oracle':
$this->m_oTranslator = createObject('phpgwapi.schema_proc_oracle');
break;
case 'sapdb':
$this->m_oTranslator = createObject('phpgwapi.schema_proc_sapdb');
break;
case 'mssql':
$this->m_oTranslator = createObject('phpgwapi.schema_proc_mssql');
break;
default:
//what now?
}
$this->m_oDeltaProc = createObject('phpgwapi.schema_proc_array');
$this->m_aTables = array();
$this->m_bDeltaOnly = False;
// Default to false here in case it's just a CreateTable script
$this->dbms = $dbms;
}
示例12: __get
/**
* Handle instance variables better - this way we only load what we need
*
* @param string $var the variable name to get
*/
public function __get($var)
{
if (!isset($this->instance_vars[$var]) || !is_object($this->instance_vars[$var])) {
$this->instance_vars[$var] = createObject("phpgwapi.{$var}");
}
return $this->instance_vars[$var];
}
示例13: get_available_users
function get_available_users()
{
$users = array();
$config = createObject('phpgwapi.config', 'messenger');
$config->read();
if (isset($config->config_data['restrict_to_group']) && $config->config_data['restrict_to_group'] && !isset($GLOBALS['phpgw_info']['user']['apps']['admin'])) {
foreach ($config->config_data['restrict_to_group'] as $restrict_to_group) {
$tmp_users = $GLOBALS['phpgw']->accounts->member($restrict_to_group, true);
foreach ($tmp_users as $user) {
$users[$user['account_id']] = $user['account_name'];
}
}
if ($users) {
array_multisort($users, SORT_ASC, $users);
}
} else {
$tmp_users = $GLOBALS['phpgw']->accounts->get_list('accounts', -1, 'ASC', 'account_lastname', '', -1);
foreach ($tmp_users as $user) {
if ($user->enabled) {
$users[$user->id] = $GLOBALS['phpgw']->common->display_fullname($user->lid, $user->firstname, $user->lastname);
}
}
}
return $users;
}
示例14: get_db
public function get_db()
{
if ($this->db && is_object($this->db)) {
return $this->db;
}
$config = CreateObject('phpgwapi.config', 'rental');
$config->read();
if (!$config->config_data['external_db_host'] || !$this->ping($config->config_data['external_db_host'])) {
$message = "Database server {$config->config_data['external_db_host']} is not accessible";
phpgwapi_cache::message_set($message, 'error');
return false;
}
$db = createObject('phpgwapi.db', null, null, true);
$db->debug = !!$config->config_data['external_db_debug'];
$db->Host = $config->config_data['external_db_host'];
$db->Port = $config->config_data['external_db_port'];
$db->Type = $config->config_data['external_db_type'];
$db->Database = $config->config_data['external_db_name'];
$db->User = $config->config_data['external_db_user'];
$db->Password = $config->config_data['external_db_password'];
try {
$db->connect();
$this->connected = true;
} catch (Exception $e) {
$status = lang('unable_to_connect_to_database');
}
$this->db = $db;
return $db;
}
示例15: get_db
public function get_db()
{
if ($this->db && is_object($this->db)) {
return $this->db;
}
$config = CreateObject('phpgwapi.config', 'rental');
$config->read();
if (!$config->config_data['external_db_host'] || !$this->ping($config->config_data['external_db_host'])) {
$message = "Database server {$config->config_data['external_db_host']} is not accessible";
phpgwapi_cache::message_set($message, 'error');
return false;
}
$db = createObject('phpgwapi.db', null, null, true);
$db->debug = !!$config->config_data['external_db_debug'];
$db->Host = $config->config_data['external_db_host'];
$db->Port = $config->config_data['external_db_port'];
$db->Type = $config->config_data['external_db_type'];
$db->Database = $config->config_data['external_db_name'];
$db->User = $config->config_data['external_db_user'];
$db->Password = $config->config_data['external_db_password'];
$db->Halt_On_Error = 'no';
try {
$db->connect();
} catch (Exception $e) {
phpgwapi_cache::message_set('Could not connect to backend-server ' . $config->config_data['external_db_host'], 'error');
$GLOBALS['phpgw']->redirect_link('/home.php');
}
$this->db = $db;
return $db;
}