Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Commit

Permalink
Created basic crud for Endpoints and Clients
Browse files Browse the repository at this point in the history
  • Loading branch information
inghamn committed Feb 27, 2012
1 parent aa5dd74 commit 45068a3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blocks/html/endpoints/updateForm.inc
Expand Up @@ -32,7 +32,7 @@ $title = $this->endpoint->getId() ? View::escape('Edit '.$this->endpoint->getNam
</tr>
</table>
<button type="submit" class="submit">Submit</button>
<a class="cancel button" href="<?php echo BASE_URI; ?>/endpoints">Cancel</a>
<a class="cancel" href="<?php echo BASE_URI; ?>/endpoints">Cancel</a>
</fieldset>
</form>
</div>
4 changes: 2 additions & 2 deletions controllers/EndpointsController.php
Expand Up @@ -19,7 +19,7 @@ public function index()
public function view()
{
$endpoint = $this->loadEndpoint($_GET['endpoint_id']);
$this->template->blocks[] = new Block('endpoints/info.inc');
$this->template->blocks[] = new Block('endpoints/info.inc',array('endpoint'=>$endpoint));
}

public function update()
Expand Down Expand Up @@ -51,7 +51,7 @@ public function update()
private function loadEndpoint($id)
{
try {
$endpoint = new Endpoint($id);
return new Endpoint($id);
}
catch (Exception $e) {
$_SESSION['errorMessages'][] = $e;
Expand Down
1 change: 1 addition & 0 deletions controllers/IndexController.php
Expand Up @@ -8,5 +8,6 @@ class IndexController extends Controller
{
public function index()
{
$this->template->blocks[] = new Block('open311/client.inc');
}
}
4 changes: 2 additions & 2 deletions models/Endpoint.php
Expand Up @@ -24,7 +24,7 @@ public function __construct($id=null)
$this->data = $result;
}
else {
throw new Exception('people/unknownPerson');
throw new Exception('endpoints/unknownEndpoint');
}
}
else {
Expand Down Expand Up @@ -88,7 +88,7 @@ public function set($post)
$fields = array('url','name','jurisdiction','api_key');
foreach ($fields as $field) {
if (isset($post)) {
$set = ucfirst($field);
$set = 'set'.ucfirst($field);
$this->$set($post[$field]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion public/skins/local/screen.css
Expand Up @@ -35,7 +35,7 @@ button, .button {
.edit, .change { background:url('images/pencil_button.png') left center no-repeat; }
.search { background:url('images/buttonBackground.png') left center no-repeat; padding-left:10px; }
.submit, .login { background:url('images/check_button.png') left center no-repeat; }
.delete, .cancel { background:url('images/x_button.png') left center no-repeat; }
.delete { background:url('images/x_button.png') left center no-repeat; }

/**
* Banner
Expand Down
1 change: 1 addition & 0 deletions templates/html/partials/panel-widgets/Admin.inc
Expand Up @@ -4,5 +4,6 @@
<li><a href="<?php echo BASE_URL; ?>/people">People</a></li>
<li><a href="<?php echo BASE_URL; ?>/users">User Accounts</a></li>
<li><a href="<?php echo BASE_URL; ?>/endpoints">Endpoints</a></li>
<li><a href="<?php echo BASE_URL; ?>/clients">Clients</a></li>
</ul>
</nav>

0 comments on commit 45068a3

Please sign in to comment.