Example #1
0
	public function EditForm()
	{
		ob_start();
		echo "<table>";
		foreach( $this->keys as $key )
		{
			if ( is_object( $this->data[$key] ) )
			{
				echo $this->data[$key]->Mutator()->EditForm();
			}
			else
			{
				$arr["name"] = $key;
				$arr["text"] = ucfirst($key);
				$arr["value"] = $this->data[$key];
				$arr["uniq"] = "ce";
				$arr["action"] = "request.php?a=card_editor";
				View::Obj()->Component("form_field", $arr);
			}
		}
		echo "</table>";
		$r = ob_get_contents();
		ob_get_clean();
		return $r;
	}
Example #2
0
<?php

// Grab Cuber Tools
require_once("Tools/cuber.php");

if ( Auth::Obj()->Authenticated() )
{
	View::Obj()->Title("Cuber - Cube Management Software by Ryan Knuesel");
	View::Obj()->MainView("home");
}
else
{
	header("Location: /");
}

?>
Example #3
0
<?php

// ****
// ****
// Legacy Notice
// This file is conforms to a very bad design. The new one is much better,
// but this file is part of a component that is going to be scrapped anyway.
// For a better example, look at the Views/Components/cube/ folder.
// ****
// ****

View::Obj()->UseDataModel("set");
View::Obj()->Component("set_editor");

?>
Example #4
0
<?php

// ****
// ****
// Legacy Notice
// This file is conforms to a very bad design. The new one is much better,
// but this file is part of a component that is going to be scrapped anyway.
// For a better example, look at the Views/Components/cube/ folder.
// ****
// ****

View::Obj()->UseDataModel("card");
View::Obj()->Component("card_editor");

?>
Example #5
0
<?php 

// **
// * Content View
// * Describes the main container.
// **

// * Include the proper javascript file, cuber_e for cuber:dev,
// * cuber for cuber.
$dev    = App::Obj()->IsDev()? "_e":"";
$jsPath = "Views/js/cuber{$dev}.js";

?><!DOCTYPE html>
<html>
  <head>
  	<title><?php echo $title?$title:"Cuber by Ryan Knuesel";?></title>
  	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
  	
  	<link rel="stylesheet" type="text/css" href="Views/css/cuber.css" media="screen" />
  	<?php if (!App::Obj()->IsOffline()) { ?>
  	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
  	<?php } ?>
  	<script type="text/javascript" src="<?php echo $jsPath; ?>"></script>
  </head>
  <body>
  	
  	<?php View::Obj()->View($view->Get("view")); ?>
  	
  </body>
</html>
Example #6
0
<div id="content">
  <?php View::Obj()->Component("set"); ?>
  <?php View::Obj()->Component("card"); ?>
  <?php View::Obj()->Component("invite"); ?>
</div>
Example #7
0
<?php

// **
// * Card
// * Component
// * Hmm. Guess I have to draw a card.
// *
// * Author: Ryan Knuesel
// **

$image = "background-image:url('" . $view->Frame() . "');";
$text = $view->Text();
$id = $view->ID();

?>
<div class="cardRule" id="UNIQ_ID"
	onclick="4;"
	onmouseover="card_hover('#overlay_' + <?php echo $id; ?>, true);"
	onmouseout="card_hover('#overlay_' + <?php echo $id; ?>, false);"
	style="background-clip:border-box;<?php echo $image; ?>background-repeat:no-repeat;position:relative;">
  <div style="position: absolute; top: 7px; left: 10px;" class="cardText">
    <?php echo $view->Name(); ?>
  </div>
  <div style="position: absolute; top: 97px; left: 10px;text-align:left;width:90px;height:40px;overflow:scroll;" class="cardText">
    <?php echo $text; ?>
  </div>
  <?php View::Obj()->Component("card/overlay", $view); ?>
</div>
Example #8
0
if ( App::Obj()->UseFacebook() )
{
	if ( Auth::Obj()->Authenticated() )
	{
		header("Location: home.php");
	}
	else
	{
		Auth::Obj()->LogIn();
		if ( isset($_GET["code"]) )
		{
			View::Obj()->Title("Cuber - Cube Management Software by Ryan Knuesel");
			View::Obj()->MainView("invitation");
		}
		else
		{
			$fb = new Facebook(App::Obj()->FacebookSettings());
			$loginurl = $fb->getLoginUrl();
			header("Location: $loginurl");
		}
	}
}
// Dev environment
else
{
	// Display Cuber Homepage
	View::Obj()->Title("Cuber - Cube Management Software by Ryan Knuesel");
	View::Obj()->MainView("default");
}

?>
Example #9
0
	}
}
else
{
	try
	{
		
		if ( isset($_POST["user"]) )
		{
			if ( @$_POST["pass"] == @$_POST["pass2"] )
				User::Create($_POST);
		}
		
		if ( !Auth::Obj()->Authenticated() )
		{
			View::Obj()->Title("Cuber - Sign up!");
			View::Obj()->MainView("signup");
		}
		else
		{
			header("Location: welcome.php");
		}
	
	}
	catch( Exception $e )
	{
		View::Obj()->Exception($e);
	}
}

?>
Example #10
0
	public static function DrawAddCubeCell()
	{
		$r = new Record(
			array(
				"name" => "Add Cube",
				"count" => "Click here to make a new cube.",
				"id" => "new"
			)
		);
		View::Obj()->Component(Cube::$CELL_COMPONENT, $r);
	}
Example #11
0
<?php

// Grab Cuber Tools
require_once("Tools/cuber.php");

if ( Auth::Obj()->Authenticated() && Auth::Obj()->CanAccess(2) )
{
	View::Obj()->Title("Cuber Admin - Cube Management Software by Ryan Knuesel");
	View::Obj()->MainView("admin");
}
else
{
	header("Location: /");
}

?>
Example #12
0
<?php

$PathToRoot = "../..";
require "../../Tools/cuber.php";

View::Obj()->Component("cube/edit");

?>
Example #13
0
<?php

$PathToRoot = "../..";
require "../../Tools/cuber.php";

View::Obj()->Component("set/list");

?>
Example #14
0
<?php

$PathToRoot = "../..";
require "../../Tools/cuber.php";

View::Obj()->Component("set/select");

?>
Example #15
0
<?php

// ****
// ****
// Legacy Notice
// This file is conforms to a very bad design. The new one is much better,
// but this file is part of a component that is going to be scrapped anyway.
// For a better example, look at the Views/Components/cube/ folder.
// ****
// ****

View::Obj()->UseDataModel("cost");
View::Obj()->Component("cost_editor");

?>
Example #16
0
<?php

$PathToRoot = "../..";
require "../../Tools/cuber.php";

View::Obj()->Component("cube/select");

?>
Example #17
0
<?php

// **
// * Cube Edit
// * Component
// * Initially displays a grid that shows all the cards in the cube, and
// * after the cube enters edit mode, shows more components in a right
// * pane while this component shrinks onto a left side pane.
// *
// * Author: Ryan Knuesel
// **

$c = new Cube($_GET["cube"]);

?>

<?php View::Obj()->Component("cube/title", $c); ?>

<div id="cube_main_left" style="display:inline-block;width:97%;border:none;overflow-y:scroll;overflow-x:visible;">
  <?php
    foreach( $c->Cards() as $card )
    {
    	View::Obj()->Component("cube/entry", $card);
    }
  ?>
</div>
<div id="cube_main_right" style="display:none;border:none;vertical-align:top;margin-left:10px;">
  Put yo cube editor here. <?php // I did it for the lulz ?>
</div>
Example #18
0
<?php

$sets = Set::SetList();
foreach ( $sets as $set )
{
	View::Obj()->Component("set/cell", $set);
}

?>
Example #19
0
<?php

// Grab Cuber Tools
require_once("Tools/cuber.php");

if ( Auth::Obj()->Authenticated() )
{
	View::Obj()->Title("Cuber - Cube Management Software by Ryan Knuesel");
	View::Obj()->MainView("welcome");
}
else
{
	header("Location: /");
}

?>