本文整理汇总了PHP中is_Object函数的典型用法代码示例。如果您正苦于以下问题:PHP is_Object函数的具体用法?PHP is_Object怎么用?PHP is_Object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_Object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: hSet
public static function hSet($key, $field, $value)
{
if (is_array($value) || is_Object($value)) {
$value = json_encode($value);
}
return self::connection()->hset($key, $field, $value);
}
开发者ID:huycao,项目名称:yoplatform,代码行数:7,代码来源:RedisHelper.php
示例2: hSet
public function hSet($key, $field, $value)
{
if (is_array($value) || is_Object($value)) {
$value = json_encode($value);
}
return $this->connection->hset($key, $field, $value);
}
开发者ID:huycao,项目名称:yodelivery,代码行数:7,代码来源:RedisBaseModel.php
示例3: print_ro
function print_ro($object, $alsoIgnore = array(), $tab = 0)
{
// prints an object/array, but removes the $parent, and anything inside alsoIgnore
$pad = "";
if (!in_array('parent', $alsoIgnore)) {
$alsoIgnore[] = "parent";
}
for ($c = 0; $c < $tab; $c++) {
$pad .= "\t";
}
foreach ($object as $key => $value) {
if (!is_numeric($key) && in_array($key, $alsoIgnore)) {
echo $pad . $key . " => *HIDDEN*\n";
} else {
if (is_Array($value) || is_Object($value)) {
if (is_Array($value)) {
echo "{$pad}{$key} => Array (\n";
} else {
echo "{$pad}{$key} => Object (\n";
}
print_ro($value, $alsoIgnore, $tab + 1);
echo $pad . ")\n";
} else {
echo $pad . $key . " => " . $value . "\n";
}
}
}
}
开发者ID:Prescia,项目名称:Prescia,代码行数:28,代码来源:basic.php
示例4: getUserId
public function getUserId($username = '')
{
if ($username == '') {
$userRecord = UserRecord::finder()->find('user_username = ?', $this->Name);
} else {
$userRecord = UserRecord::finder()->find('user_username = ?', $username);
}
if (is_Object($userRecord)) {
return $userRecord->idtm_user;
} else {
return 0;
}
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:13,代码来源:GSProcUser.php
示例5: debugObject
function debugObject($obj, $indent = 0)
{
if (is_Array($obj) || is_Object($obj)) {
$return = '';
while (list($k, $v) = each($obj)) {
for ($i = 0; $i < $indent; $i++) {
$return .= ' ';
}
$return .= $k . "->{$v}\n";
$return .= $this->debugObject($v, $indent + 1);
}
return $return;
}
}
开发者ID:BGCX067,项目名称:faireconnaitre-svn-to-git,代码行数:14,代码来源:whois.utils.php
示例6: register
public static function register($ClassName)
{
$Obj = self::singleton();
$ClassName = strtolower($ClassName);
if ($Obj->getObject($ClassName) != NULL) {
return $Obj->getObject($ClassName);
}
$Class = $ClassName;
$Obj->setObject($ClassName, new $Class());
$Object = $Obj->getObject($ClassName);
if (is_Object($Object)) {
return $Object;
}
}
开发者ID:anugrahbsoe,项目名称:Becak-HMVC-Framework,代码行数:14,代码来源:common.php
示例7: onInit
/**
* Populates the datagrid with user lists.
* This method is invoked by the framework when initializing the page
* @param mixed event parameter
*/
public function onInit($param)
{
parent::onInit($param);
if (!$this->IsPostBack) {
// get the total number of posts available
$criteria = new TActiveRecordCriteria();
$criteria->Condition = 'idtm_user = :idtm_user';
$criteria->Parameters[':idtm_user'] = $this->User->getUserId($this->User->Name);
if (is_Object(ParteiRecord::finder()->find($criteria))) {
$this->Repeater->VirtualItemCount = ParteiRecord::finder()->find($criteria)->count();
}
// populates post data into the repeater
$this->populateData();
}
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:20,代码来源:partei.php
示例8: onKernelRequest
public function onKernelRequest(GetResponseEvent $event)
{
$route = $event->getRequest()->attributes->get('_route');
if ($route == 'livraison' || $route == 'validation') {
if ($this->session->has('panier')) {
if (count($this->session->get('panier')) == 0) {
$event->setResponse(new RedirectResponse($this->router->generate('panier')));
}
}
if (!is_Object($this->securityContext->getToken()->getUser())) {
$this->session->getFlashBag()->add('notification', 'Vous devez vous identifier');
$event->setResponse(new RedirectResponse($this->router->generate('fos_user_security_login')));
}
}
}
开发者ID:nassafou,项目名称:Ecommerce,代码行数:15,代码来源:RedirectionListener.php
示例9: setValue
public function setValue($request, $response)
{
$id = $request->id;
$vars['type'] = $request->type;
$vars['status'] = $request->status;
$vars['comment'] = $request->getRequest('comment');
$admin = UserClient::getInstance()->getCurrentUser();
$id = UserClient::getInstance()->modifyUserAdvice($id, $vars, $admin);
$userAdvice = DAL::get()->find('UserAdvice', $id);
if (is_Object($userAdvice) && $userAdvice->source == '管理员发起的认证任务' && $vars['status'] == -1) {
$predoctor = DAL::get()->find_by_userid('predoctor', $userAdvice->user->id);
$inspector = DAL::get()->find_by_userid('inspector', $admin->id);
if (false == $predoctor->isNull() && false == $inspector->isNull()) {
PreDoctorClient::getInstance()->setResultNo($predoctor->id, $inspector->id);
}
}
return self::DIRECT_OUTPUT;
}
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:18,代码来源:useradvicecontroller.php
示例10: saveStrukturBericht
public function saveStrukturBericht($sender, $param)
{
$mySession = "";
$mySession = UserFelderRecord::finder()->findAllBy_user_id($this->User->getUserId($this->User->Name));
foreach ($mySession as $myFieldRecord) {
$arr_newValues = array();
//very important!!! otherwise we have values which dont exist
$arr_MyFields = array();
$uniqueID = $myFieldRecord->tuf_feldname;
//lets start the saving
//$UniqueID = 'xxx'.$inp_per_year.'xxx'.$inp_per_month.'xxx'.$inp_idta_struktur_type.'xxx'.$inp_idta_feldfunktion.'xxx'.$inp_idtm_struktur.'xxx'.$inp_idta_variante.'xxx';
//$SaveString = $jahr."xxx".$monat."xxx".$local_ff."xxx".$local_id; definition of the string to pass
$arr_MyFields = preg_split("/xxx/", $uniqueID);
$tt_per_year = $arr_MyFields[1];
$tt_per_month = $arr_MyFields[2];
$tt_idta_struktur_type = $arr_MyFields[3];
$tt_idta_feldfunktion = $arr_MyFields[4];
$tt_idtm_struktur = $arr_MyFields[5];
$tt_idta_variante = $arr_MyFields[6];
//abrufen des aktuellen DB-Wertes
$ExistingValue = WerteRecord::finder()->findBySql("SELECT w_wert FROM tt_werte WHERE idtm_struktur = '" . $tt_idtm_struktur . "' AND idta_feldfunktion = '" . $tt_idta_feldfunktion . "' AND w_jahr = '" . $tt_per_year . "' AND w_monat = '" . $tt_per_month . "' AND w_id_variante = '" . $tt_idta_variante . "' LIMIT 1");
//formatieren, damit es mit dem inhalt aus der zelle vergleichbar wird
//CHECKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
if (is_Object($ExistingValue)) {
$CompareValue = number_format($ExistingValue->w_wert, 2, '.', '');
} else {
$CompareValue = "0.00";
}
//here I start the magic server calculation;)
if ($CompareValue === $this->page->ACTPanel->FindControl($uniqueID)->Text) {
} else {
$ObjSaver = new PFBackCalculator();
$ObjSaver->setVariante($tt_idta_variante);
$ObjSaver->setStartPeriod($tt_per_month);
$ObjSaver->setStartNode($tt_idtm_struktur);
//$SaveString = $tt_per_year."xxx".$tt_per_month."xxx".$tt_idta_feldfunktion."xxx".$tt_idtm_struktur;
//$NEWWerteRecord = WerteRecord::finder()->findBySql("SELECT * FROM tt_werte WHERE idtm_struktur = '".$tt_idtm_struktur."' AND idta_feldfunktion = '".$tt_idta_feldfunktion."' AND w_jahr = '".$tt_per_year."' AND w_monat = '".$tt_per_month."' AND w_id_variante = '".$tt_idta_variante."' LIMIT 1");
$arr_newValues[$tt_idta_feldfunktion] = $this->page->ACTPanel->FindControl($uniqueID)->Text;
$ObjSaver->setNewValues($arr_newValues);
$ObjSaver->run();
unset($ObjSaver);
}
}
$sender->Text = "Saved";
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:45,代码来源:StrukturBerichtViewer_WORKING201010.php
示例11: loadArticles
/**
* Load article list of this product and store in private class variable
*
* @return array Article uids
*/
public function loadArticles()
{
if ($this->articlesLoaded == FALSE) {
$uidToLoadFrom = $this->uid;
if ($this->getT3verOid() > 0 && $this->getT3verOid() != $this->uid && (is_Object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->beUserLogin)) {
$uidToLoadFrom = $this->getT3verOid();
}
if ($this->articles_uids = $this->databaseConnection->getArticles($uidToLoadFrom)) {
foreach ($this->articles_uids as $articleUid) {
/**
* Article
*
* @var Tx_Commerce_Domain_Model_Article $article
*/
$article = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Article', $articleUid, $this->lang_uid);
$article->loadData();
$this->articles[$articleUid] = $article;
}
$this->articlesLoaded = TRUE;
return $this->articles_uids;
} else {
return FALSE;
}
}
return $this->articles_uids;
}
开发者ID:AndreasA,项目名称:commerce,代码行数:31,代码来源:Product.php
示例12: getBacktrace
/**
* 获取当前堆栈.
*/
function getBacktrace() {
$traces = debug_backTrace ();
$str = "\n\nback trace:";
for($i = 1; $i < count ( $traces ); $i ++) {
$trace = $traces [$i];
$class = @$trace ['class'] ? @$trace ['class'] . @$trace ['type'] : '';
$str .= "\n##$i " . @$trace ['file'] . " (" . @$trace ['line'] . "), call function $class" . @$trace ['function'] . "(";
if ($i > 1) {
foreach ( @$trace ['args'] as $arg ) {
if (is_array ( $arg )) {
$str .= "Array, ";
} else if (is_Object ( $arg )) {
$str .= "Object, ";
} else if (is_bool ( $arg )) {
$str .= $arg ? 'true, ' : 'false, ';
} else {
$str .= "$arg, ";
}
}
}
$str .= ");";
}
return $str;
}
开发者ID:neil-chen,项目名称:NeilChen,代码行数:27,代码来源:FunctionsBase.php
示例13: loadArticles
/**
* Load article list of this product and store in private class variable.
*
* @return array Article uids
*/
public function loadArticles()
{
if (!is_array($this->articles)) {
$uidToLoadFrom = $this->uid;
if ($this->getT3verOid() > 0 && $this->getT3verOid() != $this->uid && (is_Object($this->getFrontendController()) && $this->getFrontendController()->beUserLogin)) {
$uidToLoadFrom = $this->getT3verOid();
}
$this->articles = array();
if ($this->articles_uids = $this->databaseConnection->getArticles($uidToLoadFrom)) {
foreach ($this->articles_uids as $articleUid) {
/**
* Article.
*
* @var \CommerceTeam\Commerce\Domain\Model\Article $article
*/
$article = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Article', $articleUid, $this->lang_uid);
$article->loadData();
$this->articles[$articleUid] = $article;
}
return $this->articles_uids;
} else {
return false;
}
}
return $this->articles_uids;
}
开发者ID:BenjaminBeck,项目名称:commerce,代码行数:31,代码来源:Product.php
示例14: convertCurrencyTo
/**
*
* @author Max Milbers
* @param unknown_type $currency
* @param unknown_type $price
* @param unknown_type $shop
*/
function convertCurrencyTo($currency, $price, $shop = true)
{
if (empty($currency)) {
// vmdebug('empty $currency ',$price);
return $price;
}
// If both currency codes match, do nothing
if (is_Object($currency) and $currency->_currency_id == $this->_vendorCurrency or !is_Object($currency) and $currency == $this->_vendorCurrency) {
// vmdebug(' $currency == $this->_vendorCurrency ',$price);
return $price;
}
/* if($shop){
// TODO optimize this... the exchangeRate cant be cached, there are more than one currency possible
// $exchangeRate = &$this->exchangeRateVendor;
$exchangeRate = 0;
} else {
//caches the exchangeRate between shopper and vendor
$exchangeRate = &$this->exchangeRateShopper;
}
*/
// if(empty($exchangeRate)){
if (is_Object($currency)) {
$exchangeRate = $currency->exchangeRateShopper;
vmdebug('convertCurrencyTo OBJECT ' . $exchangeRate);
} else {
// $this->_db = JFactory::getDBO();
$q = 'SELECT `currency_exchange_rate` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id` ="' . (int) $currency . '" ';
$this->_db->setQuery($q);
$exch = $this->_db->loadResult();
// vmdebug('begin convertCurrencyTo '.$exch);
if (!empty($exch) and $exch !== '0.00000') {
$exchangeRate = $exch;
} else {
$exchangeRate = FALSE;
}
}
// }
$this->exchangeRateShopper = $exchangeRate;
// vmdebug('convertCurrencyTo my currency ',$exchangeRate,$currency);
if (!empty($exchangeRate) && $exchangeRate != FALSE) {
//vmdebug('convertCurrencyTo Use custom rate');
if ($shop) {
$price = $price / $exchangeRate;
} else {
$price = $price * $exchangeRate;
}
// vmdebug('!empty($exchangeRate) && $exchangeRate!=FALSE '.$price.' '.$exchangeRate);
} else {
$currencyCode = self::ensureUsingCurrencyCode($currency);
$vendorCurrencyCode = self::ensureUsingCurrencyCode($this->_vendorCurrency);
$globalCurrencyConverter = JRequest::getVar('globalCurrencyConverter');
if ($shop) {
//$oldprice = $price;
$price = $this->_currencyConverter->convert($price, $currencyCode, $vendorCurrencyCode);
//vmdebug('convertCurrencyTo Use dynamic rate in shop '.$oldprice .' => '.$price);
} else {
//vmdebug('convertCurrencyTo Use dynamic rate to shopper currency '.$price);
$price = $this->_currencyConverter->convert($price, $vendorCurrencyCode, $currencyCode);
}
// vmdebug('convertCurrencyTo my currency ',$this->exchangeRateShopper);
}
return $price;
}
开发者ID:Gskflute,项目名称:joomla25,代码行数:70,代码来源:currencydisplay.php
示例15: CRM_Core_DAO_UFMatch
/**
* Synchronize the object with the UF Match entry. Can be called stand-alone from
* the drupalUsers script
*
* @param Object $user the drupal user object
* @param string $userKey the id of the user from the uf object
* @param string $uniqId the OpenID of the user
* @param string $uf the name of the user framework
* @param integer $status returns the status if user created or already exits (used for CMS sync)
*
* @return the ufmatch object that was found or created
* @access public
* @static
*/
static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = null, $ctype = null)
{
// validate that uniqId is a valid url. it will either be
// an OpenID (which should always be a valid url) or a
// http://uf_username/ construction (so that it can
// be used as an OpenID in the future)
require_once 'CRM/Utils/Rule.php';
if ($uf == 'Standalone') {
if (!CRM_Utils_Rule::url($uniqId)) {
return $status ? null : false;
}
} else {
if (!CRM_Utils_Rule::email($uniqId)) {
return $status ? null : false;
}
}
$newContact = false;
// make sure that a contact id exists for this user id
$ufmatch =& new CRM_Core_DAO_UFMatch();
if (CRM_Core_DAO::checkFieldExists('civicrm_uf_match', 'domain_id')) {
// FIXME: if() condition check was required especially for upgrade cases (2.2.x -> 3.0.x),
// where folks if happen to logout, would encounter a column not found fatal error
$ufmatch->domain_id = CRM_Core_Config::domainID();
}
$ufmatch->uf_id = $userKey;
if (!$ufmatch->find(true)) {
require_once 'CRM/Core/Transaction.php';
$transaction = new CRM_Core_Transaction();
if (!empty($_POST)) {
$params = $_POST;
$params['email'] = $uniqId;
require_once 'CRM/Dedupe/Finder.php';
$dedupeParams = CRM_Dedupe_Finder::formatParams($params, 'Individual');
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
if (!empty($ids)) {
$dao = new CRM_Core_DAO();
$dao->contact_id = $ids[0];
}
} else {
require_once 'CRM/Contact/BAO/Contact.php';
if ($uf == 'Standalone') {
$dao =& CRM_Contact_BAO_Contact::matchContactOnOpenId($uniqId, $ctype);
} else {
$dao =& CRM_Contact_BAO_Contact::matchContactOnEmail($uniqId, $ctype);
}
}
if ($dao) {
//print "Found contact with uniqId $uniqId<br/>";
$ufmatch->contact_id = $dao->contact_id;
$ufmatch->uf_name = $uniqId;
} else {
if ($uf == 'Drupal') {
$mail = 'mail';
} else {
$mail = 'email';
}
if (is_Object($user)) {
$params = array('email-Primary' => $user->{$mail});
}
if ($ctype == 'Organization') {
$params['organization_name'] = $uniqId;
} else {
if ($ctype == 'Household') {
$params['household_name'] = $uniqId;
}
}
if (!$ctype) {
$ctype = "Individual";
}
$params['contact_type'] = $ctype;
// extract first / middle / last name
// for joomla
if ($uf == 'Joomla' && $user->name) {
require_once 'CRM/Utils/String.php';
CRM_Utils_String::extractName($user->name, $params);
}
if ($uf == 'Standalone') {
$params['openid-Primary'] = $uniqId;
//need to delete below code once profile is
//exposed on signup page
if (!empty($user->first_name) || !empty($user->last_name)) {
$params['first_name'] = $user->first_name;
$params['last_name'] = $user->last_name;
} elseif (!empty($user->name)) {
require_once 'CRM/Utils/String.php';
CRM_Utils_String::extractName($user->name, $params);
//.........这里部分代码省略.........
开发者ID:bhirsch,项目名称:civicrm,代码行数:101,代码来源:UFMatch.php
示例16: view_Organisation
public function view_Organisation($idtm_organisation)
{
$myitem = OrganisationRecord::finder()->findByPK($idtm_organisation);
$tempus = 'RCed' . $this->RCprimarykey;
$monus = $this->RCprimarykey;
$this->{$tempus}->Text = $myitem->{$monus};
$this->bindListAdress();
$this->bindListKom();
$this->viewMainAdress($idtm_organisation);
//HIDDEN
foreach ($this->RChiddenfields as $recordfield) {
$edrecordfield = 'RCed' . $recordfield;
$this->{$edrecordfield}->setText($myitem->{$recordfield});
}
//DATUM
foreach ($this->RCdatfields as $recordfield) {
$edrecordfield = 'RCed' . $recordfield;
$this->{$edrecordfield}->setDate($myitem->{$recordfield});
}
//BOOL
foreach ($this->RCboolfields as $recordfield) {
$edrecordfield = 'RCed' . $recordfield;
$this->{$edrecordfield}->setChecked($myitem->{$recordfield});
}
//TIME
foreach ($this->RCtimefields as $recordfield) {
$edrecordfield = 'RCed' . $recordfield;
$my_time = explode(':', $myitem->{$recordfield});
$my_time_text = $my_time[0] . ':' . $my_time[1];
$this->{$edrecordfield}->Text = $my_time_text;
}
//NON DATUM
foreach ($this->RCfields as $recordfield) {
$edrecordfield = 'RCed' . $recordfield;
$this->{$edrecordfield}->Text = $myitem->{$recordfield};
}
$this->RCedorganisation_edit_status->Text = 1;
$ActualUser = UserRecord::finder()->findByidtm_user($this->RCedidtm_user->Text);
if (is_Object($ActualUser)) {
$this->suggest_idtm_user->Text = $ActualUser->user_username;
} else {
$this->suggest_idtm_user->Text = 0;
}
$this->loadBankkonto($this->{$tempus}->Text);
$this->loadObjekt($this->{$tempus}->Text);
$this->laborg_name->Text = $myitem->org_name;
$ParentOrga = OrganisationRecord::finder()->findByidtm_organisation($myitem->parent_idtm_organisation);
if (is_Object($ParentOrga)) {
$this->labparentorg_name->Text = $ParentOrga->org_name . ', ' . $ParentOrga->org_vorname;
}
$this->labparentorg_name->CommandParameter = $myitem->parent_idtm_organisation;
//Rechnungen
//$this->Teddeb_id->Text = $myitem->$monus;
//$this->Teddeb_tabelle->Text = 'tm_zeiterfassung';
//$this->RechnungContainer->initParameters();
$this->RechnungContainer->bindRechnungListe();
//TASKPART
$this->Tedsend_id->Text = $myitem->{$monus};
$this->Tedauf_id->Text = $myitem->{$monus};
$this->AufgabenContainerOrganisation->initParameters();
$this->AufgabenContainerOrganisation->initYearPullDown();
$this->AufgabenContainerOrganisation->bindListTAValue();
$this->setPDFSteckbrief($myitem->{$monus});
$this->bindListChildOrgListe();
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:65,代码来源:orgworkspace.php
示例17: CRM_Core_DAO_UFMatch
/**
* Synchronize the object with the UF Match entry. Can be called stand-alone from
* the drupalUsers script
*
* @param Object $user the drupal user object
* @param string $userKey the id of the user from the uf object
* @param string $uniqId the OpenID of the user
* @param string $uf the name of the user framework
* @param integer $status returns the status if user created or already exits (used for CMS sync)
*
* @return the ufmatch object that was found or created
* @access public
* @static
*/
static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = null, $ctype = null, $isLogin = false)
{
// validate that uniqId is a valid url. it will either be
// an OpenID (which should always be a valid url) or a
// http://uf_username/ construction (so that it can
// be used as an OpenID in the future)
require_once 'CRM/Utils/Rule.php';
if ($uf == 'Standalone') {
if (!CRM_Utils_Rule::url($uniqId)) {
return $status ? null : false;
}
} else {
if (!CRM_Utils_Rule::email($uniqId)) {
return $status ? null : false;
}
}
$newContact = false;
// make sure that a contact id exists for this user id
$ufmatch =& new CRM_Core_DAO_UFMatch();
if (CRM_Core_DAO::checkFieldExists('civicrm_uf_match', 'domain_id')) {
// FIXME: if() condition check was required especially for upgrade cases (2.2.x -> 3.0.x),
// where folks if happen to logout, would encounter a column not found fatal error
$ufmatch->domain_id = CRM_Core_Config::domainID();
}
$ufmatch->uf_id = $userKey;
if (!$ufmatch->find(true)) {
require_once 'CRM/Core/Transaction.php';
$transaction = new CRM_Core_Transaction();
if (!empty($_POST) && !$isLogin) {
$params = $_POST;
$params['email'] = $uniqId;
require_once 'CRM/Dedupe/Finder.php';
$dedupeParams = CRM_Dedupe_Finder::formatParams($params, 'Individual');
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
if (!empty($ids) && defined('CIVICRM_UNIQ_EMAIL_PER_SITE') && CIVICRM_UNIQ_EMAIL_PER_SITE) {
// restrict dupeIds to ones that belong to current domain/site.
require_once 'CRM/Core/BAO/Domain.php';
$siteContacts = CRM_Core_BAO_Domain::getContactList();
foreach ($ids as $index => $dupeId) {
if (!in_array($dupeId, $siteContacts)) {
unset($ids[$index]);
}
}
$ids = array_values($ids);
//re-index the array
}
if (!empty($ids)) {
$dao = new CRM_Core_DAO();
$dao->contact_id = $ids[0];
}
} else {
require_once 'CRM/Contact/BAO/Contact.php';
if ($uf == 'Standalone') {
$dao =& CRM_Contact_BAO_Contact::matchContactOnOpenId($uniqId, $ctype);
} else {
$dao =& CRM_Contact_BAO_Contact::matchContactOnEmail($uniqId, $ctype);
}
}
if ($dao) {
//print "Found contact with uniqId $uniqId<br/>";
$ufmatch->contact_id = $dao->contact_id;
$ufmatch->uf_name = $uniqId;
} else {
if ($uf == 'Drupal') {
$mail = 'mail';
} else {
$mail = 'email';
}
if (is_Object($user)) {
$params = array('email-Primary' => $user->{$mail});
}
if ($ctype == 'Organization') {
$params['organization_name'] = $uniqId;
} else {
if ($ctype == 'Household') {
$params['household_name'] = $uniqId;
}
}
if (!$ctype) {
$ctype = "Individual";
}
$params['contact_type'] = $ctype;
// extract first / middle / last name
// for joomla
if ($uf == 'Joomla' && $user->name) {
require_once 'CRM/Utils/String.php';
//.........这里部分代码省略.........
开发者ID:bhirsch,项目名称:voipdev,代码行数:101,代码来源:UFMatch.php
示例18: checkTableColumns
/**
* Method to check needed tables columns
*
* @param object $checkTable object of table, that must be installed
*
* @return boolean true if all is ok
*
* @since 1.0.1
*/
public function checkTableColumns($checkTable)
{
if (!is_object($checkTable)) {
return 0;
}
$_db = JFactory::getDbo();
$neededColumns = array();
$installedColumns = array();
foreach ($checkTable->columns as $col) {
if (is_Object($col)) {
$neededColumns[] = JArrayHelper::fromObject($col, true);
} else {
$neededColumns[] = $col;
}
}
foreach ($_db->getTableColumns($checkTable->name, false) as $col) {
$installedColumns[] = JArrayHelper::fromObject($col, true);
}
// prepare check for col names
$search_cols_1 = array();
$search_cols_2 = array();
foreach ($installedColumns as $col) {
$search_cols_1[] = $col['Field'];
}
foreach ($neededColumns as $col) {
$search_cols_2[] = $col['Column'];
}
// check for col names
for ($i = 0; $i < count($neededColumns); $i++) {
// check for needed col names
if (array_search($neededColumns[$i]['Column'], $search_cols_1) === false) {
$neededColumns[$i]['Null'] == 'NO' ? $null = ' NOT NULL' : ($null = '');
isset($neededColumns[$i]['Default']) ? $default = ' DEFAULT ' . $_db->Quote($neededColumns[$i]['Default']) : ($default = '');
echo '<p class="bw_tablecheck_warn">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COLS', $neededColumns[$i]['Column'], $checkTable->name) . '</p>';
$query = "ALTER TABLE " . $_db->quoteName($checkTable->name) . " ADD " . $_db->quoteName($neededColumns[$i]['Column']) . ' ' . $neededColumns[$i]['Type'] . $null . $default . " AFTER " . $_db->quoteName($neededColumns[$i - 1]['Column']);
$_db->setQuery($query);
$insertCol = $_db->Execute($query);
if (!$insertCol) {
echo '<p class="bw_tablecheck_error">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COL_CREATE_ERROR', $neededColumns[$i]['Column'], $checkTable->name) . '</p>';
return 0;
} else {
echo str_pad('<p class="bw_tablecheck_ok">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COL_CREATE_SUCCESS', $neededColumns[$i]['Column'], $checkTable->name) . '</p>', 4096);
return 2;
// Durchlauf zurücksetzen
}
}
// check for obsolete col names
if (array_search($installedColumns[$i]['Field'], $search_cols_2) === false) {
echo '<p class="bw_tablecheck_warn">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF2_COLS', $installedColumns[$i]['Field'], $checkTable->name) . '</p>';
$query = "ALTER TABLE " . $_db->quoteName($checkTable->name) . " DROP " . $_db->quoteName($installedColumns[$i]['Field']);
$_db->setQuery($query);
$deleteCol = $_db->Execute($query);
if (!$deleteCol) {
echo '<p class="bw_tablecheck_error">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF2_COL_CREATE_ERROR', $installedColumns[$i]['Field'], $checkTable->name) . '</p>';
return 0;
} else {
echo str_pad('<p class="bw_tablecheck_ok">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF2_COL_CREATE_SUCCESS', $installedColumns[$i]['Field'], $checkTable->name) . '</p>', 4096);
return 2;
// Durchlauf zurücksetzen
}
}
}
echo str_pad('<p class="bw_tablecheck_ok">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_COLS_OK', $checkTable->name) . '</p>', 4096);
for ($i = 0; $i < count($neededColumns); $i++) {
$diff = array_udiff($neededColumns[$i], $installedColumns[$i], 'strcasecmp');
if (!empty($diff)) {
echo '<p class="bw_tablecheck_warn">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COL_ATTRIBUTES', implode(',', array_keys($diff)), $neededColumns[$i]['Column'], $checkTable->name) . '</p>';
// install missing columns
foreach (array_keys($diff) as $missingCol) {
$neededColumns[$i]['Null'] == 'NO' ? $null = ' NOT NULL' : ($null = '');
isset($neededColumns[$i]['Default']) ? $default = ' DEFAULT ' . $_db->Quote($neededColumns[$i]['Default']) : ($default = '');
$query = "ALTER TABLE " . $_db->quoteName($checkTable->name);
$query .= " MODIFY " . $_db->quoteName($neededColumns[$i]['Column']) . ' ' . $neededColumns[$i]['Type'] . $null . $default;
if (array_key_exists('Extra', $neededColumns[$i])) {
$query .= " " . $neededColumns[$i]['Extra'];
}
$_db->setQuery($query);
$alterCol = $_db->Execute($query);
if (!$alterCol) {
echo '<p class="bw_tablecheck_error">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COL_ATTRIBUTES_ERROR', $missingCol, $neededColumns[$i]['Column'], $checkTable->name) . '</p>';
} else {
echo str_pad('<p class="bw_tablecheck_ok">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_DIFF_COL_ATTRIBUTES_SUCCESS', $missingCol, $neededColumns[$i]['Column'], $checkTable->name) . '</p>', 4096);
}
}
}
}
echo str_pad('<p class="bw_tablecheck_ok">' . JText::sprintf('COM_BWPOSTMAN_MAINTENANCE_CHECK_TABLES_COMPARE_COLS_ATTRIBUTES_OK', $checkTable->name) . '</p>', 4096);
return 1;
}
开发者ID:RomanaBW,项目名称:BwPostman,代码行数:98,代码来源:maintenance.php
示例19: draw
function draw()
{
$r = new request();
if ($r->cancel) {
return "";
}
$object = new $this->callbackobject();
if ($r->step == "") {
$r->step = 1;
$this->step = 1;
} else {
$step = $object->parsePage($r->step);
// El proximo paso viene dado por el objeto
$this->step = $step;
}
$out = "<form method=\"post\" action=\"" . $this->controller . "\">\n <input type=\"hidden\" name=\"step\" value=\"" . ($this->step + 1) . "\">";
foreach ($r as $k => $v) {
if (strpos($k, "__") === false && $k != "step" && $k != "next") {
$out .= "<input type=\"hidden\" name=\"" . $k . "\" value=\"" . $v . "\">";
}
}
if (is_Object($this->pages[$this->step])) {
$out .= $this->pages[$this->step]->draw();
}
if ($this->pages[$r->step]->isfinish) {
$object = new $this->callbackobject();
$object->drop(new request());
}
return $out;
}
开发者ID:Esleelkartea,项目名称:arotz,代码行数:30,代码来源:wizard.php
示例20: __construct
public function __construct($template, $CSS_filename, $user_name, $course_title, $node_title = "", $meta_keywords = "", $author = "", $meta_refresh_time = "", $meta_refresh_url = "", $onload_func = "", $layoutObj = NULL)
{
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$root_dir = $GLOBALS['root_dir'];
$http_root_dir = $GLOBALS['http_root_dir'];
$keywords = "ADA, Lynx, ";
$keywords .= ADA_METAKEYWORDS;
// from config file
$description = ADA_METADESCRIPTION;
// from config file
//$layoutObj = $GLOBALS['layoutObj'];
if (!is_Object($layoutObj)) {
// we use function parameters
$this->template = $template;
$this->CSS_filename = $CSS_filename;
$this->JS_filename = $JS_filename;
$this->family = "";
$this->module_dir = "";
} else {
// we use data from LayOut object
$this->template = $layoutObj->template;
$this->CSS_filename = $layoutObj->CSS_filename;
$this->family = $layoutObj->family;
$this->JS_filename = $layoutObj->JS_filename;
$this->module_dir = $layoutObj->module_dir;
$this->external_module = $layoutObj->external_module;
}
$template_name = basename($template);
$widget_filename = !is_null($layoutObj) ? basename($layoutObj->WIDGET_filename) : '';
$family_name = $this->family;
$module_dir = $this->module_dir;
$static_filename = $this->static_filename;
$this->htmlheader = "\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . ADA_CHARSET . "\">";
//this is useful for all those html pages that need a refresh time
// if the refresh time & url are set, this tag is added into the header part of the html page
if (!empty($meta_refresh_time)) {
$this->htmlheader .= "\n <meta http-equiv=\"refresh\" content=\"{$meta_refresh_time}; url={$meta_
|
请发表评论