<?php defined('BASEPATH') or exit('No direct script access allowed'); // view.php Chris Dart Mar 17, 2015 2:45:59 PM chrisdart@cerebratorium.com if (!isset($inline_edit)) { $inline_edit = FALSE; } ?> <div> <?php $buttons[] = array("text" => "Edit", "href" => site_url("asset/edit/{$asset->id}"), "class" => array("edit", "dialog"), "style" => "edit"); if ($this->ion_auth->in_group(1)) { $buttons[] = array("text" => "Delete", "href" => site_url("asset/delete"), "id" => sprintf("delete-asset_%s", $asset->id), "class" => array("asset-delete", "delete", implode(" ", get_button_style("delete")))); } if (!$is_inline) { echo create_button_bar($buttons); } ?> <h4 class='asset-header' id='asset-header_<?php echo $asset->id; ?> '> <a href="<?php echo site_url("asset/view/{$asset->id}"); ?> " id='<?php echo $asset->id; ?> '> <?php
?> " /> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label no-wrap" for="po">Purchase Order</label> <div class="col-sm-8"> <input type="text" class="form-control" id="po" name="po" size="5" value="<?php echo get_value($asset, "po"); ?> " /> </div> </div> <div class="form-group"> <input type="hidden" name="ajax" id="ajax" value="1" /> <div class="col-sm-offset-4 col-sm-8"> <input type="submit" class="form-control <?php echo $action; ?> <?php echo implode(" ", get_button_style($action)); ?> " value="<?php echo ucfirst($action); ?> " /> </div> </div> </form>
* http://www.gnu.org/licenses/gpl-3.0.txt */ /** * Return the list of shortcode and their settings * * @package Yithemes * @author Francesco Licandro <*****@*****.**> * @since 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly include( $this->plugin_path.'/functions.php'); $button_style = get_button_style(); $awesome_icons = YIT_Plugin_Common::get_awesome_icons(); $awesome_icons_socials = YIT_Plugin_Common::get_awesome_icons_socials(); $null = array( '' =>__('None', 'yit') ); $awesome_icons_with_null = array_merge($null, $awesome_icons); $categories = yit_get_categories( true ); $set_icons = get_set_icons(); $animate = yit_get_animate_effects(); $icon_list = array ( 'theme-icon' => __('Theme Icon', 'yit'), 'custom' => __('Custom Icon', 'yit') ); return array(
/** * * @param array $data * @return string boolean array * required: * "text" key for the button text * optional: * "item" is not used here but is used by the create_button_bar script. * this should be improved in a later version so it just focuses on * either the class or id * "tag" defaults to "a" but can be "div" "span" or other tag if the * type=>"pass-through" then it just returns the "text" as-is without * any further processing * "href" defaults to "#" is only used if "type" is "a" (default) * "class" defaults to "button" but can be replaced by any other classes * as defined in the css or javascript * "id" is completely optional * "enclosure" is an option array with type class and id keys. This is * used if the particular button needs an added container (for AJAX * manipulation) * * EXAMPLES * A button that provides a standard url (type and class are defaults * "a" and "button"); * $data = array( "text" => "View Record", "href" => * "/index.php/record/view/2352"); * returns: <a href="/index.php/record/view/2352" class="button">View * Record</a> * * A button that triggers a jquery script by class with an id that is * parsed by the jQuery to parse for a relevant database table key: * $data = array( "text" => "Edit Record", "type" => "span", "class" => * "button edit-record" "id" => "er_2532" ); * returns <span class="button edit-record" id="er_2532">Edit * Record</span> * * A Button that needs a surrounding span for jQuery mainpulation: * $data = array( "text" => "Edit Record", "type" => "span", "class" => * "button edit-record" "id" => "er_2532", * "enclosure" => array("type" => "span", "id" => "edit-record-span" ) * ); * returns:<span id="edit-record-span"><span class="button edit-record" * id="er_2532">Edit Record</span></span> * */ function create_button($data) { if (array_key_exists("text", $data)) { $tag = "a"; $href = ""; $title = ""; $target = ""; $style = ""; $text = $data["text"]; if (array_key_exists("tag", $data)) { if (isset($data["tag"])) { $tag = $data["tag"]; } } else { if (array_key_exists("href", $data)) { $href = "href='" . $data["href"] . "'"; } else { $href = "href='#'"; } } if (array_key_exists("target", $data)) { $target = "target='" . $data["target"] . "'"; } if (array_key_exists("title", $data)) { $title = "title ='" . $data["title"] . "'"; } if ($tag != "pass-through") { if (array_key_exists("class", $data)) { if (!is_array($data["class"])) { $data["class"] = explode(" ", $data["class"]); } } else { $data["class"] = array(); } if (array_key_exists("style", $data)) { $data["class"] = array_merge(get_button_style($data["style"]), $data["class"]); $text = $text . add_fa_icon($data["style"]); } if (array_key_exists("selection", $data) && preg_match("/" . str_replace("/", "\\/", $data["selection"]) . "/", $_SERVER['REQUEST_URI'])) { $data["class"][] = "active"; } $class = sprintf("class='%s'", implode(" ", $data["class"])); $id = ""; if (array_key_exists("id", $data)) { $id = "id='" . $data["id"] . "'"; } $button = "<{$tag} {$href} {$id} {$class} {$target} {$title}>{$text}</{$tag}>"; if (array_key_exists("enclosure", $data)) { if (array_key_exists("tag", $data["enclosure"])) { $enc_tag = $data["enclosure"]["tag"]; $enc_class = ""; $enc_id = ""; if (array_key_exists("class", $data["enclosure"])) { $enc_class = "class='" . $data["enclosure"]["class"] . "'"; } if (array_key_exists("id", $data["enclosure"])) { $enc_id = "id='" . $data["enclosure"]["id"] . "'"; } $button = "<{$enc_tag} {$enc_class} {$enc_id}>{$button}</{$enc_tag}>"; } } } else { return $data["text"]; } return $button; } else { return FALSE; } }