public function handle_hook($hook_name) { if ($hook_name == 'top_menu_end' && module_config::c('timer_enabled', 1) && module_security::is_logged_in() && self::can_i('view', 'Task Timer') && get_display_mode() != 'mobile') { ?> <li id="timer_menu_button"> <div id="timer_menu_options"> <div class="timer_title"> <?php _e('Active Timers'); ?> </div> <ul id="active_timer_list"> </ul> </div> <a href="#" onclick="return false;" title="<?php _e('Timer'); ?> "><span><?php _e('Timers'); ?> <span class="menu_label" id="current_timer_count">1</span></span></a> </li> <?php } }
function init() { $this->links = array(); $this->module_name = "job_discussion"; $this->module_position = 17.1; //17 is job $this->version = 2.149; // 2.1 - initial // 2.11 - date change // 2.12 - better linking and auto open // 2.13 - possible bug fix in discussion saving // 2.14 - bug fixing. // 2.141 - bug fix for IE. // 2.142 - send email to staff option (as well as customer) // 2.143 - 2013-07-29 - new _UCM_SECRET hash in config.php // 2.144 - 2013-12-06 - javascript for for new jquery // 2.145 - 2014-03-17 - make discussion button stand out a bit more ( job_discussion_button_label ) // 2.146 - 2014-03-18 - fix for disabling job discussion plugin // 2.147 - 2014-05-27 - email discussions to multiple customer contacts // 2.148 - 2015-01-08 - AdminLTE modal popup discussions (thanks 3wCorner!) // 2.149 - 2015-01-10 - job discussion bug fix if (self::is_plugin_enabled()) { module_config::register_css('job_discussion', 'job_discussion.css'); module_config::register_js('job_discussion', 'job_discussion.js'); //if(self::can_i('view','Job Discussions')){ if (get_display_mode() != 'mobile') { hook_add('job_task_after', 'module_job_discussion::hook_job_task_after'); } } if (class_exists('module_template', false)) { module_template::init_template('job_discussion_email_customer', 'Dear {CUSTOMER_NAME},<br> <br> A new comment has been added to a task in your job: {JOB_NAME}.<br><br> Task: {TASK_NAME} <br/><br/> Note: {NOTE}<br/><br/> You can view this job and the comments online by <a href="{JOB_URL}">clicking here</a>.<br><br> Thank you,<br><br> {FROM_NAME} ', 'New Job Comment: {JOB_NAME}', array('CUSTOMER_NAME' => 'Customers Name', 'JOB_NAME' => 'Job Name', 'FROM_NAME' => 'Your name', 'JOB_URL' => 'Link to job for customer', 'TASK_NAME' => 'name of the task the note was added to', 'NOTE' => 'Copy of the note')); module_template::init_template('job_discussion_email_staff', 'Dear {STAFF_NAME},<br> <br> A new comment has been added to a task in your job: {JOB_NAME}.<br><br> Task: {TASK_NAME} <br/><br/> Note: {NOTE}<br/><br/> You can view this job and the comments online by <a href="{JOB_URL}">clicking here</a>.<br><br> Thank you,<br><br> {FROM_NAME} ', 'New Comment on your Job: {JOB_NAME}', array('STAFF_NAME' => 'Staff Name', 'JOB_NAME' => 'Job Name', 'FROM_NAME' => 'Your name', 'JOB_URL' => 'Link to job for staff member', 'TASK_NAME' => 'name of the task the note was added to', 'NOTE' => 'Copy of the note')); } }
public static function enable_pagination_hook($sort_data = array()) { if (get_display_mode() != 'mobile') { foreach ($sort_data['sortable'] as $column_id => $options) { if (isset($options['extra_sort']) && $options['extra_sort'] && $options['owner_table']) { // find all the visible extra fields for this item and add sorting buttons to them. $defaults = module_extra::get_defaults($options['owner_table']); $column_headers = array(); foreach ($defaults as $default) { if (isset($default['display_type']) && $default['display_type'] == _EXTRA_DISPLAY_TYPE_COLUMN) { $column_headers[$default['key']] = $default; } } unset($sort_data['sortable'][$column_id]); foreach ($column_headers as $column_header) { $sort_data['sortable']['extra_header_' . $column_header['extra_default_id']] = array('extra_sort' => true, 'field' => $column_header['key'], 'default_field_id' => $column_header['extra_default_id'], 'owner_table' => $options['owner_table'], 'owner_id' => $options['owner_id'], 'field_type' => isset($column_header['field_type']) ? $column_header['field_type'] : false); } } } self::$table_sort_options = $sort_data; } }
function init() { $this->links = array(); $this->module_name = "mobile"; $this->module_position = 8882; $this->version = 2.241; // 2.2 - started with custom mobile themed files. in conjunction with recent theme plugin update. // 2.22 - added ticket layout // 2.221 - ticket layout fix. // 2.222 - some mobile fixes // 2.223 - horizontal scrolling // 2.224 - better horizontal scrolling // 2.225 - fixing for invoice layout // 2.226 - large page memory limit fix // 2.227 - some mobile layout fixes // 2.228 - new version of jQuery + jQuery Mobile // 2.229 - mobile bug fix // 2.23 - mobile layout improvements // 2.24 - mobile_enabled option, use this to disable built in mobile layout // 2.241 - 2013-07-29 - fix for missing "add" buttons if (get_display_mode() == 'mobile') { module_config::register_css('mobile', 'mobile.css'); } }
public static function import_link($options = array()) { $m = get_display_mode(); if ($m == 'mobile' || $m == 'iframe') { return false; } if (module_config::c('import_method', 1)) { ?> <form action="<?php echo link_generate(array(array('page' => 'import', 'module' => 'import_export'))); ?> " method="post" style="display:none;" id="import_form"><input type="submit" name="buttongo" value="go"><input type="hidden" name="import_options" value='<?php echo module_config::c('import_export_base64', 1) ? base64_encode(json_encode($options)) : addcslashes(json_encode($options), "'"); ?> '></form> <?php $url = 'javascript:document.forms.import_form.submit();'; } else { //oldway: $url = link_generate(array(array('arguments' => array('import_options' => base64_encode(json_encode($options))), 'page' => 'import', 'module' => 'import_export'))); } return $url; }
//} $field_data = unserialize($field['data_field_settings']); echo $field_data['title'] . ','; } } ?> </td> </tr> </tbody> </table> <?php } $module->page_title = htmlspecialchars($data_type['data_type_name']); if (!isset($embed_form)) { if (get_display_mode() != 'iframe') { print_heading(array('main' => true, 'type' => 'h2', 'title' => htmlspecialchars($data_type['data_type_name']))); } ?> <form action="" method="post" class="validate" enctype="multipart/form-data"> <?php if (!$view_revision_id) { ?> <input type="hidden" name="form_id" value="<?php echo $GLOBALS['form_id']; ?> "> <input type="hidden" name="_process" value="save_data_record"/> <input type="hidden" name="_redirect" value="<?php echo $module->link("", array("saved" => true, "data_type_id" => $data_type_id, "data_record_id" => $data_record_id)); ?>
if (module_data::can_i('edit', _MODULE_DATA_NAME)) { $header_buttons[] = array('url' => $module->link_open_data_type($data_type['data_type_id']), 'title' => 'Settings'); } if ($module->can_i('create', $data_type['data_type_name'])) { // todo: perms for each data type $header_buttons[] = array('url' => $module->link('', array('data_type_id' => $data_type['data_type_id'], 'data_record_id' => 'new', 'mode' => 'edit', 'parent_data_record_id' => isset($parent_data_record_id) ? $parent_data_record_id : false)), 'title' => "Create New " . htmlspecialchars($data_type['data_type_name'])); } if ($allow_search) { $header_buttons[] = array('url' => $module->link("", array('search_form' => 1, 'data_type_id' => $data_type_id, 'view_all' => isset($_REQUEST['view_all']) ? 1 : false)), 'title' => "Search"); } if (_DEMO_MODE) { ?> <div style="padding:20px; text-align: center">This is a demo of the new Custom Data Forms feature. <?php if (module_data::can_i('edit', _MODULE_DATA_NAME)) { ?> Please feel free to change the <a href="<?php echo $module->link_open_data_type($data_type['data_type_id']); ?> ">Settings</a> for this Custom Data Form. <?php } ?> More details are <a href="http://ultimateclientmanager.com/support/documentation-wiki/custom-data-forms/" target="_blank">located here in the Documentation</a>. </div> <?php } print_heading(array('main' => isset($parent_data_record_id) && $parent_data_record_id ? false : true, 'type' => 'h2', 'title' => get_display_mode() == 'iframe' ? '' : htmlspecialchars($data_type['data_type_name']), 'button' => $header_buttons)); include 'admin_data_list_output.php'; }
public function render($type = 'html', $options = array()) { ob_start(); switch ($type) { case 'pretty_html': // header and footer so plain contnet can be rendered nicely. $display_mode = get_display_mode(); // addition - woah! we pass this through to the template module for re-rending again: ob_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>{PAGE_TITLE}</title> {FAVICON} {AUTOMATIC_STYLES} {AUTOMATIC_SCRIPTS} <style type="text/css"> body{ margin:0; } </style> </head> <body> <div class="pretty_content_wrap"> {CONTENT} </div> </body> </html> <?php /*$c = $this->replace_content(); if(!$this->wysiwyg){ //$c = nl2br($c); } echo $c;*/ module_template::init_template('external_template', ob_get_clean(), 'Used when displaying the external content such as "External Jobs" and "External Invoices" and "External Tickets".', 'code', array('CONTENT' => 'The inner content', 'PAGE_TITLE' => 'in the <title> tag', 'FAVICON' => 'if the theme specifies a favicon it will be here', 'AUTOMATIC_STYLES' => 'system generated stylesheets', 'AUTOMATIC_SCRIPTS' => 'system generated javascripts')); ob_start(); ?> <link rel="stylesheet" href="<?php echo _BASE_HREF; ?> css/desktop.css" type="text/css"> <link rel="stylesheet" href="<?php echo _BASE_HREF; ?> css/print.css" type="text/css" media="print"> <link rel="stylesheet" href="<?php echo _BASE_HREF; ?> css/styles.css" type="text/css"> <link type="text/css" href="<?php echo _BASE_HREF; ?> css/smoothness/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" /> <?php module_config::print_css(); ?> <?php $css = ob_get_clean(); ob_start(); ?> <script type="text/javascript" src="<?php echo _BASE_HREF; ?> js/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="<?php echo _BASE_HREF; ?> js/jquery-ui-1.9.2.custom.min.js"></script> <script type="text/javascript" src="<?php echo _BASE_HREF; ?> js/timepicker.js"></script> <script type="text/javascript" src="<?php echo _BASE_HREF; ?> js/cookie.js"></script> <script type="text/javascript" src="<?php echo _BASE_HREF; ?> js/javascript.js?ver=2"></script> <?php module_config::print_js(); ?> <?php $scripts = ob_get_clean(); $external_template = self::get_template_by_key('external_template'); $external_template->assign_values(array('CONTENT' => $this->replace_content(), 'PAGE_TITLE' => $this->page_title ? $this->page_title : module_config::s('admin_system_name'), 'FAVICON' => module_theme::get_config('theme_favicon', '') ? '<link rel="icon" href="' . htmlspecialchars(module_theme::get_config('theme_favicon', '')) . '">' : '', 'AUTOMATIC_STYLES' => $css, 'AUTOMATIC_SCRIPTS' => $scripts)); echo $external_template->render('raw'); break; case 'html': default: $c = $this->replace_content(); if ($this->wysiwyg) { //$c = nl2br($c); } echo $c; break; } return ob_get_clean(); }
//header('Expires: Tue, 04 Sep 2012 05:32:29 GMT'); $debug_info[] = array('time' => microtime(true), 'title' => 'Including init.php', 'mem' => function_exists('memory_get_usage') ? round(memory_get_usage() / 1048576, 4) : ''); require_once 'init.php'; if (_DEBUG_MODE) { module_debug::log(array('title' => 'including init.php done')); } $required_php_version = '5.3.0'; if (version_compare(PHP_VERSION, $required_php_version) < 0) { $setup_errors = true; echo "PHP version of 5.3 or above is REQUIRED to run this software - the current PHP version is: " . PHP_VERSION . ". Please contact the web hosting provider and request a PHP version upgrade."; } if (!_UCM_INSTALLED) { $_REQUEST['m'] = 'setup'; $_REQUEST['display_mode'] = 'normal'; } $display_mode = get_display_mode(); // stop more than 1 of the same page load. $loaded_pages = array(); $current_menu_level = 0; // increases each time we load a menu on the page. // this is an update for design_menu.php $menu_modules = $load_modules; $menu_module_index = count($menu_modules); $page_unique_id = ''; // used for styling. $required_php_version = '5.3.0'; if (version_compare(PHP_VERSION, $required_php_version) < 0) { echo "I'm sorry, a PHP version of {$required_php_version} or above is REQUIRED to run this - the current PHP version is: " . PHP_VERSION . ". Please ask the web hosting provider to upgrade you."; } try { foreach ($load_modules as $load_module_key => $load_module) {
function process_pagination($rows, $per_page = 20, $page_number = 0, $table_id = 'table') { $data = array(); $data['rows'] = array(); $data['links'] = ''; if ($per_page !== false && $per_page <= 0) { $per_page = 20; } hook_handle_callback('pagination_hook_init'); if (isset($GLOBALS['pagination_group_hack'])) { module_group::run_pagination_hook($rows); } if (isset($GLOBALS['pagination_import_export_hack'])) { module_import_export::run_pagination_hook($rows); } if (class_exists('module_table_sort', false)) { module_table_sort::run_pagination_hook($rows, $per_page); } $db_resource = false; if (is_resource($rows)) { // have the db handle for the sql query $db_resource = $rows; unset($rows); $total = mysql_num_rows($db_resource); } else { if (is_array($rows)) { // we have the rows in an array. $total = count($rows); } else { print_header_message(); echo 'Pagination failed. Please try going to Settings > Update and click the Manual Update button. If that does not fix this error please report this bug.'; exit; } } // pagination hooks ob_start(); if ($total > 0) { // group hack addition hook_handle_callback('pagination_hook_display'); if (isset($GLOBALS['pagination_group_hack']) && module_group::groups_enabled()) { module_group::display_pagination_hook(); } if (get_display_mode() != 'mobile') { // export hack addition if (isset($GLOBALS['pagination_import_export_hack'])) { module_import_export::display_pagination_hook(); } if (class_exists('module_table_sort', false)) { module_table_sort::display_pagination_hook($per_page); } } } $pagination_hooks = ob_get_clean(); // default summary/links content ob_start(); echo '<div class="pagination_summary"><p>'; if ($total > 0) { _e('Showing records %s to %s of %s', $page_number * $per_page + 1, $total, $total); echo $pagination_hooks; } else { _e('No results found'); } echo '</p></div>'; $data['summary'] = ob_get_clean(); ob_start(); echo '<div class="pagination_links">'; //echo "\n<p>"; echo _l('Page %s of %s', 1, 1); //echo '</p>'; echo '</div>'; $data['links'] = ob_get_clean(); $data['page_numbers'] = 1; if ($per_page === false || $total <= $per_page) { if ($db_resource) { $rows = array(); //if($per_page !== false && $total<=$per_page){ // pull out all records. while ($row = mysql_fetch_assoc($db_resource)) { $rows[] = $row; } if (mysql_num_rows($db_resource) > 0) { mysql_data_seek($db_resource, 0); } //} } $data['rows'] = $rows; } else { if (isset($_REQUEST['pg' . $table_id])) { $page_number = $_REQUEST['pg' . $table_id]; } if ($table_id && $table_id != 'table' && $total > $per_page) { // we remember the last page number we were on. if (!isset($_SESSION['_table_page_num'])) { $_SESSION['_table_page_num'] = array(); } if (!isset($_SESSION['_table_page_num'][$table_id])) { $_SESSION['_table_page_num'][$table_id] = array('total_count' => 0, 'page_number' => 0); } $_SESSION['_table_page_num'][$table_id]['total_count'] = $total; if (isset($_REQUEST['pg' . $table_id])) { $page_number = $_REQUEST['pg' . $table_id]; } else { if ($_SESSION['_table_page_num'][$table_id]['total_count'] == $total) { $page_number = $_SESSION['_table_page_num'][$table_id]['page_number']; } } $_SESSION['_table_page_num'][$table_id]['page_number'] = $page_number; //echo $table_id.' '.$total . ' '.$per_page.' '.$page_number; print_r($_SESSION['_table_page_num']); } $page_number = min(ceil($total / $per_page) - 1, $page_number); // slice up the result into the number of rows requested. if ($db_resource) { // do the the mysql way: mysql_data_seek($db_resource, $page_number * $per_page); $x = 0; while ($x < $per_page) { $row_data = mysql_fetch_assoc($db_resource); if ($row_data) { $data['rows'][] = $row_data; } $x++; } unset($row_data); } else { // the old array way. $data['rows'] = array_slice($rows, $page_number * $per_page, $per_page); } $data['summary'] = ''; $data['links'] = ''; $request_uri = preg_replace('/[&?]pg' . preg_quote($table_id) . '=\\d+/', '', $_SERVER['REQUEST_URI']); $request_uri .= preg_match('/\\?/', $request_uri) ? '&' : '?'; $request_uri = htmlspecialchars($request_uri); if (count($data['rows'])) { $page_count = ceil($total / $per_page); // group into ranges with cute little .... around the numbers if there's too many. $rangestart = max(0, $page_number - 5); $rangeend = min($page_count - 1, $page_number + 5); ob_start(); echo '<div class="pagination_summary">'; echo '<p>'; _e('Showing records %s to %s of %s', $page_number * $per_page + 1, $page_number * $per_page + count($data['rows']), $total); //echo 'Showing records ' . (($page_number*$per_page)+1) . ' to ' . (($page_number*$per_page)+count($data['rows'])) .' of ' . $total . '</p>'; echo $pagination_hooks; echo '</p>'; echo '</div>'; $data['summary'] = ob_get_clean(); ob_start(); echo '<div class="pagination_links">'; //echo "\n<p>"; echo '<span>'; if ($page_number > 0) { ?> <a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =<?php echo $page_number - 1; ?> #t_<?php echo $table_id; ?> " rel="<?php echo $page_number - 1; ?> "><?php _e('« Prev'); ?> </a> | <?php } else { ?> <?php _e('« Prev'); ?> | <?php } echo '</span>'; if ($rangestart > 0) { ?> <span><a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =0#t_<?php echo $table_id; ?> " rel="0" class="">1</a></span> <?php if ($rangestart > 1) { echo ' ... '; } } for ($x = $rangestart; $x <= $rangeend; $x++) { if ($x == $page_number) { ?> <span><a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =<?php echo $x; ?> #t_<?php echo $table_id; ?> " rel="<?php echo $x; ?> " class="current"><?php echo $x + 1; ?> </a></span> <?php } else { ?> <span><a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =<?php echo $x; ?> #t_<?php echo $table_id; ?> " rel="<?php echo $x; ?> " class=""><?php echo $x + 1; ?> </a></span> <?php } } if ($rangeend < $page_count - 1) { if ($rangeend < $page_count - 2) { echo ' ... '; } ?> <span><a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =<?php echo $page_count - 1; ?> #t_<?php echo $table_id; ?> " rel="<?php echo $page_count - 1; ?> " class=""><?php echo $page_count; ?> </a></span> <?php } if ($page_number < $page_count - 1) { ?> | <span><a href="<?php echo $request_uri; ?> pg<?php echo $table_id; ?> =<?php echo $page_number + 1; ?> #t_<?php echo $table_id; ?> " rel="<?php echo $page_number + 1; ?> "><?php _e('Next »'); ?> </a></span> <?php } else { ?> | <span><?php _e('Next »'); ?> </span> <?php } //echo '</p>'; echo '</div>'; ?> <script type="text/javascript"> $(function(){ $('.pagination_links a').each(function(){ // make the links post the search bar on pagination. $(this).click(function(){ // see if there's a search bar to post. var search_form = false; search_form = $('.search_form')[0]; $('.search_bar').each(function(){ var form = $(this).parents('form'); if(typeof form != 'undefined'){ search_form = form; } }); if(typeof search_form == 'object'){ $(search_form).append('<input type="hidden" name="pg<?php echo $table_id; ?> " value="'+$(this).attr('rel')+'">'); search_form = search_form[0]; if(typeof search_form.submit == 'function'){ search_form.submit(); }else{ $('[name=submit]',search_form).click(); } return false; } }); }); }); </script> <?php $data['links'] = ob_get_clean(); $data['page_numbers'] = $page_count; } } return $data; }
public static function generate_form_element($setting) { if (isset($setting['ignore']) && $setting['ignore']) { return; } // type defaults if ($setting['type'] == 'currency') { $setting['class'] = (isset($setting['class']) ? $setting['class'] . ' ' : '') . 'currency'; } if ($setting['type'] == 'date') { $setting['class'] = (isset($setting['class']) ? $setting['class'] . ' ' : '') . 'date_field'; $setting['type'] = 'text'; } if ($setting['type'] == 'time') { $setting['class'] = (isset($setting['class']) ? $setting['class'] . ' ' : '') . 'time_field'; $setting['type'] = 'text'; } if ($setting['type'] == 'select' || $setting['type'] == 'wysiwyg') { if (!isset($setting['id']) || !$setting['id']) { $setting['id'] = $setting['name']; } } if ($setting['type'] == 'save_button') { $setting['type'] = 'submit'; $setting['class'] = (isset($setting['class']) ? $setting['class'] . ' ' : '') . 'submit_button save_button'; } if ($setting['type'] == 'delete_button') { $setting['type'] = 'submit'; $setting['class'] = (isset($setting['class']) ? $setting['class'] . ' ' : '') . 'submit_button delete_button'; } if (isset($setting['label']) && (!isset($setting['id']) || !$setting['id'])) { // labels need ids $setting['id'] = md5($setting['name']); } $attributes = ''; foreach (array('size', 'style', 'autocomplete', 'placeholder', 'class', 'id', 'onclick') as $attr) { if (isset($setting[$attr])) { $attributes .= ' ' . $attr . '="' . $setting[$attr] . '"'; } } if (!isset($setting['value'])) { $setting['value'] = ''; } ob_start(); // handle multiple options $loop_count = 1; if (isset($setting['multiple']) && $setting['multiple']) { // has to have at least 1 value if ($setting['multiple'] === true) { // create our wrapper id. $multiple_id = md5(serialize($setting)); echo '<div id="' . $multiple_id . '">'; } else { $multiple_id = $setting['multiple']; } if (!isset($setting['values'])) { $setting['values'] = array($setting['value']); } $loop_count = count($setting['values']); } for ($x = 0; $x < $loop_count; $x++) { if (isset($setting['multiple']) && $setting['multiple']) { $setting['value'] = isset($setting['values'][$x]) ? $setting['values'][$x] : false; echo '<div class="dynamic_block">'; } switch ($setting['type']) { case 'currency': echo currency('<input type="text" name="' . $setting['name'] . '" value="' . htmlspecialchars($setting['value']) . '"' . $attributes . '>', true, isset($setting['currency_id']) ? $setting['currency_id'] : false); break; case 'number': ?> <input type="number" name="<?php echo $setting['name']; ?> " value="<?php echo htmlspecialchars($setting['value']); ?> "<?php echo $attributes; ?> > <?php break; case 'text': ?> <input type="text" name="<?php echo $setting['name']; ?> " value="<?php echo htmlspecialchars($setting['value']); ?> "<?php echo $attributes; ?> > <?php break; case 'password': ?> <input type="password" name="<?php echo $setting['name']; ?> " value="<?php echo htmlspecialchars($setting['value']); ?> "<?php echo $attributes; ?> > <?php break; case 'hidden': ?> <input type="hidden" name="<?php echo $setting['name']; ?> " value="<?php echo htmlspecialchars($setting['value']); ?> "<?php echo $attributes; ?> > <?php break; case 'textarea': ?> <textarea name="<?php echo $setting['name']; ?> " rows="6" cols="50"<?php echo $attributes; ?> ><?php echo htmlspecialchars($setting['value']); ?> </textarea> <?php break; case 'wysiwyg': self::load_wysiwyg(); ?> <?php if (!isset($setting['options']) || !isset($setting['options']['inline']) || $setting['options']['inline']) { ?> <div style="border:1px solid #EFEFEF;" data-name="<?php echo $setting['name']; ?> " <?php echo $attributes; ?> ><?php echo module_security::purify_html($setting['value']); ?> </div> <?php if ($setting['name'] != $setting['id']) { ?> <!-- we update this on change, needed because tinymce jquery has issues with name[] form elements --> <input type="hidden" name="<?php echo $setting['name']; ?> " id="<?php echo $setting['id']; ?> _postback" value="<?php echo htmlspecialchars(module_security::purify_html($setting['value'])); ?> "> <?php } ?> <?php } else { ?> <textarea name="<?php echo $setting['name']; ?> " rows="6" cols="50"<?php echo $attributes; ?> ><?php echo htmlspecialchars($setting['value']); ?> </textarea> <?php } ?> <script type="text/javascript"> $(function() { $('#<?php echo $setting['id']; ?> ').tinymce({ // Location of TinyMCE script <?php if (!isset($setting['options']) || !isset($setting['options']['inline']) || $setting['options']['inline']) { ?> inline: true, <?php } ?> script_url : '<?php echo _BASE_HREF; ?> includes/plugin_form/js/tinymce4.0.11/tinymce.min.js', relative_urls : false, convert_urls : false, // General options theme : "modern", statusbar: false, /*plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",*/ plugins: [ "advlist autolink autoresize link image lists charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "table directionality emoticons template textcolor paste textcolor" ], toolbar1: "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | formatselect fontselect fontsizeselect", toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor", toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | visualchars visualblocks nonbreaking", menubar: false, toolbar_items_size: 'small', width : '100%', browser_spellcheck: true, contextmenu: false, setup : function(ed) { ed.on("init", function() { if(typeof tinymce_focus != 'undefined'){ $(ed.getDoc()).contents().find('body').focus(function(){tinymce_focus();}); } if(typeof tinymce_blur != 'undefined'){ $(ed.getDoc()).contents().find('body').blur(function(){tinymce_blur();}); } }); <?php if (!isset($setting['options']) || !isset($setting['options']['inline']) || $setting['options']['inline']) { if ($setting['name'] != $setting['id']) { ?> ed.on("change", function() { $('#<?php echo $setting['id']; ?> _postback').val(ed.getContent()); }); <?php } } ?> } }); }); </script> <?php break; case 'select': // copied from print_select_box() if (isset($setting['allow_new']) && $setting['allow_new']) { $attributes .= ' onchange="dynamic_select_box(this);"'; } ?> <select name="<?php echo $setting['name']; ?> "<?php echo $attributes; ?> > <?php if (!isset($setting['blank']) || $setting['blank']) { ?> <option value=""><?php echo !isset($setting['blank']) || $setting['blank'] === true ? _l('- Select -') : htmlspecialchars($setting['blank']); ?> </option> <?php } $found_selected = false; $current_val = 'Enter new value here'; $sel = ''; foreach ($setting['options'] as $key => $val) { if (is_array($val)) { if (!$setting['options_array_id']) { if (isset($val[$setting['id']])) { $setting['options_array_id'] = $setting['id']; } else { $setting['options_array_id'] = key($val); } } $printval = $val[$setting['options_array_id']]; } else { $printval = $val; } if (strlen($printval) == 0) { continue; } $sel .= '<option value="' . htmlspecialchars($key) . '"'; // to handle 0 elements: if ($setting['value'] !== false && $setting['value'] !== '' && $key == $setting['value']) { $current_val = $printval; $sel .= ' selected'; $found_selected = true; } $sel .= '>' . htmlspecialchars($printval) . '</option>'; } if ($setting['value'] && !$found_selected) { $sel .= '<option value="' . htmlspecialchars($setting['value']) . '" selected>' . htmlspecialchars($setting['value']) . '</option>'; } if (isset($setting['allow_new']) && $setting['allow_new'] && get_display_mode() != 'mobile') { $sel .= '<option value="create_new_item">' . _l(' - Create New - ') . '</option>'; } if (isset($setting['allow_new']) && $setting['allow_new']) { //$sel .= '<input type="text" name="new_'.$id.'" style="display:none;" value="'.$current_val.'">'; } echo $sel; ?> <?php /*foreach($setting['options'] as $key=>$val){ ?> <option value="<?php echo $key;?>"<?php echo $setting['value'] == $key ? ' selected':'' ?>><?php echo htmlspecialchars($val);?></option> <?php }*/ ?> </select> <?php break; case 'checkbox': ?> <input type="hidden" name="default_<?php echo $setting['name']; ?> " value="1"> <input type="checkbox" name="<?php echo $setting['name']; ?> " value="1" <?php if ($setting['value']) { echo ' checked'; } echo $attributes; ?> > <?php break; case 'check': ?> <input type="checkbox" name="<?php echo $setting['name']; ?> " value="<?php echo $setting['value']; ?> " <?php if ($setting['checked']) { echo ' checked'; } echo $attributes; ?> > <?php break; case 'submit': ?> <input type="submit" name="<?php echo htmlspecialchars($setting['name']); ?> " value="<?php echo htmlspecialchars($setting['value']); ?> " <?php echo $attributes; ?> /> <?php break; case 'button': ?> <input type="button" name="<?php echo htmlspecialchars($setting['name']); ?> " value="<?php echo htmlspecialchars($setting['value']); ?> " <?php echo $attributes; ?> /> <?php break; case 'html': ?> <div<?php echo $attributes; ?> ><?php echo $setting['value']; ?> </div> <?php break; } if (isset($setting['multiple']) && $setting['multiple']) { echo '<a href="#" class="add_addit" onclick="return seladd(this);">+</a> <a href="#" class="remove_addit" onclick="return selrem(this);">-</a>'; echo '</div>'; } } if (isset($setting['multiple']) && $setting['multiple']) { if ($setting['multiple'] === true) { echo '</div>'; } echo '<script type="text/javascript"> set_add_del("' . $multiple_id . '"); </script>'; } $html = ob_get_clean(); if (isset($setting['encrypt']) && $setting['encrypt'] && class_exists('module_encrypt', false)) { $html = module_encrypt::parse_html_input($setting['page_name'], $html); } echo $html; if (isset($setting['label']) && strlen($setting['label'])) { echo '<label for="' . htmlspecialchars($setting['id']) . '">' . _l($setting['label']) . '</label>'; } if (isset($setting['help']) && (count($setting['help']) || strlen($setting['help']))) { _h($setting['help']); } }
function adminlte_print_heading($callback, $options) { if (!is_array($options)) { $options = array('type' => 'h2', 'title' => $options); } $buttons = array(); if (isset($options['button']) && is_array($options['button']) && count($options['button'])) { $buttons = $options['button']; if (isset($buttons['url'])) { $buttons = array($buttons); } } if (!isset($options['type'])) { $options['type'] = 'h2'; } if (isset($options['main']) && $options['main']) { //} || !isset($GLOBALS['adminlte_main_title']) || !$GLOBALS['adminlte_main_title']){ // save this one for use in the main header area of the theme ob_start(); if (isset($options['icon_name']) && $options['icon_name']) { ?> <i class="fa fa-<?php echo $options['icon_name']; ?> "></i> <?php } ?> <div class="header_buttons"> <?php foreach ($buttons as $button) { ?> <a href="<?php echo $button['url']; ?> " class="btn btn-adminlte-5 btn-success btn-sm<?php echo isset($button['class']) ? ' ' . $button['class'] : ''; ?> "<?php if (isset($button['id'])) { echo ' id="' . $button['id'] . '"'; } if (isset($button['onclick'])) { echo ' onclick="' . $button['onclick'] . '"'; } ?> > <?php if (isset($button['type']) && $button['type'] == 'add') { ?> <img src="<?php echo _BASE_HREF; ?> images/add.png" width="10" height="10" alt="add" border="0" /> <?php } ?> <span><?php echo _l($button['title']); ?> </span> </a> <?php } ?> <?php if (isset($options['help'])) { ?> <span class="button"> <?php _h($options['help']); ?> </span> <?php } ?> </div> <?php if (get_display_mode() == 'iframe') { ?> <h3 class="title"> <?php echo isset($options['title_final']) ? $options['title_final'] : _l($options['title']); ?> </h3> <?php } else { ?> <span class="title"> <?php echo isset($options['title_final']) ? $options['title_final'] : _l($options['title']); ?> </span> <?php } $GLOBALS['adminlte_main_title'] = ob_get_clean(); if (get_display_mode() == 'iframe') { echo $GLOBALS['adminlte_main_title']; } } else { ?> <<?php echo $options['type']; ?> class="<?php echo isset($options['class']) ? $options['class'] : ''; ?> "> <?php foreach ($buttons as $button) { ?> <span class="button"> <a href="<?php echo $button['url']; ?> " class="btn btn-default btn-xs<?php echo isset($button['class']) ? ' ' . $button['class'] : ''; ?> "<?php if (isset($button['id'])) { echo ' id="' . $button['id'] . '"'; } if (isset($button['onclick'])) { echo ' onclick="' . $button['onclick'] . '"'; } ?> > <?php if (isset($button['type']) && $button['type'] == 'add') { ?> <img src="<?php echo _BASE_HREF; ?> images/add.png" width="10" height="10" alt="add" border="0" /> <?php } ?> <span><?php echo _l($button['title']); ?> </span> </a> </span> <?php } ?> <?php if (isset($options['help'])) { ?> <span class="button"> <?php _h($options['help']); ?> </span> <?php } ?> <?php if (isset($options['responsive']) && is_array($options['responsive']) && isset($options['responsive']['summary'])) { ?> <span class="button responsive-toggle-button"> <a href="#" class="btn btn-default btn-xs no_permissions"><span class="responsive-hidden fa fa-plus-square"></span><span class="responsive-shown fa fa-minus-square"></span> </a> </span> <?php } ?> <?php if (isset($options['responsive']) && is_array($options['responsive']) && isset($options['responsive']['title'])) { ?> <span class="title has-responsive"> <span class="main-title"><?php echo isset($options['title_final']) ? $options['title_final'] : _l($options['title']); ?> </span> <span class="responsive-title"> <?php _e($options['responsive']['title']); ?> </span> </span> <?php } else { ?> <span class="title"> <?php echo isset($options['title_final']) ? $options['title_final'] : _l($options['title']); ?> </span> <?php } ?> <?php if (isset($options['responsive']) && is_array($options['responsive']) && isset($options['responsive']['summary'])) { ?> <span class="responsive-summary"><?php echo $options['responsive']['summary']; ?> </span> <?php } ?> </<?php echo $options['type']; ?> > <?php } return true; }
if (module_config::c('invoice_list_show_totals', 1)) { $footer_rows = array(); foreach ($invoice_total + $invoice_total_due as $currency_id => $foo) { $currency = get_single('currency', 'currency_id', $currency_id); $footer_rows[] = array('invoice_number' => array('data' => '<strong>' . _l('%s Totals:', $currency && isset($currency['code']) ? $currency['code'] : '') . '</strong>', 'cell_colspan' => $colspan - 2, 'cell_class' => 'text-right'), 'c_invoice_total' => array('data' => '<strong>' . dollar(isset($invoice_total[$currency_id]) ? $invoice_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'c_invoice_total_due' => array('data' => '<strong>' . dollar(isset($invoice_total_due[$currency_id]) ? $invoice_total_due[$currency_id] : 0, true, $currency_id) . '</strong>'), 'row_bulk_action' => array('data' => ' ', 'cell_colspan' => $colspan2)); } $table_manager->set_footer_rows($footer_rows); } $table_manager->pagination = true; $table_manager->print_table(); ?> </form> <?php if (function_exists('convert_html2pdf') && get_display_mode() != 'mobile') { ?> <form action="<?php echo module_invoice::link_generate(false, array('arguments' => array('print' => 1))); ?> " method="post"> <input type="hidden" name="invoice_ids" value="<?php echo implode(",", $all_invoice_ids); ?> "> <input type="submit" name="butt_print" value="<?php echo _l('Export all results as PDF'); ?> " class="submit_button" /> </form>
function link_generate($link_options) { $link = $link_text = ''; $full_link = false; $args = array(); $m = 0; if (!_REWRITE_LINKS) { $link .= strpos($link, '?') !== false ? '&' : '?'; } if (get_display_mode() == 'iframe') { $args['display_mode'] = 'iframe'; } foreach ($link_options as $link_option) { if (!is_array($link_option)) { continue; } if (_REWRITE_LINKS) { $link .= '/'; $link .= isset($link_option['module']) ? $link_option['module'] : ''; $link .= '.'; $link .= isset($link_option['page']) ? $link_option['page'] : ''; } else { $link .= 'm[' . $m . ']='; $link .= isset($link_option['module']) ? $link_option['module'] : ''; $link .= '&p[' . $m . ']='; $link .= isset($link_option['page']) ? $link_option['page'] : ''; $link .= '&'; } if (isset($link_option['text'])) { $link_text = $link_option['text']; } if (isset($link_option['full']) && $link_option['full']) { $full_link = true; } if (isset($link_option['arguments']) && is_array($link_option['arguments'])) { foreach ($link_option['arguments'] as $key => $val) { $args[$key] = $val; } } $m++; } $link = rtrim($link, '&'); $link = full_link($link); $argcc = 0; foreach ($args as $key => $val) { if ($val === false) { continue; } $link .= (strpos($link, '?') !== false ? '&' : '?') . "{$key}={$val}"; } if ($full_link) { $link = '<a href="' . $link . '"'; if (isset($link_options['class'])) { $link .= ' class="' . $link_options['class'] . '"'; } $link_text = $link_text ? $link_text : 'N/A'; if (!isset($link_options['raw'])) { $link_text = htmlspecialchars($link_text); } $link .= '>' . $link_text . '</a>'; } return $link; }
public static function include_ucm($include_page) { // what folder do we search for? // custom/includes/plugin_mobile/custom_layout/theme/$theme_name/$page // custom/includes/plugin_mobile/custom_layout/$page // custom/theme/$theme_name/$page // custom/$page // includes/plugin_mobile/custom_layout/theme/$theme_name/$page // includes/plugin_mobile/custom_layout/$page // theme/$theme_name/$page // $page // sanatise $page. $display_mode = get_display_mode(); $check_files = array(); $current_theme = basename(self::$current_theme); if (strlen($current_theme) > 2 && is_dir('includes/plugin_theme/themes/' . $current_theme . '/')) { // we have an active theme! } else { $current_theme = false; } // build up our file listing. if ($display_mode == 'mobile') { $check_files[] = 'custom/' . dirname($include_page) . '/mobile/' . basename($include_page); } $check_files[] = 'custom/' . $include_page; if ($display_mode == 'mobile') { //$check_files[] = 'includes/plugin_mobile/custom_layout/'.$page; $check_files[] = dirname($include_page) . '/mobile/' . basename($include_page); } if (self::$current_theme_settings && isset(self::$current_theme_settings['base_dir']) && strlen(self::$current_theme_settings['base_dir']) > 2 && is_dir(self::$current_theme_settings['base_dir'])) { // we have an active theme! $check_files[] = self::$current_theme_settings['base_dir'] . $include_page; } $check_files[] = $include_page; foreach ($check_files as $file) { module_debug::log(array('title' => 'IncludeUCM', 'file' => 'includes/plugin_theme/theme.php', 'data' => "Checking for include file: " . $file)); if (is_file($file)) { module_debug::log(array('title' => 'IncludeUCM', 'file' => 'includes/plugin_theme/theme.php', 'data' => "FOUND FILE! " . $file)); return $file; } } module_debug::log(array('title' => 'IncludeUCM', 'file' => 'includes/plugin_theme/theme.php', 'data' => "Warning: File not found " . $include_page)); return $include_page; // as a defult, wont ever get here. }
* Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (module_config::c('dashboard_income_summary', 1) && $this->can_i('view', 'Dashboard Finance Summary')) { $done_js = false; // todo: work out what data this current customer can view. $widgets = array(); $week_count = 1; $result = module_finance::get_dashboard_data(); foreach ($result as $r) { extract($r); ob_start(); if (!$done_js) { $done_js = true; if (get_display_mode() != 'mobile') { ?> <script type="text/javascript"> $(function() { $("#summary-form").dialog({ autoOpen: false, height: 550, width: 750, modal: true, buttons: { '<?php _e('Close'); ?> ': function() { $(this).dialog('close'); }
public static function display_files($options) { $owner_id = isset($options['owner_id']) && $options['owner_id'] ? (int) $options['owner_id'] : false; $owner_table = isset($options['owner_table']) && $options['owner_table'] ? $options['owner_table'] : false; if ($owner_id && $owner_table) { // we have all that we need to display some files!! yey!! // do we display a summary or not? global $plugins; $file_items = $plugins['file']->get_files(array('owner_table' => $owner_table, 'owner_id' => $owner_id)); if (isset($options['summary_owners']) && is_array($options['summary_owners'])) { // generate a list of other files we have to display int eh list. foreach ($options['summary_owners'] as $summary_owner_table => $summary_owner_ids) { if (is_array($summary_owner_ids)) { foreach ($summary_owner_ids as $summary_owner_id) { $file_items = array_merge($file_items, $plugins['file']->get_files(array('owner_table' => $summary_owner_table, 'owner_id' => $summary_owner_id))); } } } } $layout_type = isset($options['layout']) && $options['layout'] ? $options['layout'] : 'gallery'; $editable = !isset($options['editable']) || $options['editable']; foreach ($file_items as &$file_item) { $file_item['html'] = $plugins['file']->print_file($file_item['file_id'], $layout_type, $editable, $options); } if (get_display_mode() == 'mobile') { $editable = false; } $title = isset($options['title']) && $options['title'] ? $options['title'] : false; if (!@(include 'pages/file_list_' . basename($layout_type) . '.php')) { include "pages/file_list.php"; } } }
public static function groups_enabled() { return get_display_mode() != 'mobile'; }
public static function display_notes($options) { $owner_table = isset($options['owner_table']) && $options['owner_table'] ? $options['owner_table'] : false; global $plugins; // permission checking. $can_create = $can_edit = $can_view = $can_delete = true; if ($options && isset($options['bypass_security'])) { // do nothing? } else { if (isset($options) && isset($options['owner_table']) && $options['owner_table'] && isset($options['title']) && $options['title']) { $can_view = $plugins[$options['owner_table']]->can_i('view', $options['title']); $can_edit = $plugins[$options['owner_table']]->can_i('edit', $options['title']); $can_create = $plugins[$options['owner_table']]->can_i('create', $options['title']); $can_delete = $plugins[$options['owner_table']]->can_i('delete', $options['title']); } } /*if(!module_security::is_page_editable()){ $can_edit=$can_create=$can_delete=false; }*/ if (!$can_view) { return ''; } // display links in a popup? $popup_links = get_display_mode() != 'mobile'; // disable popups in mobile version. $owner_id = isset($options['owner_id']) && $options['owner_id'] ? (int) $options['owner_id'] : false; if ($owner_id && $owner_table) { // we have all that we need to display some notes!! yey!! // do we display a summary or not? $note_items = self::get_notes(array('owner_table' => $owner_table, 'owner_id' => $owner_id)); $display_summary = isset($options['display_summary']) && $options['display_summary']; if (isset($options['summary_owners']) && is_array($options['summary_owners'])) { // generate a list of other notes we have to display int eh list. foreach ($options['summary_owners'] as $summary_owner_table => $summary_owner_ids) { if (is_array($summary_owner_ids) && count($summary_owner_ids) > 0) { //$sql = "SELECT *, note_id AS id FROM `"._DB_PREFIX."note` n WHERE owner_table = '".mysql_real_escape_string($summary_owner_table)."' AND ( "; $sql = "SELECT *, note_id AS id FROM `" . _DB_PREFIX . "note` n WHERE n.`owner_table` = '" . mysql_real_escape_string($summary_owner_table) . "' AND n.`owner_id` IN ( "; /*foreach($summary_owner_ids as $summary_owner_id){ //$note_items = array_merge($note_items,self::get_notes(array('owner_table'=>$summary_owner_table,'owner_id'=>$summary_owner_id))); $sql .= " `owner_id` = '".(int)$summary_owner_id."' OR "; } $sql = rtrim($sql,'OR ');*/ foreach ($summary_owner_ids as $k => $summary_owner_id) { $summary_owner_ids[$k] = (int) $summary_owner_id; } $sql .= implode(',', $summary_owner_ids); $sql .= " )"; $note_items = array_merge($note_items, qa($sql)); } } } // moved to 'note_list.php' /*foreach($note_items as $key=>$note_item){ $note_items[$key]['html'] = self::print_note($note_item['note_id'],$note_item,$display_summary,$can_edit,$can_delete,$options); }*/ uasort($note_items, 'sort_notes'); if (isset($options['view_link'])) { $blah = parse_url($options['view_link']); if ($blah && isset($blah['path']) && isset($blah['query'])) { $options['view_link'] = $blah['path'] . '?' . $blah['query']; } $rel_data = $options['view_link']; } $note_list_safe = true; include "pages/note_list.php"; } }
if ($note_id > 0) { $note = module_note::get_note($note_id); $owner_table = $note['owner_table']; $owner_id = $note['owner_id']; if ($can_delete && isset($options['do_delete']) && $options['do_delete'] == 'yes' && isset($options['note_id']) && $options['note_id']) { module_note::note_delete($owner_table, $owner_id, $options['note_id']); set_message('Note deleted successfully'); redirect_browser($note['rel_data']); } } else { $owner_table = isset($options['owner_table']) ? $options['owner_table'] : (isset($_REQUEST['owner_table']) ? htmlspecialchars($_REQUEST['owner_table']) : ''); $owner_id = isset($options['owner_id']) ? $options['owner_id'] : (isset($_REQUEST['owner_id']) ? htmlspecialchars($_REQUEST['owner_id']) : ''); $note = array("note_time" => time(), "note" => '', "reminder" => '', "user_id" => '', 'rel_data' => isset($rel_data) ? serialize($rel_data) : '', 'public' => 0); } $note_edit_safe = true; if (get_display_mode() != 'ajax') { print_heading('Note'); //print_r($options); if (isset($options['view_link'])) { $note['rel_data'] = $options['view_link']; } ?> <form action="<?php // copied from the ajax version echo $plugins['note']->link('note_edit', array('_process' => 'save_note', 'owner_table' => $owner_table, 'owner_id' => $owner_id, 'note_id' => $note_id)); ?> " method="post"> <input type="hidden" name="options" value="<?php echo base64_encode(serialize($options)); ?> ">