From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/php/model/Calendar.php | 92 ---------------------------------------- app/php/model/Category.php | 30 ------------- app/php/model/Entry.php | 43 ------------------- app/php/model/User.php | 36 ---------------- app/php/model/UserPreference.php | 23 ---------- app/php/model/config.xml | 9 ---- 6 files changed, 233 deletions(-) delete mode 100644 app/php/model/Calendar.php delete mode 100644 app/php/model/Category.php delete mode 100644 app/php/model/Entry.php delete mode 100644 app/php/model/User.php delete mode 100644 app/php/model/UserPreference.php delete mode 100644 app/php/model/config.xml (limited to 'app/php/model') diff --git a/app/php/model/Calendar.php b/app/php/model/Calendar.php deleted file mode 100644 index b49bf92..0000000 --- a/app/php/model/Calendar.php +++ /dev/null @@ -1,92 +0,0 @@ - 'UID', - 'url' => 'Url', - 'name' => 'Name', - 'website' => 'Website', - 'visible' => 'Visible', - 'last_updated' => 'LastUpdated', - 'custom_name' => 'CustomName', - 'custom_image' => 'CustomImage', - 'custom_url' => 'CustomUrl', - '_category' => 'CategoryID' - ]; - - public static $RELATIONS = [ - 'Entries' => [self::HAS_MANY, 'Entry', '_calendar'], - 'Category' => [self::BELONGS_TO, 'Category', '_category'] - ]; - - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - - const CUSTOM_IMAGE_PATH = 'resources/images/calendars'; - - public function getCustomImageUrl() { - if ($this->CustomImage) { - if (!preg_match('#^//#', $this->CustomImage)) { - return Prado::getApplication()->getAssetManager()->publishFilePath( - implode( - DIRECTORY_SEPARATOR, - [ - Prado::getApplication()->getBasePath(), - self::CUSTOM_IMAGE_PATH, - $this->CustomImage - ] - ), - TRUE - ); - } - return $this->CustomImage; - } - } - - public function getCustomImagePath($forFile = NULL, $type = '') { - $pathParts = [ - Prado::getApplication()->getBasePath(), - self::CUSTOM_IMAGE_PATH - ]; - if ($forFile) { - $pathParts[] = $this->_getCustomImageHash($forFile, $type); - } - return implode(DIRECTORY_SEPARATOR, $pathParts); - } - - private function _getCustomImageHash($file, $type) { - $hash = md5($file . md5_file($file) . filemtime($file)); - if ($type) { - $hash .= '.' . preg_replace('#^image/#', '', $type); - } - return $hash; - } - - public function saveData($data) { - $this->copyFrom($data); - return $this->save(); - } - -} - -?> diff --git a/app/php/model/Category.php b/app/php/model/Category.php deleted file mode 100644 index 87b97b6..0000000 --- a/app/php/model/Category.php +++ /dev/null @@ -1,30 +0,0 @@ - 'ID', - 'name' => 'Name', - 'priority' => 'Priority' - ]; - - public static $RELATIONS = [ - 'Calendars' => [self::HAS_MANY, 'Calendar', '_category'] - ]; - - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - -} - -?> diff --git a/app/php/model/Entry.php b/app/php/model/Entry.php deleted file mode 100644 index 4b93f04..0000000 --- a/app/php/model/Entry.php +++ /dev/null @@ -1,43 +0,0 @@ - 'ID', - 'uid' => 'UID', - 'begin_date' => 'BeginDate', - 'end_date' => 'EndDate', - 'all_day' => 'AllDay', - 'name' => 'Name', - 'location' => 'Location', - 'last_modified' => 'LastModified', - '_calendar' => 'CalendarID' - ]; - - public static $RELATIONS = [ - 'Calendar' => [self::BELONGS_TO, 'Calendar', '_calendar'] - ]; - - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - -} - -?> diff --git a/app/php/model/User.php b/app/php/model/User.php deleted file mode 100644 index d431183..0000000 --- a/app/php/model/User.php +++ /dev/null @@ -1,36 +0,0 @@ - 'ID', - 'login' => 'Login', - 'password' => 'Password', - 'is_admin' => 'IsAdmin', - 'timezone' => 'Timezone', - 'last_login' => 'LastLogin' - ]; - - public static $RELATIONS = [ - 'Calendars' => [self::MANY_TO_MANY, 'Calendar', 'user_selections'] - ]; - - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - -} - -?> diff --git a/app/php/model/UserPreference.php b/app/php/model/UserPreference.php deleted file mode 100644 index 90fa221..0000000 --- a/app/php/model/UserPreference.php +++ /dev/null @@ -1,23 +0,0 @@ - 'UserID', - '_calendar' => 'CalendarID' - ]; - - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - -} - -?> diff --git a/app/php/model/config.xml b/app/php/model/config.xml deleted file mode 100644 index a729150..0000000 --- a/app/php/model/config.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -- cgit v1.2.3