Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
Admin theme update
  • Loading branch information
havok89 committed Jul 2, 2016
1 parent 86c4ecd commit efa292e
Show file tree
Hide file tree
Showing 50 changed files with 2,497 additions and 5,712 deletions.
27 changes: 16 additions & 11 deletions hoosk/hoosk0/controllers/admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ function __construct()
{
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->helper('admincontrol');
$this->load->helper('url');
$this->load->helper(array('admincontrol', 'url', 'hoosk_admin'));
$this->load->library('session');
$this->load->model('Hoosk_model');
define ('LANG', $this->Hoosk_model->getLang());
Expand Down Expand Up @@ -138,13 +137,20 @@ public function updateSettings()
public function uploadLogo()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
if($_FILES[0]['type']=='image/png' || $_FILES[0]['type']=='image/jpg' || $_FILES[0]['type']=='image/jpeg')
{
move_uploaded_file($_FILES[0]['tmp_name'], 'uploads/' .basename($_FILES[0]['name']));
echo json_encode(basename($_FILES[0]['name']));
}
else {
echo 0;
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';

$this->load->library('upload', $config);
foreach ($_FILES as $key => $value) {
if ( ! $this->upload->do_upload($key))
{
$error = array('error' => $this->upload->display_errors());
echo 0;
}
else
{
echo '"'.$this->upload->data('file_name').'"';
}
}
}

Expand All @@ -167,5 +173,4 @@ public function updateSocial()
$this->Hoosk_model->updateSocial();
redirect('/admin', 'refresh');
}
}

}
20 changes: 10 additions & 10 deletions hoosk/hoosk0/controllers/admin/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ function __construct()
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->model('Hoosk_model');
$this->load->helper('url');
$this->load->helper('file');
$this->load->helper('admincontrol');
$this->load->helper(array('admincontrol', 'url', 'file'));
$this->load->library('session');
define ('LANG', $this->Hoosk_model->getLang());
$this->lang->load('admin', LANG);
Expand Down Expand Up @@ -110,16 +108,18 @@ public function edited()
}




public function delete()
function delete()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
//Delete the category account
$this->Hoosk_model->removeCategory($this->uri->segment(5));
//Return to category list
redirect('/admin/posts/categories', 'refresh');
if($this->input->post('deleteid')):
$this->Hoosk_model->removeCategory($this->input->post('deleteid'));
redirect('/admin/posts/categories');
else:
$this->data['form']=$this->Hoosk_model->getCategory($this->uri->segment(5));
$this->load->view('admin/deletecategory.php', $this->data );
endif;
}



}
18 changes: 10 additions & 8 deletions hoosk/hoosk0/controllers/admin/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function __construct()
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->model('Hoosk_model');
$this->load->helper('url');
$this->load->helper('admincontrol');
$this->load->helper(array('admincontrol', 'url'));
$this->load->library('session');
define ('LANG', $this->Hoosk_model->getLang());
$this->lang->load('admin', LANG);
Expand Down Expand Up @@ -118,13 +117,16 @@ public function update()
}
}

public function deleteNav()

function deleteNav()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
//Delete the nav
$this->Hoosk_model->removeNav($this->uri->segment(4));
//Return to user list
redirect('/admin/navigation', 'refresh');
if($this->input->post('deleteid')):
$this->Hoosk_model->removeNav($this->input->post('deleteid'));
redirect('/admin/navigation');
else:
$this->data['form']=$this->Hoosk_model->getNav($this->uri->segment(4));
$this->load->view('admin/deletenav.php', $this->data );
endif;
}

}
21 changes: 11 additions & 10 deletions hoosk/hoosk0/controllers/admin/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ function __construct()
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->model('Hoosk_model');
$this->load->helper('url');
$this->load->helper('file');
$this->load->helper('admincontrol');
$this->load->helper(array('admincontrol', 'url', 'hoosk_admin', 'file'));
$this->load->library('session');
define ('LANG', $this->Hoosk_model->getLang());
$this->lang->load('admin', LANG);
Expand Down Expand Up @@ -140,15 +138,18 @@ public function jumboAdd()
redirect('/admin/pages', 'refresh');
}

public function delete()


function delete()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
//Delete the page account
$this->Hoosk_model->removePage($this->uri->segment(4));
//Return to page list
redirect('/admin/pages', 'refresh');
if($this->input->post('deleteid')):
$this->Hoosk_model->removePage($this->input->post('deleteid'));
redirect('/admin/pages');
else:
$this->data['form']=$this->Hoosk_model->getPage($this->uri->segment(4));
$this->load->view('admin/deletepage.php', $this->data );
endif;
}



}
22 changes: 10 additions & 12 deletions hoosk/hoosk0/controllers/admin/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ function __construct()
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->model('Hoosk_model');
$this->load->helper('url');
$this->load->helper('file');
$this->load->helper('admincontrol');
$this->load->helper(array('admincontrol', 'url', 'hoosk_admin', 'file'));
$this->load->library('session');
define ('LANG', $this->Hoosk_model->getLang());
$this->lang->load('admin', LANG);
Expand Down Expand Up @@ -128,17 +126,17 @@ public function edited()
}
}



public function delete()

function delete()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
//Delete the post account
$this->Hoosk_model->removePost($this->uri->segment(4));
//Return to post list
redirect('/admin/posts', 'refresh');
if($this->input->post('deleteid')):
$this->Hoosk_model->removePost($this->input->post('deleteid'));
redirect('/admin/posts');
else:
$this->data['form']=$this->Hoosk_model->getPost($this->uri->segment(4));
$this->load->view('admin/deletepost.php', $this->data );
endif;
}



}
19 changes: 10 additions & 9 deletions hoosk/hoosk0/controllers/admin/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function __construct()
parent::__construct();
define("HOOSK_ADMIN",1);
$this->load->model('Hoosk_model');
$this->load->helper('url');
$this->load->helper('admincontrol');
$this->load->helper(array('admincontrol', 'url'));
$this->load->library('session');
define ('LANG', $this->Hoosk_model->getLang());
$this->lang->load('admin', LANG);
Expand Down Expand Up @@ -112,18 +111,20 @@ public function edited()
redirect('/admin/users', 'refresh');
}
}


public function delete()
function delete()
{
Admincontrol_helper::is_logged_in($this->session->userdata('userName'));
//Delete the user account
$this->Hoosk_model->removeUser($this->uri->segment(4));
//Return to user list
redirect('/admin/users', 'refresh');
if($this->input->post('deleteid')):
$this->Hoosk_model->removeUser($this->input->post('deleteid'));
redirect('/admin/users');
else:
$this->data['form']=$this->Hoosk_model->getUser($this->uri->segment(4));
$this->load->view('admin/deleteuser.php', $this->data );
endif;
}



/************** Forgotten Password Resets **************/

public function forgot()
Expand Down
11 changes: 10 additions & 1 deletion hoosk/hoosk0/helpers/hoosk_page_helper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php


function wordlimit($string, $length = 40, $ellipsis = "...")
{
$string = strip_tags($string, '<div>');
$string = strip_tags($string, '<p>');
$words = explode(' ', $string);
if (count($words) > $length)
return implode(' ', array_slice($words, 0, $length)) . $ellipsis;
else
return $string.$ellipsis;
}

//Get the navigation bar
function hooskNav($slug)
Expand Down
6 changes: 3 additions & 3 deletions hoosk/hoosk0/language/english/admin_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@


//Dashboard
$lang['dash_welcome'] = "Welcome to Hoosk";
$lang['dash_welcome'] = "Welcome <small>to Hoosk</small>";
$lang['dash_recent'] = "Recently Updated Pages";
$lang['dash_message'] = "This is your Hoosk dashboard, Using the navigation above you can add or edit the users, pages or navigation menus on your website. Hoosk is built around the bootstrap framework, this should make your website fully responsive with ease.";
$lang['dash_message'] = "This is your Hoosk dashboard, Using the navigation bar you can add or edit the users, pages or navigation menus on your website. Hoosk is built around the bootstrap framework, this should make your website fully responsive with ease.";



Expand Down Expand Up @@ -100,7 +100,7 @@
$lang['pages_jumbo_header'] = "Jumbotron Content";
$lang['pages_jumbo_header_att'] = "Jumbotron";
$lang['pages_jumbo_enable'] = "Enable Jumbotron?";

$lang['pages_jumbo_edit'] = "Edit Jumbotron";


//Posts - All Posts
Expand Down
66 changes: 27 additions & 39 deletions hoosk/hoosk0/views/admin/categories.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<?php echo $header; ?>

<div class="main">
<div class="main-inner">
<div class="container">
<div class="row">
<div class="span12">
<div class="widget widget-table action-table">
<div class="widget-header"> <i class="icon-edit"></i>
<h3><?php echo $this->lang->line('cat_header'); ?></h3>
</div>
<!-- /widget-header -->
<div class="widget-content">

<table class="table table-striped table-bordered">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
<?php echo $this->lang->line('cat_header'); ?>
</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-dashboard"></i>
<a href="/admin"><?php echo $this->lang->line('nav_dash'); ?></a>
</li>
<li class="active">
<i class="fa fa-fw fa-list"></i>
<a href="/admin/posts/categories"><?php echo $this->lang->line('cat_header'); ?></a>
</li>
</ol>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th> <?php echo $this->lang->line('cat_table_category'); ?> </th>
Expand All @@ -24,37 +33,16 @@
foreach ($categories as $c) {
echo '<tr>';
echo '<td>'.$c['categoryTitle'].'</td>';
echo '<td class="td-actions"><a href="/admin/posts/categories/edit/'.$c['categoryID'].'" class="btn btn-small btn-success"><i class="btn-icon-only icon-pencil"> </i></a><a data-toggle="modal" role="button" class="btn btn-danger btn-small" href="#dlt'.$c['categoryID'].'"><i class="btn-icon-only icon-remove"> </i></a></td>';
echo '<td class="td-actions"><a href="/admin/posts/categories/edit/'.$c['categoryID'].'" class="btn btn-small btn-success"><i class="fa fa-pencil"> </i></a> <a data-toggle="modal" data-target="#ajaxModal" class="btn btn-danger btn-small" href="'.BASE_URL.'/admin/posts/categories/delete/'.$c['categoryID'].'"><i class="fa fa-remove"></i></a></td>';
echo '</tr>';
} ?>
</tbody>
</table>
<?php echo $this->pagination->create_links(); ?>
<!-- /widget-content -->
<?php foreach ($categories as $c) {
echo '<div id="dlt'.$c['categoryID'].'" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
echo '<h3 id="myModalLabel">'.$this->lang->line('cat_delete').'"'.$c['categoryTitle'].'"?</h3>';
echo '</div><div class="modal-body">';
echo '<p>'.$this->lang->line('cat_delete_message').'</p>';
echo '</div>';
echo '<div class="modal-footer">';
echo '<button class="btn" data-dismiss="modal" aria-hidden="true">'.$this->lang->line('btn_cancel').'</button>';
echo '<a class="btn btn-danger" href="'.BASE_URL.'/admin/posts/categories/delete/'.$c['categoryID'].'">'.$this->lang->line('btn_delete').'</a>';
echo '</div></div>';
} ?>
</div>
</div>
<!-- /widget -->


</div>
<!-- /span12 -->

</div>
<!-- /colmd12 -->
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /main-inner -->
</div>
<?php echo $footer; ?>
<?php echo $footer; ?>
41 changes: 12 additions & 29 deletions hoosk/hoosk0/views/admin/check.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
<?php echo $header; ?>

<div class="main">
<div class="main-inner">
<div class="container">
<div class="row">
<div class="span12">
<div class="widget">
<div class="widget-header"> <i class="icon-user"></i>
<h3><?php echo $this->lang->line('forgot_reset'); ?></h3>
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<img src="<?php echo ADMIN_THEME; ?>/images/large_logo.png" class="login_logo" />
</div>
<div class="panel-body">
<h3><?php echo $this->lang->line('forgot_check_email'); ?></h3>
</div>
</div>
<!-- /widget-header -->
<div class="widget-content">
<p><?php echo $this->lang->line('forgot_check_email'); ?></p>

<!-- /widget-content -->
</div>
</div>
<!-- /widget -->


</div>
<!-- /span12 -->

</div>
<!-- /row -->
</div>
</div>
<!-- /container -->
</div>
<!-- /main-inner -->
</div>
<?php echo $footer; ?>
</div>
Loading

0 comments on commit efa292e

Please sign in to comment.