diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-15 21:08:27 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-15 21:08:27 +0100 |
commit | 9428c25c4682957ad21959eb6ff3137155785d50 (patch) | |
tree | 4f4588be88b76e00031e96d11becb2cea23300e8 | |
parent | 0e240ee8a0393d50156a3078b76b52ad58fb2eb9 (diff) |
spaces to tabs
-rw-r--r-- | controller/news.controller.php | 154 | ||||
-rw-r--r-- | css/owncloud.css | 112 |
2 files changed, 133 insertions, 133 deletions
diff --git a/controller/news.controller.php b/controller/news.controller.php index 6194c0b28..9913f28a9 100644 --- a/controller/news.controller.php +++ b/controller/news.controller.php @@ -15,83 +15,83 @@ namespace OCA\News; class NewsController extends Controller { - private $feedMapper; - private $folderMapper; - - /** - * @param Request $request: the object with the request instance - * @param string $api: an instance of the api wrapper object - * @param FolderMapper $folderMapper: an instance of the folder mapper - * @param FeedMapper $feedMapper: an instance of the feed mapper - */ - public function __construct($request, $api, $feedMapper, $folderMapper){ - parent::__construct($request, $api); - $this->feedMapper = $feedMapper; - $this->folderMapper = $folderMapper; - $this->api->activateNavigationEntry(); - } - - - /** - * OPML export download page - */ - public function exportOPML($urlParams=array()){ - $opmlExporter = new OPMLExporter($this->api); - - $allFeeds = $this->folderMapper->childrenOfWithFeeds(0); - $opml = $opmlExporter->buildOPML($allFeeds); - - $fileName = 'ownCloud ' . $this->trans->t('News') . ' ' . $this->userId . '.opml'; - $contentType = 'application/x.opml+xml'; - $response = new TextDownloadResponse($opml, $fileName, $contentType); - - return $response; - } - - - /** - * Decides wether to show the feedpage or the firstrun page - */ - public function index($urlParams=array()){ - $this->api->add3rdPartyScript('angular/angular'); - $this->api->add3rdPartyScript('angular-ui/angular-ui'); - $this->api->add3rdPartyScript('moment.min'); - $this->api->addScript('app'); - $this->api->addScript('multiselect', 'core'); - - $this->api->addStyle('owncloud'); - $this->api->addStyle('addnew'); - $this->api->addStyle('feeds'); - $this->api->addStyle('items'); - $this->api->addStyle('settings'); - $this->api->addStyle('addnew'); - $this->api->addStyle('showall'); - - if($urlParams['feedid']){ - $this->api->setUserValue('lastViewedFeed', $urlParams['feedid']); - $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); - } - - $lastViewedFeedId = $this->api->getUserValue('lastViewedFeed'); - $lastViewedFeedType = $this->api->getUserValue('lastViewedFeedType'); - - if( $lastViewedFeedId === null || $lastViewedFeedType === null) { - $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());; - $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); - - } else { - // check if the last selected feed or folder exists - if(($lastViewedFeedType === FeedType::FEED && - $this->feedMapper->findById($lastViewedFeedId) === null) || - ($lastViewedFeedType === FeedType::FOLDER && - $this->folderMapper->findById($lastViewedFeedId) === null)){ - $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());; - $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); - } - } - - return $this->render('main'); - } + private $feedMapper; + private $folderMapper; + + /** + * @param Request $request: the object with the request instance + * @param string $api: an instance of the api wrapper object + * @param FolderMapper $folderMapper: an instance of the folder mapper + * @param FeedMapper $feedMapper: an instance of the feed mapper + */ + public function __construct($request, $api, $feedMapper, $folderMapper){ + parent::__construct($request, $api); + $this->feedMapper = $feedMapper; + $this->folderMapper = $folderMapper; + $this->api->activateNavigationEntry(); + } + + + /** + * OPML export download page + */ + public function exportOPML($urlParams=array()){ + $opmlExporter = new OPMLExporter($this->api); + + $allFeeds = $this->folderMapper->childrenOfWithFeeds(0); + $opml = $opmlExporter->buildOPML($allFeeds); + + $fileName = 'ownCloud ' . $this->trans->t('News') . ' ' . $this->userId . '.opml'; + $contentType = 'application/x.opml+xml'; + $response = new TextDownloadResponse($opml, $fileName, $contentType); + + return $response; + } + + + /** + * Decides wether to show the feedpage or the firstrun page + */ + public function index($urlParams=array()){ + $this->api->add3rdPartyScript('angular/angular'); + $this->api->add3rdPartyScript('angular-ui/angular-ui'); + $this->api->add3rdPartyScript('moment.min'); + $this->api->addScript('app'); + $this->api->addScript('multiselect', 'core'); + + $this->api->addStyle('owncloud'); + $this->api->addStyle('addnew'); + $this->api->addStyle('feeds'); + $this->api->addStyle('items'); + $this->api->addStyle('settings'); + $this->api->addStyle('addnew'); + $this->api->addStyle('showall'); + + if($urlParams['feedid']){ + $this->api->setUserValue('lastViewedFeed', $urlParams['feedid']); + $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); + } + + $lastViewedFeedId = $this->api->getUserValue('lastViewedFeed'); + $lastViewedFeedType = $this->api->getUserValue('lastViewedFeedType'); + + if( $lastViewedFeedId === null || $lastViewedFeedType === null) { + $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());; + $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); + + } else { + // check if the last selected feed or folder exists + if(($lastViewedFeedType === FeedType::FEED && + $this->feedMapper->findById($lastViewedFeedId) === null) || + ($lastViewedFeedType === FeedType::FOLDER && + $this->folderMapper->findById($lastViewedFeedId) === null)){ + $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());; + $this->api->setUserValue('lastViewedFeedType', FeedType::FEED); + } + } + + return $this->render('main'); + } } diff --git a/css/owncloud.css b/css/owncloud.css index a4b18ee57..0dd4b0932 100644 --- a/css/owncloud.css +++ b/css/owncloud.css @@ -2,67 +2,67 @@ #app { height: 100%; width: 100%; } /* Navigation: folder like structure */ #app-navigation { - width: 250px; height: 100%; float: left; padding-bottom: 32px; - -moz-box-sizing: border-box; box-sizing: border-box; - border-right: 1px solid #ccc; background-color: #f8f8f8; + width: 250px; height: 100%; float: left; padding-bottom: 32px; + -moz-box-sizing: border-box; box-sizing: border-box; + border-right: 1px solid #ccc; background-color: #f8f8f8; } #app-navigation > ul { - height: 100%; overflow: auto; - -moz-box-sizing: border-box; box-sizing: border-box; + height: 100%; overflow: auto; + -moz-box-sizing: border-box; box-sizing: border-box; } #app-navigation li { - width: 100%; position: relative; - -moz-box-sizing: border-box; box-sizing: border-box; - text-shadow: 0 1px 0 rgba(255, 255, 255, .9); + width: 100%; position: relative; + -moz-box-sizing: border-box; box-sizing: border-box; + text-shadow: 0 1px 0 rgba(255, 255, 255, .9); } #app-navigation li.active { background-color: #ccc; text-shadow: 0 1px 0 rgba(255,255,255,.7); } #app-navigation > ul > li { - border-bottom: 1px solid #ddd; - border-top: 1px solid #fff; - background-color: #eee; + border-bottom: 1px solid #ddd; + border-top: 1px solid #fff; + background-color: #eee; } #app-navigation > ul > li.active { border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } #app-navigation ul.with-icon a { - padding-left: 32px; - background-size: 16px 16px; background-repeat: no-repeat; - background-position: 10px center; + padding-left: 32px; + background-size: 16px 16px; background-repeat: no-repeat; + background-position: 10px center; } #app-navigation li > a { - display: block; width: 100%; padding: 0 16px; overflow: hidden; line-height: 32px; - -moz-box-sizing: border-box; box-sizing: border-box; - white-space: nowrap; text-overflow: ellipsis; color: #333; + display: block; width: 100%; padding: 0 16px; overflow: hidden; line-height: 32px; + -moz-box-sizing: border-box; box-sizing: border-box; + white-space: nowrap; text-overflow: ellipsis; color: #333; } #app-navigation li:hover > a { background-color: #ccc; } #app-navigation > ul > li:hover { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;} #app-navigation li.collapsible > button.collapse { - display: none; position: absolute; left: 6px; top: 5px; height: 16px; width: 16px; - background: none; background-image: url('../img/actions/triangle-s.svg'); - background-repeat: no-repeat; background-size: 16px 16px; - border: none; border-radius: 0; outline: none !important; - box-shadow: none; + display: none; position: absolute; left: 6px; top: 5px; height: 16px; width: 16px; + background: none; background-image: url('../img/actions/triangle-s.svg'); + background-repeat: no-repeat; background-size: 16px 16px; + border: none; border-radius: 0; outline: none !important; + box-shadow: none; } #app-navigation li.collapsible:hover > a { background-image: none; } #app-navigation li.collapsible:hover > button.collapse { display: block; } #app-navigation li.collapsible button.collapse { - -moz-transform: rotate(-90deg); - -webkit-transform: rotate(-90deg); - -ms-transform:rotate(-90deg); - -o-transform:rotate(-90deg); - transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -webkit-transform: rotate(-90deg); + -ms-transform:rotate(-90deg); + -o-transform:rotate(-90deg); + transform: rotate(-90deg); } #app-navigation li.collapsible.open button.collapse { - -moz-transform: rotate(0); - -webkit-transform: rotate(0); - -ms-transform:rotate(0); - -o-transform:rotate(0); - transform: rotate(0); + -moz-transform: rotate(0); + -webkit-transform: rotate(0); + -ms-transform:rotate(0); + -o-transform:rotate(0); + transform: rotate(0); } /* Second level nesting for lists */ @@ -71,29 +71,29 @@ #app-navigation > ul.with-icon ul li > a { padding-left: 48px; background-position: 24px center; } #app-navigation .open { - background-image: linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -o-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -moz-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -webkit-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); - background-image: -ms-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -o-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -moz-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -webkit-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); + background-image: -ms-linear-gradient(top, rgb(238,238,238) 0%, rgb(245,245,245) 100%); } #app-navigation > ul li.open:hover { - -webkit-box-shadow: inset 0 0 3px #cccccc; - box-shadow: inset 0 0 3px #cccccc; - border-top: 1px solid #ccc; + -webkit-box-shadow: inset 0 0 3px #cccccc; + box-shadow: inset 0 0 3px #cccccc; + border-top: 1px solid #ccc; } #app-navigation > ul li.open ul { display: block; } /* drag and drop */ #app-navigation .drag-and-drop { - -moz-transition: padding-bottom 500ms ease 0s; - -o-transition: padding-bottom 500ms ease 0s; - -webkit-transition: padding-bottom 500ms ease 0s; - -ms-transition: padding-bottom 500ms ease 0s; - transition: padding-bottom 500ms ease 0s; - padding-bottom: 40px; + -moz-transition: padding-bottom 500ms ease 0s; + -o-transition: padding-bottom 500ms ease 0s; + -webkit-transition: padding-bottom 500ms ease 0s; + -ms-transition: padding-bottom 500ms ease 0s; + transition: padding-bottom 500ms ease 0s; + padding-bottom: 40px; } #app-navigation .personalblock > legend { padding: 10px 0; margin: 0; } #app-navigation .error { color: #DD1144; } @@ -110,12 +110,12 @@ #app-settings.open #app-settings-content { display: block; } .settings-button { - height: 32px; width: 100%; padding: 0; margin: 0; display: block; - background-image: url('../img/actions/settings.png'); - background-repeat: no-repeat; background-position: 10px center; - background-color: transparent; - box-shadow: none; - border-radius: 0; border: 0; + height: 32px; width: 100%; padding: 0; margin: 0; display: block; + background-image: url('../img/actions/settings.png'); + background-repeat: no-repeat; background-position: 10px center; + background-color: transparent; + box-shadow: none; + border-radius: 0; border: 0; } .settings-button:hover { background-color: #ddd; } @@ -127,8 +127,8 @@ /* buttons */ button.loading { - background-image: url('../img/loading.gif'); - background-position: right 10px center; - background-repeat: no-repeat; - padding-right: 30px; + background-image: url('../img/loading.gif'); + background-position: right 10px center; + background-repeat: no-repeat; + padding-right: 30px; }
\ No newline at end of file |