<?php

defined('BASEPATH') or exit('No direct script access allowed');
require_widget_smarty("button", "button");
function smarty_block_cancel_button($params, $content = '', $template, &$repeat)
{
    if ($repeat) {
        return;
    }
    $breadscrums = get_breadscrums();
    if (count($breadscrums) > 1) {
        array_pop($breadscrums);
    }
    $url = array_pop($breadscrums);
    $params['tag'] = 'a';
    $params['href'] = site_url($url);
    $params['title'] = $url;
    return pinet_smarty_create_button($params, $content);
}
<?php

defined('BASEPATH') or exit('No direct script access allowed');
require_widget_smarty("state", "container");
function smarty_block_toolbar($params, $content = '', $template, &$repeat)
{
    if ($repeat) {
        // This is the start part
        add_container($params, $template, 'toolbar');
        return;
    }
    $params['id'] = get_default($params, 'id', 'toolbar');
    $classes = get_default($params, 'class', array());
    if (is_string($classes)) {
        $classes = explode(' ', $classes);
    }
    $classes[] = 'toolbar';
    $classes[] = 'pinet-toolbar';
    $params['class'] = implode(' ', $classes);
    return build_tag('div', $params, $content);
}
<?php

defined("BASEPATH") or exit("No direct script access allowed");
require_widget_smarty('image', 'picture');
function smarty_function_action($params, $template)
{
    $action = get_default($params, 'obj', null);
    $alt = get_default($params, 'alt', '');
    if ($action == null) {
        trigger_error('The obj parameter is required for action!');
        return '';
    }
    if (gettype($action) != 'object' || get_class($action) != 'Action') {
        trigger_error('The obj parameter must be of Class Action!');
        return '';
    }
    $fields = json_decode($action->fields);
    ci_log('The action to show is', $action);
    $data = array();
    $uri = $action->uri();
    if ($uri) {
        $data['href'] = $uri;
    }
    $content = lang($action->label);
    if (isset($action->logo) && $action->logo != '') {
        $data = array('src' => $action->logo, 'path' => '/responsive/size', 'data-placement' => isset($fields->placement) ? $fields->placement : 'right', 'data-original-title' => $action->label);
        $auto = get_default($params, 'auto', true);
        if ($auto) {
            $data["data-toggle"] = "tooltip";
        }
        $CI =& get_instance();