@@ -4,10 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use humhub\modules\geolocation\Module; |
| 6 | 6 | use humhub\modules\queue\driver\MySQLCommand; |
| 7 | -use Yii; |
|
| 8 | 7 | use yii\base\Model; |
| 9 | 8 | use yii\data\ActiveDataProvider; |
| 10 | -use yii\db\QueryBuilder; |
|
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * UserSearch represents the model behind the search form of `humhub\modules\geolocation\models\User`. |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | return $dataProvider; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $newQuery = new MySQLCommand('geolocatioin',Module::getInstance()); |
|
| 62 | + $newQuery = new MySQLCommand('geolocatioin', Module::getInstance()); |
|
| 63 | 63 | |
| 64 | 64 | // grid filtering conditions |
| 65 | 65 | $query->andFilterWhere([ |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | |
| 11 | 11 | use Yii; |
| 12 | 12 | use yii\helpers\Url; |
| 13 | - |
|
| 14 | 13 | use humhub\modules\directory\models\User; |
| 15 | 14 | |
| 16 | 15 | /** |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | if (!Yii::$app->user->isGuest && !$user->isCurrentUser() && Yii::$app->getModule('friendship')->getIsEnabled()) { |
| 23 | 23 | $friendShipState = Friendship::getStateForUser(Yii::$app->user->getIdentity(), $user); |
| 24 | 24 | if ($friendShipState === Friendship::STATE_NONE) { |
| 25 | - echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t("FriendshipModule.base", "Add Friend"), Url::to(['/friendship/request/add', 'userId' => $user->id]), ['class' => 'btn btn-primary btn-sm','data-ui-loader' => '', 'data-method' => 'POST']); |
|
| 25 | + echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t("FriendshipModule.base", "Add Friend"), Url::to(['/friendship/request/add', 'userId' => $user->id]), ['class' => 'btn btn-primary btn-sm', 'data-ui-loader' => '', 'data-method' => 'POST']); |
|
| 26 | 26 | } elseif ($friendShipState === Friendship::STATE_FRIENDS) { |
| 27 | 27 | echo Html::a('<span class="glyphicon glyphicon-ok"></span> ' . Yii::t("FriendshipModule.base", "Friends"), $user->getUrl(), ['class' => 'btn btn-info btn-sm', 'data-ui-loader' => '']); |
| 28 | 28 | } |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | public $jsOptions = ['position' => View::POS_END]; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * @var array change forceCopy to true when testing your js in order to rebuild this assets on every request (otherwise they will be cached) |
|
| 25 | - */ |
|
| 24 | + * @var array change forceCopy to true when testing your js in order to rebuild this assets on every request (otherwise they will be cached) |
|
| 25 | + */ |
|
| 26 | 26 | public $publishOptions = [ |
| 27 | 27 | 'forceCopy' => false |
| 28 | 28 | ]; |
@@ -32,16 +32,16 @@ |
||
| 32 | 32 | public $guestAccess = false; |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @inheritdoc |
|
| 36 | - */ |
|
| 35 | + * @inheritdoc |
|
| 36 | + */ |
|
| 37 | 37 | public function getConfigUrl() |
| 38 | 38 | { |
| 39 | 39 | return Url::to(['/geolocation/admin']); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * @inheritdoc |
|
| 44 | - */ |
|
| 43 | + * @inheritdoc |
|
| 44 | + */ |
|
| 45 | 45 | public function disable() |
| 46 | 46 | { |
| 47 | 47 | $uninstall = new Uninstall(); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | return (Group::find()->where(['show_at_directory' => 1])->count() != 0); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function getPath(){ |
|
| 70 | + public function getPath() { |
|
| 71 | 71 | return "protected/modules/geolocation"; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $table = Yii::$app->db->getTableSchema('user'); |
| 14 | 14 | |
| 15 | - if (isset($table->columns['longitude'])){ |
|
| 15 | + if (isset($table->columns['longitude'])) { |
|
| 16 | 16 | $this->dropColumn('user', 'longitude'); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if (isset($table->columns['latitude'])){ |
|
| 19 | + if (isset($table->columns['latitude'])) { |
|
| 20 | 20 | $this->dropColumn('user', 'latitude'); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $table = Yii::$app->db->getTableSchema('user'); |
| 20 | 20 | |
| 21 | - if (!isset($table->columns['longitude'])){ |
|
| 21 | + if (!isset($table->columns['longitude'])) { |
|
| 22 | 22 | $this->addColumn('user', 'longitude', 'string'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (!isset($table->columns['latitude'])){ |
|
| 25 | + if (!isset($table->columns['latitude'])) { |
|
| 26 | 26 | $this->addColumn('user', 'latitude', 'string'); |
| 27 | 27 | } |
| 28 | 28 | $this->db->createCommand('DROP FUNCTION IF EXISTS `get_distance_in_miles_between_geo_locations`')->execute(); |
@@ -5,19 +5,19 @@ |
||
| 5 | 5 | use humhub\widgets\TopMenu; |
| 6 | 6 | |
| 7 | 7 | return [ |
| 8 | - 'id' => 'geolocation', |
|
| 9 | - 'class' => 'humhub\modules\geolocation\Module', |
|
| 10 | - 'namespace' => 'humhub\modules\geolocation', |
|
| 11 | - 'events' => [ |
|
| 8 | + 'id' => 'geolocation', |
|
| 9 | + 'class' => 'humhub\modules\geolocation\Module', |
|
| 10 | + 'namespace' => 'humhub\modules\geolocation', |
|
| 11 | + 'events' => [ |
|
| 12 | 12 | |
| 13 | - [ |
|
| 14 | - 'class' => AdminMenu::class, |
|
| 15 | - 'event' => AdminMenu::EVENT_INIT, |
|
| 16 | - 'callback' => [Events::class, 'onAdminMenuInit'] |
|
| 17 | - ], |
|
| 13 | + [ |
|
| 14 | + 'class' => AdminMenu::class, |
|
| 15 | + 'event' => AdminMenu::EVENT_INIT, |
|
| 16 | + 'callback' => [Events::class, 'onAdminMenuInit'] |
|
| 17 | + ], |
|
| 18 | 18 | |
| 19 | 19 | ['class' => TopMenu::class, 'event' => TopMenu::EVENT_BEFORE_RUN, 'callback' => [\humhub\modules\geolocation\Events::class, 'onTopMenuInit']], |
| 20 | - ], |
|
| 20 | + ], |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | ]; |
@@ -78,10 +78,10 @@ |
||
| 78 | 78 | <div class="media-body"> |
| 79 | 79 | <h4 class="media-heading"> |
| 80 | 80 | <?= Html::containerLink($user); ?> |
| 81 | - <div id="distance"><?php if (is_numeric($user->distance)){ |
|
| 81 | + <div id="distance"><?php if (is_numeric($user->distance)) { |
|
| 82 | 82 | echo round($user->distance) . " miles.</div>"; |
| 83 | - }else { |
|
| 84 | - echo $user->distance ."</div>"; |
|
| 83 | + } else { |
|
| 84 | + echo $user->distance . "</div>"; |
|
| 85 | 85 | } ?> |
| 86 | 86 | <?= UserGroupList::widget(['user' => $user]); ?> |
| 87 | 87 | </h4> |
@@ -21,8 +21,11 @@ discard block |
||
| 21 | 21 | <div class="panel-heading"> |
| 22 | 22 | <?php if ($group === null) : ?> |
| 23 | 23 | <?= Yii::t('DirectoryModule.base', '<strong>Member</strong> directory'); ?> |
| 24 | - <?php else: ?> |
|
| 25 | - <?= Yii::t('DirectoryModule.base', '<strong>Group</strong> members - {group}', ['{group}' => Html::encode($group->name)]); ?> |
|
| 24 | + <?php else { |
|
| 25 | + : ?> |
|
| 26 | + <?= Yii::t('DirectoryModule.base', '<strong>Group</strong> members - {group}', ['{group}' => Html::encode($group->name)]); |
|
| 27 | +} |
|
| 28 | +?> |
|
| 26 | 29 | <?php endif; ?> |
| 27 | 30 | </div> |
| 28 | 31 | |
@@ -80,7 +83,7 @@ discard block |
||
| 80 | 83 | <?= Html::containerLink($user); ?> |
| 81 | 84 | <div id="distance"><?php if (is_numeric($user->distance)){ |
| 82 | 85 | echo round($user->distance) . " miles.</div>"; |
| 83 | - }else { |
|
| 86 | + } else { |
|
| 84 | 87 | echo $user->distance ."</div>"; |
| 85 | 88 | } ?> |
| 86 | 89 | <?= UserGroupList::widget(['user' => $user]); ?> |