mirror of
https://github.com/humhub/humhub.git
synced 2025-04-22 16:11:55 +02:00
Models Clean
This commit is contained in:
parent
b58ecbc135
commit
692c02fe89
@ -1,5 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\models;
|
||||
|
||||
use Yii;
|
||||
@ -46,12 +52,14 @@ class ModuleEnabled extends \yii\db\ActiveRecord
|
||||
public function afterDelete()
|
||||
{
|
||||
Yii::$app->cache->delete(self::CACHE_ID_ALL_IDS);
|
||||
|
||||
return parent::afterDelete();
|
||||
}
|
||||
|
||||
public function afterSave($insert, $changedAttributes)
|
||||
{
|
||||
Yii::$app->cache->delete(self::CACHE_ID_ALL_IDS);
|
||||
|
||||
return parent::afterSave($insert, $changedAttributes);
|
||||
}
|
||||
|
||||
@ -65,6 +73,7 @@ class ModuleEnabled extends \yii\db\ActiveRecord
|
||||
}
|
||||
Yii::$app->cache->set(self::CACHE_ID_ALL_IDS, $enabledModules);
|
||||
}
|
||||
|
||||
return $enabledModules;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\models;
|
||||
|
||||
use Yii;
|
||||
@ -176,6 +182,7 @@ class Setting extends \yii\db\ActiveRecord
|
||||
if ($module === null) {
|
||||
throw new \yii\base\Exception("Could not find module: " . $moduleId);
|
||||
}
|
||||
|
||||
return $module;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
|
||||
/**
|
||||
* This is the model class for table "url_oembed".
|
||||
*
|
||||
@ -54,7 +59,6 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
*/
|
||||
public static function GetOEmbed($url)
|
||||
{
|
||||
|
||||
$url = trim($url);
|
||||
|
||||
// Check if the given URL has OEmbed Support
|
||||
@ -69,7 +73,6 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -100,7 +103,6 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
*/
|
||||
public static function loadUrl($url)
|
||||
{
|
||||
|
||||
$urlOembed = new UrlOembed();
|
||||
$urlOembed->url = $url;
|
||||
$html = "";
|
||||
@ -154,6 +156,7 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -189,6 +192,7 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
}
|
||||
$return = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@ -203,6 +207,7 @@ class UrlOembed extends \yii\db\ActiveRecord
|
||||
if ($providers != "") {
|
||||
return \yii\helpers\Json::decode($providers);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ use Yii;
|
||||
use yii\base\Model;
|
||||
|
||||
/**
|
||||
* ChooseLanguage is the model of the language select box to change language for
|
||||
* ChooseLanguage is the model of the language select box to change language for
|
||||
* guests.
|
||||
*/
|
||||
class ChooseLanguage extends Model
|
||||
@ -45,7 +45,7 @@ class ChooseLanguage extends Model
|
||||
|
||||
/**
|
||||
* Stores language as cookie
|
||||
*
|
||||
*
|
||||
* @since 1.2
|
||||
* @return boolean
|
||||
*/
|
||||
@ -67,7 +67,7 @@ class ChooseLanguage extends Model
|
||||
|
||||
/**
|
||||
* Returns the saved language in the cookie
|
||||
*
|
||||
*
|
||||
* @return string the stored language
|
||||
*/
|
||||
public function getSavedLanguage()
|
||||
@ -91,6 +91,4 @@ class ChooseLanguage extends Model
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
@ -1,21 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* HumHub
|
||||
* Copyright © 2014 The HumHub Project
|
||||
*
|
||||
* The texts of the GNU Affero General Public License with an additional
|
||||
* permission and of our proprietary license can be found at and
|
||||
* in the LICENSE file you have received along with this program.
|
||||
*
|
||||
* According to our dual licensing model, this program can be used either
|
||||
* under the terms of the GNU Affero General Public License, version 3,
|
||||
* or under a proprietary license.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\models\forms;
|
||||
|
Loading…
x
Reference in New Issue
Block a user