Initial commit
This commit is contained in:
92
app/plugins/contacts/controllers/contacts.php
Normal file
92
app/plugins/contacts/controllers/contacts.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/contacts/controllers/contacts.php
|
||||
*
|
||||
* This is the contacts controller.
|
||||
*
|
||||
* @package TP Contacts
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Houdini\Classes\Forms as FormBuilder;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\Config;
|
||||
|
||||
|
||||
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Models\Contact;
|
||||
use TheTempusProject\Models\Phonebook;
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
|
||||
class Contacts extends Controller {
|
||||
protected static $contacts;
|
||||
protected static $phonebooks;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
if ( !App::$isLoggedIn ) {
|
||||
Session::flash( 'notice', 'You must be logged in to use this feature.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
self::$contacts = new Contact;
|
||||
self::$phonebooks = new Phonebook;
|
||||
self::$title = 'Contacts - {SITENAME}';
|
||||
self::$pageDescription = 'On this page you can create and manage contacts and phonebooks.';
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$phonebooks = Views::simpleView( 'contacts.phonebooks.list', self::$phonebooks->byUser() );
|
||||
Components::set( 'phonebookList', $phonebooks );
|
||||
|
||||
$contacts = Views::simpleView( 'contacts.contacts.list', self::$contacts->byUser() );
|
||||
Components::set( 'contactList', $contacts );
|
||||
|
||||
Views::view( 'contacts.dashboard' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Contacts
|
||||
*/
|
||||
public function viewContact( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
public function createContact( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
public function editContact( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
public function deleteContact( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
|
||||
/**
|
||||
* Phonebooks
|
||||
*/
|
||||
public function viewPhonebook( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
public function createPhonebook() {
|
||||
// stuff here
|
||||
}
|
||||
public function editPhonebook( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
public function deletePhonebook( $id = null ) {
|
||||
// stuff here
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user