Changeset 11063
- Timestamp:
- Mar 19, 2009, 4:51:47 PM (13 years ago)
- Location:
- OpenPNE3/plugins/opOpenSocialPlugin/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/plugins/opOpenSocialPlugin/trunk/apps/pc_backend/modules/opOpenSocialPlugin/actions/actions.class.php
r10832 r11063 93 93 try 94 94 { 95 $application = ApplicationPeer::addApplication($contact['application_url'], $this->getUser()->getCulture(),true);95 $application = ApplicationPeer::addApplication($contact['application_url'], true); 96 96 } 97 97 catch (Exception $e) -
OpenPNE3/plugins/opOpenSocialPlugin/trunk/apps/pc_frontend/modules/application/actions/actions.class.php
r10832 r11063 89 89 try 90 90 { 91 $application = ApplicationPeer::addApplication($contact['application_url'] ,$this->getUser()->getCulture());91 $application = ApplicationPeer::addApplication($contact['application_url']); 92 92 } 93 93 catch (Exception $e) -
OpenPNE3/plugins/opOpenSocialPlugin/trunk/apps/pc_frontend/modules/application/actions/components.class.php
r10840 r11063 113 113 try 114 114 { 115 $application = ApplicationPeer::addApplication($url , $this->getUser()->getCulture());115 $application = ApplicationPeer::addApplication($url); 116 116 if (!$application) 117 117 { -
OpenPNE3/plugins/opOpenSocialPlugin/trunk/lib/model/Application.php
r10261 r11063 18 18 class Application extends BaseApplication 19 19 { 20 /** 21 * hasSetting 22 * 23 * @return boolean 24 */ 20 public function hydrate($row, $startcol = 0, $rehydrate = false) 21 { 22 $result = parent::hydrate($row, $startcol, $rehydrate); 23 24 if ($this->getCurrentApplicationI18n()->isNew()) 25 { 26 $this->setCulture(sfConfig::get('sf_default_culture')); 27 } 28 29 return $result; 30 } 31 32 /** 33 * hasSetting 34 * 35 * @return boolean 36 */ 25 37 public function hasSetting() 26 38 { … … 40 52 } 41 53 42 /**43 * getSettings44 *45 * @param string $culture46 * @return array47 */54 /** 55 * getSettings 56 * 57 * @param string $culture 58 * @return array 59 */ 48 60 public function getSettings($culture = null) 49 61 { … … 51 63 } 52 64 53 /**54 * count installed member55 *56 * @return integer57 */65 /** 66 * count installed member 67 * 68 * @return integer 69 */ 58 70 public function countInstalledMember() 59 71 { 60 72 $criteria = new Criteria(); 61 $criteria->add(MemberApplicationPeer::APPLICATION_ID, parent::getId());62 73 $criteria->add(MemberApplicationPeer::IS_GADGET, false); 63 return MemberApplicationPeer::doCount($criteria);74 return $this->countMemberApplications($criteria); 64 75 } 65 76 } 77 -
OpenPNE3/plugins/opOpenSocialPlugin/trunk/lib/model/ApplicationPeer.php
r10832 r11063 40 40 * 41 41 * @param string $url gadget url 42 * @param bool $update 42 43 * @param string $culture culture 43 * @param bool $update44 44 * @return Application application object 45 45 */ 46 public static function addApplication($url, $ culture = 'en_US', $update = false)46 public static function addApplication($url, $update = false, $culture = null) 47 47 { 48 if (is_null($culture)) 49 { 50 $culture = sfContext::getInstance()->getUser()->getCulture(); 51 } 52 53 if ($culture != sfConfig::get('sf_default_culture')) 54 { 55 self::addApplication($url, $update, sfConfig::get('sf_default_culture')); 56 } 57 48 58 $app = self::retrieveByUrl($url); 49 if (!empty($app) && !$update) 59 if (!$app) 60 { 61 $app = new Application(); 62 } 63 $app->setCulture($culture); 64 65 if (!($app->getCurrentApplicationI18n()->isNew() || $update)) 50 66 { 51 67 $ua = $app->getUpdatedAt('U'); … … 58 74 $req = self::arrayToObject(array( 59 75 'context' => array( 60 'country' => isset($cul[1]) ? $cul[1] : ' US',76 'country' => isset($cul[1]) ? $cul[1] : 'All', 61 77 'language' => $cul[0], 62 78 'view' => 'default', … … 77 93 } 78 94 $gadget = $response[0]; 79 if (empty($app))80 {81 $app = new Application();82 }83 95 $app->setUrl($gadget['url']); 84 85 96 $app->setTitle($gadget['title']); 86 97 $app->setTitleUrl($gadget['titleUrl']); … … 116 127 } 117 128 $app->setHeight(! empty($gadget['height']) ? $gadget['height'] : '0'); 118 $iframe_url = $gadget['iframeUrl'];119 $iframe_params = array();120 parse_str($iframe_url, $iframe_params);121 $app->setVersion(isset($iframe_params['v']) ? $iframe_params['v'] : '');122 129 $app->save(); 123 130 return $app; … … 160 167 * @return Application The application instance 161 168 */ 162 public static function updateApplication($modId, $culture = 'en_US')169 public static function updateApplication($modId, $culture = null) 163 170 { 171 if (is_null($culture)) 172 { 173 $culture = sfContext::getInstance()->getUser()->getCulture(); 174 } 175 164 176 $app = self::retrieveByPk($modId); 165 177 if (!$app) … … 170 182 try 171 183 { 172 return self::addApplication($app->getUrl(), $culture, true);184 return self::addApplication($app->getUrl(), true, $culture); 173 185 } 174 186 catch (Exception $e) -
OpenPNE3/plugins/opOpenSocialPlugin/trunk/lib/user/opJsonDbOpensocialService.class.php
r10756 r11063 72 72 } 73 73 $p['profileUrl'] = sfContext::getInstance()->getController()->genUrl("@member_profile?id=".$member->getId(),true); 74 $memberProfiles = MemberProfilePeer::getProfileListByMemberId($member->getId());74 $memberProfiles = $member->getProfile(true, $token->getViewerId()); 75 75 foreach ($memberProfiles as $memberProfile) 76 76 {
Note: See TracChangeset
for help on using the changeset viewer.