Welcome Guest, Not a member yet? Register   Sign In
Tendoo CMS: Have you noticed the Google Graph API integration ?
#1

(This post was last modified: 12-07-2015, 05:12 AM by Blair2004.)

Hey,
we've working on tendoo and we're since testing out different thrid API such as Google Graph api, would you like to see it ?

Bang !!!

[Image: c95abfe9-3b32-46b9-a6b0-4949226e47b9.png]

Integrating this feature was pretty easy actually.

1. Integrating Google Graph API source Code

We'll first add Google Graph API source code at the header of the dashboard.

PHP Code:
class sample_plugin extends CI_Model
{
public function 
__construct()
 {
 
parent::__construct();
 
$this->events->add_action'dashboard_header', array( $this'header' ) );
 }
 public function 
header()
 {
 
?>
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
        <?php
 
}

new 
sample_plugin

From here it's done. Now let see how to create widget on Tendoo CMS.

2. Creating Widgets

This tutorial has already been written on "How to create Admin Widget". But we'll cover it again.

First, add widget within 'load_dashboard_home' hook like this.
PHP Code:
class sample_plugin extends CI_Model
{
 public function 
__construct()
 {
 
parent::__construct();
 
$this->events->add_action'load_dashboard_home', array( $this'init' ) );
 }
 
 public function init()
 
 {
 
   $this->dashboard_widgets->add'sales', array(
 
      'title' => __'Sales' ),
 
      'type' => 'box-primary',
 
      'position' => 1,
 
      'content' => $this->load->view'../modules/sample_plugin/views/widgets/graph.php', array(), true )
 
   ) );
 
 }
}
new 
sample_plugin

Dashboard_Widget::add accepts one parameter which is an array with required entries. "content" index should contain widget output. You can load a view file within you module directory.

3. Heu... that's all !!!

I told you that it was pretty easy right ? We're good then. All you have to do know is to play with Google Graph API, check it on Google.
NexoPOS 2.6.2 available on CodeCanyon.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB