Browse Source

removes unnecessary app files

Keith Newman 10 years ago
parent
commit
c1b267df03

+ 0 - 35
frameworks/PHP/clancats/app/classes/User.php

@@ -1,35 +0,0 @@
-<?php
-/**
- * User model
- ** 
- *
- * @package		ClanCatsFramework
- * @author		Mario Döring <[email protected]>
- * @version		2.0
- * @copyright 	2010 - 2014 ClanCats GmbH
- *
- */
-class User extends Auth\User
-{	
-	/**
-	 * The users table
-	 */
-	protected static $_table = 'auth_users';
-	
-	/**
-	 * The user model defaults
-	 *
-	 * @var array
-	 */
-	protected static $_defaults = array(
-		'id'	,
-		'active'			=> array( 'bool', true ),
-		'group_id'		=> 0,
-		'email'			=> null,
-		'password'		=> null,
-		'storage'		=> array( 'json', array() ),
-		'last_login'		=> array( 'timestamp', 0 ),
-		'created_at'		=> array( 'timestamp' ),
-		'modified_at'	=> array( 'timestamp' ),
-	);
-}

+ 0 - 15
frameworks/PHP/clancats/app/config/app.config.php

@@ -1,15 +0,0 @@
-<?php 
-/*
- *---------------------------------------------------------------
- * App configuration
- *---------------------------------------------------------------
- *
- * This is your main application configuration file 
- */
-return array(
-    
-    /*
-     * an description of your application
-     */
-    'description'      => 'ClanCats Framework, because your time is precious. HMVC PHP framework.',
-);

+ 0 - 17
frameworks/PHP/clancats/app/config/auth.config.php

@@ -1,17 +0,0 @@
-<?php 
-/*
- *---------------------------------------------------------------
- * Auth configuration
- *---------------------------------------------------------------
- */
-return array(
-
-	/*
-	 * This is the default configuration for the main session
-	 */
-	'main' => array(
-
-		// The User model class
-		'user_model' => "\\User",
-	),
-);

+ 0 - 78
frameworks/PHP/clancats/app/console/app.php

@@ -1,78 +0,0 @@
-<?php namespace CCConsole; use CCCli;
-/**
- * App console
- * stuff to maintain your application
- ** 
- *
- * @package		ClanCatsFramework
- * @author		Mario Döring <[email protected]>
- * @version		2.0
- * @copyright 	2010 - 2014 ClanCats GmbH
- *
- */
-class app extends \CCConsoleController {
-
-	/**
-	 * return an array with information about the script
-	 */
-	public function help() 
-	{
-		return array(
-			'name'	=> 'App',
-			'desc'	=> 'stuff to maintain your application',
-			'actions'	=> array(
-				'info'	=> 'show information about this application.',
-			),
-		);
-	}
-
-	/**
-	 * print information about this application
-	 *
-	 * @param array 		$params 
-	 */
-	public function action_info( $params ) 
-	{
-		
-		$app = \ClanCats::runtime();
-		
-		// print the app name
-		$this->line( \CCForge_Php::make( 'comment', 
-			$app::$name.PHP_EOL.
-			"*".PHP_EOL.
-			"Running on ClanCatsFramework ".\ClanCats::VERSION.PHP_EOL.
-			"© 2010 - ".date('Y')." ClanCats GmbH".PHP_EOL
-		), 'cyan' );
-		
-		// list printer
-		$list = function( $array )
-		{
-			foreach( $array as $key => $value )
-			{
-				$this->line( $key.': '.CCCli::color( $value, 'green' ) );
-			}
-		};	
-		
-		// print info
-		$list( array(
-			'Runtime Class'		=> $app,
-			'CCF Version'		=> \ClanCats::version(),
-			'CCF Environment'	=> \ClanCats::environment(),
-			'Development env'	=> var_export( \ClanCats::in_development(), true ),
-			'File extention'		=> EXT,
-			'Core namespace'		=> CCCORE_NAMESPACE,
-		));
-		
-		// paths
-		$this->line( PHP_EOL."Paths", 'cyan' );
-		$list( \ClanCats::paths() );
-		
-		// paths
-		$this->line( PHP_EOL."Directories", 'cyan' );
-		$list( \ClanCats::directories() );
-		
-		// autoloader
-		$this->line( PHP_EOL."Autoloader - namespaces", 'cyan' );
-		$list( \CCFinder::$namespaces );
-	}
-}

+ 0 - 137
frameworks/PHP/clancats/app/controllers/AuthController.php

@@ -1,137 +0,0 @@
-<?php
-/*
- *---------------------------------------------------------------
- * Basic Authentication Controller
- *---------------------------------------------------------------
- * 
- * This is an example that should help to explain how CCAuth 
- * and a basic controller works. Feel free to edit.
- */
-class AuthController extends CCViewController 
-{	
-	/**
-	 * Sign in action
-	 *
-	 * @return CCResponse
-	 */
-	public function action_sign_in() 
-	{
-		// Here we set the page topic seen in the title tag
-		$this->theme->topic = __( ':action.topic' );
-		
-		// lets assign the view. Instead of getting the view directly
-		// using CCView::create( 'path/to/view' ) we get the view from the
-		// theme this allows us to have a diffrent sign_in for every theme.
-		// If the view does not exist in the theme it will load the view from 
-		// the default view folder.
-		$this->view = $this->theme->view( 'auth/sign_in.view' );
-		
-		$this->view->last_identifier = CCIn::post( 'identifier' );
-		
-		// By checking the HTTP method we figure out if this is a post request or not.
-		if ( CCIn::method( 'post' ) )
-		{
-			// Validate the data and get the user object.
-			// We use the key "identifier" because you can configure on
-			// what fields  the user is able to login. You could add for example
-			// the username or the customer number etc.
-			if ( $user = CCAuth::validate( CCIn::post( 'identifier' ), CCIn::post( 'password' ) ) )
-			{
-				// sign in the user with the current session.
-				CCAuth::sign_in( $user );
-				
-				// flash a success message to the user that he has been
-				// logged in succesfully.
-				UI\Alert::flash( 'success', __( ':action.message.success' ) );
-				
-				// Redirect the user back to the url where he came from
-				// this will only work when the next get parameter is set.
-				return CCRedirect::next();
-			}
-			
-			// If we could not recive a user object the login data were clearly invalid.
-			UI\Alert::add( 'danger', __( ':action.message.invalid' ) );
-		}
-	}
-	
-	/**
-	 * Sign up action
-	 *
-	 * @return CCResponse
-	 */
-	public function action_sign_up() 
-	{
-		// When the user is already authenticated we redirect him home.
-		if ( CCAuth::valid() )
-		{
-			return CCRedirect::to( '/' );
-		}
-		
-		$this->theme->topic = __( ':action.topic' );
-		$this->view = $this->theme->view( 'auth/sign_up.view' );
-		
-		// create a new user object as data holder
-		$user = new User;
-		
-		// bind the newly created user object to our view
-		$this->view->bind( 'user', $user );
-		
-		if ( CCIn::method( 'post' ) )
-		{
-			// Lets assign the email and the password to our 
-			// user object using the stirct assign method wich 
-			// will ignore all other post values in the assing process.
-			$user->strict_assign( array( 'email', 'password' ), CCIn::all( 'post' ) );
-			
-			$validator = CCValidator::post();
-			
-			// assign the labels to the validator this way we get 
-			// correct translated error messages.
-			$validator->label( array(
-				'email' => __( 'model/user.label.email' ),
-				'password' => __( 'model/user.label.password' ),
-				'password_match' => __( 'model/user.label.password_match' )
-			));
-			
-			// does the user already exist
-			$validator->set( 'same_email', User::find( 'email', $user->email ) );
-			$validator->message( __(':action.message.email_in_use'), 'negative', 'same_email' );
-			
-			// validate the other fields
-			$validator->rules( 'email', 'required', 'email' );
-			$validator->rules( 'password', 'required', 'min:6' );
-			$validator->rules( 'password_match', 'required', 'match:password' );
-			
-			// when the data passes the validation
-			if ( $validator->success() )
-			{
-				// because the user input is correct we can now save the 
-				// object to the database and sign the user in.
-				$user->save();
-				
-				CCAuth::sign_in( $user );
-				
-				UI\Alert::flash( 'success', __( ':action.message.success' ) );
-				
-				return CCRedirect::to( '/' );
-			}
-			else
-			{
-				UI\Alert::add( 'danger', $validator->errors() );
-			}
-		}
-	}
-	
-	/**
-	 * Sign out action
-	 */
-	public function action_sign_out() 
-	{
-		if ( !CCSession::valid_fingerprint() )
-		{
-			return CCRedirect::to( '/' );
-		}
-		
-		CCAuth::sign_out(); return CCRedirect::to( '/' );
-	}
-}

+ 0 - 29
frameworks/PHP/clancats/app/controllers/ErrorController.php

@@ -1,29 +0,0 @@
-<?php 
-/**
- * ErrorController
- **
- * 
- * @package       CCFApplication
- * @author        Mario Döring <[email protected]>
- * @version       1.0.0
- * @copyright     2010 - 2014 ClanCats GmbH
- *
- */
-class ErrorController extends \CCController
-{
-	/**
-	 * Not found 404
-	 */
-	public function action_404() 
-	{
-		return CCResponse::create( CCView::create( 'Core::CCF/404' )->render(), 404 );
-	}
-	
-	/**
-	 * Server error 500
-	 */
-	public function action_500() 
-	{
-		return CCResponse::create( CCView::create( 'Core::CCF/500' )->render(), 500 );
-	}
-}

+ 0 - 34
frameworks/PHP/clancats/app/controllers/WelcomeController.php

@@ -1,34 +0,0 @@
-<?php
-/**
- * Welcome Controller
- ** 
- *
- * @package		ClanCatsFramework
- * @author		Mario Döring <[email protected]>
- * @version		2.0
- * @copyright 	2010 - 2014 ClanCats GmbH
- *
- */
-class WelcomeController extends CCViewController 
-{	
-	/**
-	 * The default theme
-	 * if you wish you can render this controller with a special theme
-	 *
-	 * @var string
-	 */
-	protected $_theme = null;
-	
-	/**
-	 * the index function is just "function <controller_name>Index() {}" 
-	 */
-	public function action_index() 
-	{
-		$this->theme->topic = "Willkommen";
-		
-		$this->view = $this->theme->view( 'welcome', array(
-			'runtime_name'	=> ClanCats::runtime( 'name' ),
-			'environment'	=> ClanCats::environment(),
-		));
-	}
-}

+ 0 - 10
frameworks/PHP/clancats/app/language/de-de/controller/auth.php

@@ -1,10 +0,0 @@
-<?php return array(
-	'sign_in.topic'	=> 'Einloggen',
-	'sign_in.message.invalid' => 'Der Benutzername und das Passwort stimmen nicht überein.',
-	'sign_in.message.success' => 'Willkommen zurück!',
-	
-	'sign_up.topic'	=> 'Registrieren',
-	'sign_up.submit'	=> 'Konto Erstellen',
-	'sign_up.message.email_in_use' => 'Diese E-Mail Adresse wird bereits verwendet.',
-	'sign_up.message.success' => 'Ihr Konto wurde erfolgreich erstellt.',
-);

+ 0 - 7
frameworks/PHP/clancats/app/language/de-de/model/user.php

@@ -1,7 +0,0 @@
-<?php return array(
-	'label.name' => 'Name',
-	'label.email' => 'Email',
-	'label.password' => 'Passwort',
-	'label.password_match' => 'Wiederholen',
-	'label.retain' => 'Eingeloggt bleiben',
-);

+ 0 - 10
frameworks/PHP/clancats/app/language/en-us/controller/auth.php

@@ -1,10 +0,0 @@
-<?php return array(
-	'sign_in.topic'	=> 'Sign In',
-	'sign_in.message.invalid' => 'Wrong email and password combination.',
-	'sign_in.message.success' => 'Welcome back!',
-	
-	'sign_up.topic'	=> 'Sign Up',
-	'sign_up.submit'	=> 'Create my account',
-	'sign_up.message.email_in_use' => 'This Email address is already in use.',
-	'sign_up.message.success' => 'Your account has been successfully created.',
-);

+ 0 - 7
frameworks/PHP/clancats/app/language/en-us/model/user.php

@@ -1,7 +0,0 @@
-<?php return array(
-	'label.name' => 'Name',
-	'label.email' => 'Email',
-	'label.password' => 'Password',
-	'label.password_match' => 'Repeat',
-	'label.retain' => 'Remember me',
-);

+ 0 - 18
frameworks/PHP/clancats/app/themes/Bootstrap/blueprint.json

@@ -1,18 +0,0 @@
-{
-	"name": "Twitter Bootstrap",
-	"version": "3.0.3",
-	"description": "Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.",
-	"homepage": "http://getbootstrap.com",
-	"keywords": [
-		"Twitter",
-		"Theme"
-	],
-	"license": "MIT",
-	"authors": [],
-	
-	"namespace": "Bootstrap",
-	
-	"wake": false,
-	"install": false,
-	"uninstall": false
-}

+ 0 - 81
frameworks/PHP/clancats/app/themes/Bootstrap/classes/Theme.php

@@ -1,81 +0,0 @@
-<?php namespace Bootstrap;
-/**
- * Bootstrap Theme
- ** 
- *
- * @package		BootstrapTheme
- * @author		Mario Döring <[email protected]>
- * @version		2.0
- * @copyright 	2010 - 2014 ClanCats GmbH
- *
- */
-class Theme extends \CCTheme
-{	
-	/**
-	 * the theme configuration
-	 *
-	 * @var CCConfig
-	 */
-	public static $config = null;
-	
-	/**
-	 * static theme init
-	 *
-	 * @return void
-	 */
-	public static function _init()
-	{
-		static::$config = \CCConfig::create( __NAMESPACE__.'::theme' );
-	}
-	
-	/**
-	 * Returns the current view namespace 
-	 * You need to implement this method in your theme subclass.
-	 *
-	 * @return string
-	 */
-	public static function view_namespace()
-	{
-		return __NAMESPACE__;	
-	}
-	
-	/**
-	 * This the current public namespace
-	 * By default its simply the PUBLICPATH/assets/<theme_namespace>
-	 * You need to implement this method in your theme subclass.
-	 *
-	 * @return string
-	 */
-	public static function public_namespace()
-	{
-		return "assets/".__NAMESPACE__.'/';
-	}
-	
-	/**
-	 * custom theme render stuff
-	 *
-	 * @param string		$file
-	 * @return string
-	 */
-	public function render( $file = null ) 
-	{
-		foreach( static::$config->default as $key => $value )
-		{
-			$this->set( $key, $value );
-		}
-		
-		// assign the topic to the title
-		if ( $this->has( 'topic' ) && $this->has( 'title' ) )
-		{
-			$this->title = sprintf( $this->get( 'title' ), $this->get( 'topic' ) );
-		}
-		
-		// add default assets
-		\CCAsset::add( 'js/jquery/jquery.js' );
-		\CCAsset::add( 'js/bootstrap.min.js', 'theme' );
-		\CCAsset::add( 'css/bootstrap.min.css', 'theme' );
-		\CCAsset::add( 'css/style.css', 'theme' );
-		
-		return parent::render( $file );
-	}
-}

+ 0 - 29
frameworks/PHP/clancats/app/themes/Bootstrap/config/theme.config.php

@@ -1,29 +0,0 @@
-<?php
-/**
- * CCFTheme default configuration
- */
-return array(
-    
-    'default' => array(
-        
-        /*
-         * the topic gets added to the title
-         */
-        'topic'     => 'no title',
-        
-        /*
-         * the html title template
-         */
-        'title'     => '%s | '.ClanCats::runtime( 'name' ),
-        
-        /*
-         * the default html description
-         */
-        'description'   => 'Change your default description under theme.config -> defatul.description.',
-        
-        /*
-         * sidebar ( if false full container gets used )
-         */
-        'sidebar'	=> false,
-    ), 
-);

+ 0 - 45
frameworks/PHP/clancats/app/themes/Bootstrap/views/layout.php

@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-	<meta charset="<?php echo ClanCats::$config->charset; ?>">
-	<meta name="viewport" content="width=device-width, initial-scale=1.0">
-	
-	<title><?php echo $title; ?></title>
-	<meta name="description" content="<?php echo $description; ?>">
-	
-	<!-- styling -->
-	<?php echo CCAsset::code( 'css', 'theme' ); ?>
-	<?php echo CCAsset::code( 'css' ); ?>
-
-	<!--[if lt IE 9]>
-	  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
-	  <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
-	<![endif]-->
-	
-	<!-- header scripts -->
-	<?php echo CCAsset::code( 'js', 'header' ); ?>
-  </head>
-  <body>
-	<div id="main-container" class="container">
-		<div>
-			<?php if ( $sidebar !== false ) : ?>
-			<div class="row">
-				<div class="col-md-3">
-					<?php echo $sidebar; ?>
-				</div>
-				<div class="col-md-9">
-					<?php echo $content; ?>
-				</div>
-			</div>
-			<?php else : ?>
-				<?php echo $content; ?>
-			<?php endif; ?>
-		</div>
-	</div>
-
-	<!-- footer scripts -->
-	<?php echo CCAsset::code( 'js', 'lib' ); ?>
-	<?php echo CCAsset::code( 'js', 'theme' ); ?>
-	<?php echo CCAsset::code( 'js' ); ?>
-  </body>
-</html>

+ 0 - 6
frameworks/PHP/clancats/app/views/welcome.php

@@ -1,6 +0,0 @@
-<h1>Wilkommen bei CCF 2.0</h1>
-<strong>Running: </strong><?php echo $runtime_name; ?>
-<br>
-<strong>Environment: </strong><?php echo $environment; ?>
-
-<hr>