plugin wip
This commit is contained in:
@ -35,29 +35,6 @@ class Shared extends Controller {
|
||||
Components::set( 'SITE_URL', Routes::getAddress() );
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$bookmarks = self::$bookmarks->noFolder();
|
||||
$folders = self::$folders->byUser();
|
||||
|
||||
$panelArray = [];
|
||||
if ( !empty( $folders ) ) {
|
||||
foreach ( $folders as $folder ) {
|
||||
$panel = new \stdClass();
|
||||
$folderObject = new \stdClass();
|
||||
$folderObject->bookmarks = self::$bookmarks->byFolder( $folder->ID );
|
||||
$folderObject->ID = $folder->ID;
|
||||
$folderObject->title = $folder->title;
|
||||
$folderObject->color = $folder->color;
|
||||
$folderObject->bookmarkListRows = Views::simpleView( 'bookmarks.components.bookmarkListRows', $folderObject->bookmarks );
|
||||
$panelArray[] = $folderObject;
|
||||
}
|
||||
}
|
||||
Components::set( 'foldersList', Views::simpleView( 'bookmarks.folders.list', $folders ) );
|
||||
Components::set( 'folderPanels', Views::simpleView( 'bookmarks.components.bookmarkListPanel', $panelArray ) );
|
||||
Components::set( 'bookmarksList', Views::simpleView( 'bookmarks.bookmarks.list', $bookmarks ) );
|
||||
return Views::view( 'bookmarks.dash' );
|
||||
}
|
||||
|
||||
public function shared( $type = '', $id = '' ) {
|
||||
if ( empty( $type ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
@ -105,7 +82,7 @@ class Shared extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
return Views::view( 'bookmarks.shareLink', $bookmark );
|
||||
return Views::view( 'bookmarks.public.bookmark', $bookmark );
|
||||
}
|
||||
|
||||
public function folder( $id = '' ) {
|
||||
@ -122,6 +99,9 @@ class Shared extends Controller {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
return Views::view( 'bookmarks.shareFolder', $folder );
|
||||
$folder->bookmarks = self::$bookmarks->unsafeByFolder( $folder->ID );
|
||||
$folder->bookmarkListRows = Views::simpleView( 'bookmarks.components.publicListRows', $folder->bookmarks );
|
||||
$folder->panel = Views::simpleView( 'bookmarks.components.publicList', [$folder] );
|
||||
return Views::view( 'bookmarks.public.folder', $folder );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user