/** * Show list of the style elements for the currently edited topic component * * @param string $handler_id Name of the used handler * @param mixed &$data Data passed to the show method */ public function _show_folders($handler_id, array &$data) { midgard_admin_asgard_plugin::asgard_header(); $data['group'] =& $this->_group; midcom_show_style('midcom-admin-user-group-folders'); midgard_admin_asgard_plugin::asgard_footer(); }
/** * Show list of the style elements for the currently createed topic component * * @param string $handler_id Name of the used handler * @param mixed &$data Data passed to the show method */ public function _show_create($handler_id, array &$data) { midgard_admin_asgard_plugin::asgard_header(); $data['person'] =& $this->_person; midcom_show_style('midcom-admin-user-person-create'); midgard_admin_asgard_plugin::asgard_footer(); }
/** * Shows the loaded object in editor. * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_edit($handler_id, array &$data) { midcom_show_style('midgard_admin_asgard_header'); midcom_show_style('midgard_admin_asgard_middle'); midcom_show_style('midgard_admin_asgard_object_parameters'); midcom_show_style('midgard_admin_asgard_footer'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_day($handler_id, array &$data) { midcom_show_style('show-day-header'); foreach ($this->_request_data['events'] as $event) { $this->_request_data['event'] = $event; midcom_show_style('show-day-item'); } midcom_show_style('show-day-footer'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_all($handler_id, array &$data) { midcom_show_style('show-all-header'); foreach ($this->_request_data['members_interviewed'] as $member) { $this->_request_data['person'] = new midcom_db_person($member->person); $this->_request_data['datamanager']->autoset_storage($member); midcom_show_style('show-all-item'); } midcom_show_style('show-all-footer'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_delete($handler_id, array &$data) { $this->_request_data['wikipage_view'] = $this->_datamanager->get_content_html(); // Replace wikiwords if (array_key_exists('content', $this->_request_data['wikipage_view'])) { $parser = new net_nemein_wiki_parser($this->_page); $this->_request_data['wikipage_view']['content'] = $parser->get_markdown($this->_request_data['wikipage_view']['content']); } midcom_show_style('view-wikipage-delete'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_today($handler_id, array &$data) { $siteconfig = org_openpsa_core_siteconfig::get_instance(); $data['calendar_url'] = $siteconfig->get_node_relative_url('org.openpsa.calendar'); $data['projects_url'] = $siteconfig->get_node_full_url('org.openpsa.projects'); $data['projects_relative_url'] = $siteconfig->get_node_relative_url('org.openpsa.projects'); $data['expenses_url'] = $siteconfig->get_node_full_url('org.openpsa.expenses'); $data['wiki_url'] = $siteconfig->get_node_relative_url('net.nemein.wiki'); $data_url = midcom::get()->get_host_name() . midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); $data['journal_url'] = $data_url . '/__mfa/org.openpsa.relatedto/journalentry/list/xml/'; midcom_show_style('show-today'); }
public static function get_help($data) { $help_element = null; if (!isset($data['object']) || !$data['object']->id) { return; } if (midcom::get('dbfactory')->is_a($data['object'], 'midgard_style')) { $help_element = midgard_admin_asgard_objecthelper::get_help_style($data); } if (midcom::get('dbfactory')->is_a($data['object'], 'midgard_element')) { $help_element = midgard_admin_asgard_objecthelper::get_help_element($data); } if ($help_element) { midcom_show_style('midgard_admin_asgard_objecthelper_' . $help_element); } }
/** * Show list of the style elements for the currently edited topic component * * @param string $handler_id Name of the used handler * @param mixed &$data Data passed to the show method */ public function _show_list($handler_id, array &$data) { midgard_admin_asgard_plugin::asgard_header(); $data['config'] =& $this->_config; midcom_show_style('midcom-admin-libs-list-header'); $data['even'] = false; foreach ($this->_libs as $name => $lib) { $data['name'] = $name; midcom_show_style('midcom-admin-libs-list-item'); if (!$data['even']) { $data['even'] = true; } else { $data['even'] = false; } } midcom_show_style('midcom-admin-libs-list-footer'); midgard_admin_asgard_plugin::asgard_footer(); }
/** * Shows the loaded message. */ public function _show_list($handler_id, array &$data) { $qb = new org_openpsa_qbpager('org_openpsa_directmarketing_campaign_message_dba', 'campaign_messages'); $qb->results_per_page = 10; $qb->add_order('metadata.created', 'DESC'); $qb->add_constraint('campaign', '=', $this->_campaign->id); $ret = $qb->execute(); $data['qbpager'] =& $qb; midcom_show_style("show-message-list-header"); if (count($ret) > 0) { foreach ($ret as $message) { $this->_datamanager->autoset_storage($message); $data['message'] =& $message; $data['message_array'] = $this->_datamanager->get_content_html(); $data['message_class'] = org_openpsa_directmarketing_viewer::get_messagetype_css_class($message->orgOpenpsaObtype); midcom_show_style('show-message-list-item'); } } midcom_show_style("show-message-list-footer"); }
/** * Show the sorting * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_order($handler_id, array &$data) { $data['navorder'] = $this->_topic->get_parameter('midcom.helper.nav', 'navorder'); // Navorder list for the selection $data['navorder_list'] = array(MIDCOM_NAVORDER_DEFAULT => midcom::get('i18n')->get_string('default sort order', 'midcom.admin.folder'), MIDCOM_NAVORDER_TOPICSFIRST => midcom::get('i18n')->get_string('folders first', 'midcom.admin.folder'), MIDCOM_NAVORDER_ARTICLESFIRST => midcom::get('i18n')->get_string('pages first', 'midcom.admin.folder'), MIDCOM_NAVORDER_SCORE => midcom::get('i18n')->get_string('by score', 'midcom.admin.folder')); if (!isset($_GET['ajax'])) { midcom_show_style('midcom-admin-folder-order-start'); } $data['navigation'] = $this->_get_navigation_data(); // Loop through each navigation type (node, leaf and mixed) foreach ($data['navigation'] as $key => $array) { $data['navigation_type'] = $key; $data['navigation_items'] = $array; midcom_show_style('midcom-admin-folder-order-type'); } if (!isset($_GET['ajax'])) { midcom_show_style('midcom-admin-folder-order-end'); } }
/** * Displays the archive. * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_list($handler_id, array &$data) { // FIXME: For some reason the config topic is lost between _handle and _show phases $this->_config->store_from_object($this->_topic, $this->_component); midcom_show_style('archive-list-start'); if ($this->_articles) { $data['index_fulltext'] = $this->_config->get('index_fulltext'); if ($this->_config->get('comments_enable')) { midcom::get('componentloader')->load_graceful('net.nehmer.comments'); $data['comments_enable'] = true; } $total_count = count($this->_articles); $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); foreach ($this->_articles as $article_counter => $article) { if (!$this->_datamanager->autoset_storage($article)) { debug_add("The datamanager for article {$article->id} could not be initialized, skipping it."); debug_print_r('Object was:', $article); continue; } $data['article'] =& $article; $data['article_counter'] = $article_counter; $data['article_count'] = $total_count; $arg = $article->name ? $article->name : $article->guid; if ($this->_config->get('view_in_url')) { $data['local_view_url'] = "{$prefix}view/{$arg}/"; } else { $data['local_view_url'] = "{$prefix}{$arg}/"; } if ($this->_config->get('link_to_external_url') && !empty($article->url)) { $data['view_url'] = $article->url; } else { $data['view_url'] = $data['local_view_url']; } if ($article->topic === $this->_content_topic->id) { $data['linked'] = false; } else { $data['linked'] = true; $nap = new midcom_helper_nav(); $data['node'] = $nap->get_node($article->topic); } midcom_show_style('archive-list-item'); } } else { midcom_show_style('archive-list-empty'); } midcom_show_style('archive-list-end'); }
/** * Shows the loaded product. * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_edit($handler_id, array &$data) { $this->_request_data['view_group'] = $this->_request_data['controller']->datamanager->get_content_html(); midcom_show_style('product_group_edit'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_pdf($handler_id, array &$data) { // if attachment was manually uploaded show confirm if file should be replaced midcom_show_style('show-confirm'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_read($handler_id, array &$data) { $data['datamanager'] =& $this->_datamanager; $data['task_bookings'] = $this->_list_bookings(); midcom_show_style('show-task'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_rsd($handler_id, array &$data) { $data['content_topic'] = $this->_content_topic; midcom_show_style('rsd'); }
echo sprintf($l10n->get('unsubscribed since %s'), strftime('%x %H:%M', $report['receipt_data']['first_send'])); ?> </th> <?php } ?> <td class="numeric"><?php echo round($report['campaign_data']['unsubscribed'], 2); ?> </td> </tr> </table> <?php if (count($report['link_data']['counts']) > 0) { echo "\n<h3>" . $l10n->get('link statistics') . "</h3>\n"; midcom_show_style('show-message-report-links-header'); $data['use_link_data'] =& $report['link_data']; $data['body_class'] = 'all'; midcom_show_style('show-message-report-links-body'); if (isset($report['link_data']['segments']) && is_array($report['link_data']['segments'])) { foreach ($report['link_data']['segments'] as $segment => $segment_data) { unset($data['use_link_data']); $data['use_link_data'] =& $segment_data; $data['body_class'] = 'segment'; $data['body_title'] = sprintf($l10n->get('segment "%s" link statistics'), $segment); midcom_show_style('show-message-report-links-body'); } } midcom_show_style('show-message-report-links-footer'); } }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_interview($handler_id, array &$data) { $this->_request_data['person'] = new midcom_db_person($this->_member->person); midcom_show_style('show-interview'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_fetch($handler_id, array &$data) { midcom_show_style('net-nemein-rss-feed-fetch'); }
/** * Shows the loaded message. */ public function _show_view($handler_id, array &$data) { $data['view_message'] = $this->_datamanager->get_content_html(); midcom_show_style('show-message'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_frontpage($handler_id, array &$data) { midcom_show_style('show-frontpage'); }
/** * Show event delete interface * * @param String $handler_id Name of the request handler * @param array &$data Public request data, passed by reference */ public function _show_delete($handler_id, array &$data) { // Set title to popup if ($this->_request_data['delete_succeeded']) { $this->_request_data['popup_title'] = sprintf($this->_l10n->get('event %s deleted'), $this->_event->title); } else { $this->_request_data['popup_title'] = $this->_l10n->get('delete event'); } // Show popup midcom_show_style('show-popup-header'); $this->_request_data['event_dm'] =& $this->_datamanager; midcom_show_style('show-event-delete'); midcom_show_style('show-popup-footer'); }
/** * Show edit page * * @param string $handler_id Name of the used handler * @param mixed &$data Data passed to the show method */ public function _show_edit($handler_id, array &$data) { midcom_show_style('edit'); }
/** * This function does the output. * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_list($handler_id, array &$data) { if ($data['group']) { if ($data['controller']) { $data['view_group'] = $data['controller']->get_content_html(); } else { $data['view_group'] = $data['datamanager_group']->get_content_html(); } } $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); if (count($data['groups']) >= 1 && (count($data['products']) == 0 || $this->_config->get('listing_primary') == 'groups')) { if ($this->_config->get('disable_subgroups_on_frontpage') !== true) { midcom_show_style('group_header'); $groups_counter = 0; $data['groups_count'] = count($data['groups']); midcom_show_style('group_subgroups_header'); foreach ($data['groups'] as $group) { $groups_counter++; $data['groups_counter'] = $groups_counter; $data['group'] = $group; if (!$data['datamanager_group']->autoset_storage($group)) { debug_add("The datamanager for group #{$group->id} could not be initialized, skipping it."); debug_print_r('Object was:', $group); continue; } $data['view_group'] = $data['datamanager_group']->get_content_html(); if ($group->code) { if (isset($data["parent_category"])) { $data['view_group_url'] = "{$prefix}" . $data["parent_category"] . "/{$group->code}/"; } else { $data['view_group_url'] = "{$prefix}{$group->code}/"; } } else { $data['view_group_url'] = "{$prefix}{$group->guid}/"; } midcom_show_style('group_subgroups_item'); } midcom_show_style('group_subgroups_footer'); midcom_show_style('group_footer'); } } else { if (count($data['products']) > 0) { midcom_show_style('group_header'); $products_counter = 0; $data['products_count'] = count($data['products']); midcom_show_style('group_products_grid'); midcom_show_style('group_products_footer'); midcom_show_style('group_footer'); } else { midcom_show_style('group_empty'); } } }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_create($handler_id, array &$data) { midcom_show_style("show-document-create"); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_generator($handler_id, array &$data) { midcom_show_style('sales_report-deliverable-start'); // Quick workaround to Bergies lazy determination of whether this is user's or everyone's report... if ($this->_request_data['query_data']['resource'] == 'user:'******'auth')->user->guid) { // My report $data['handler_id'] = 'deliverable_report'; } else { // Generic report $data['handler_id'] = 'sales_report'; } /*** Copied from sales/handler/deliverable/report.php ***/ midcom_show_style('sales_report-deliverable-header'); $invoices_node = midcom_helper_misc::find_node_by_component('org.openpsa.invoices'); $sums_per_person = array(); $sums_all = array('price' => 0, 'cost' => 0, 'profit' => 0); $odd = true; foreach ($data['invoices'] as $deliverable_guid => $invoices) { if (count($invoices) == 0) { // No invoices sent in this project, skip continue; } try { $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($deliverable_guid); $product = org_openpsa_products_product_dba::get_cached($deliverable->product); $salesproject = org_openpsa_sales_salesproject_dba::get_cached($deliverable->salesproject); $customer = midcom_db_group::get_cached($salesproject->customer); } catch (midcom_error $e) { continue; } if (!array_key_exists($salesproject->owner, $sums_per_person)) { $sums_per_person[$salesproject->owner] = array('price' => 0, 'cost' => 0, 'profit' => 0); } // Calculate the price and cost from invoices $invoice_price = 0; $data['invoice_string'] = ''; $invoice_cycle_numbers = array(); foreach ($invoices as $invoice) { $invoice_price += $invoice->sum; $invoice_class = $invoice->get_status(); if ($invoices_node) { $invoice_label = "<a class=\"{$invoice_class}\" href=\"{$invoices_node[MIDCOM_NAV_FULLURL]}invoice/{$invoice->guid}/\">" . $invoice->get_label() . "</a>"; } else { $invoice_label = $invoice->get_label(); } if ($product->delivery == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { $invoice_cycle_numbers[] = (int) $invoice->parameter('org.openpsa.sales', 'cycle_number'); } $data['invoice_string'] .= "<li class=\"{$invoice_class}\">{$invoice_label}</li>\n"; } if ($product->delivery == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { // This is a subscription, it should be shown only if it is the first invoice if (!in_array(1, $invoice_cycle_numbers)) { continue; // This will skip to next deliverable } $scheduler = new org_openpsa_invoices_scheduler($deliverable); if ($deliverable->end == 0) { // Subscription doesn't have an end date, use specified amount of months for calculation $cycles = $scheduler->calculate_cycles($this->_config->get('subscription_profit_months')); $data['calculation_basis'] = sprintf($data['l10n']->get('%s cycles in %s months'), $cycles, $this->_config->get('subscription_profit_months')); } else { $cycles = $scheduler->calculate_cycles(); $data['calculation_basis'] = sprintf($data['l10n']->get('%s cycles, %s - %s'), $cycles, strftime('%x', $deliverable->start), strftime('%x', $deliverable->end)); } $price = $deliverable->price * $cycles; $cost = $deliverable->cost * $cycles; } else { // This is a single delivery, calculate cost as percentage as it may be invoiced in pieces if ($deliverable->price) { $cost_percentage = 100 / $deliverable->price * $invoice_price; $cost = $deliverable->cost / 100 * $cost_percentage; } else { $cost_percentage = 100; $cost = $deliverable->cost; } $price = $invoice_price; $data['calculation_basis'] = sprintf($data['l10n']->get('%s%% of %s'), round($cost_percentage), $deliverable->price); } // And now just count the profit $profit = $price - $cost; $data['customer'] = $customer; $data['salesproject'] = $salesproject; $data['deliverable'] = $deliverable; $data['price'] = $price; $sums_per_person[$salesproject->owner]['price'] += $price; $sums_all['price'] += $price; $data['cost'] = $cost; $sums_per_person[$salesproject->owner]['cost'] += $cost; $sums_all['cost'] += $cost; $data['profit'] = $profit; $sums_per_person[$salesproject->owner]['profit'] += $profit; $sums_all['profit'] += $profit; if ($odd) { $data['row_class'] = ''; $odd = false; } else { $data['row_class'] = ' class="even"'; $odd = true; } midcom_show_style('sales_report-deliverable-item'); } $data['sums_per_person'] = $sums_per_person; $data['sums_all'] = $sums_all; midcom_show_style('sales_report-deliverable-footer'); /*** /Copied from sales/handler/deliverable/report.php ***/ midcom_show_style('sales_report-deliverable-end'); }
<h1><?php echo $data['topic']->extra; ?> </h1> <div class="midcom_helper_search_form"> <?php midcom_show_style("{$data['type']}_form"); ?> </div> <h2><?php echo $data['l10n']->get('search results'); ?> :</h2> <div class="midcom_helper_search_results"> <p><?php echo $data['l10n']->get('your query returned no results'); ?> </p> </div> <h2><?php echo $data['l10n']->get('search hints'); ?> :</h2> <p><?php $string = 'search hints ' . $data['config']->get('search_help_message'); echo $data['l10n']->get($string); ?>
<h1><?php echo $data['l10n']->get('delete_dataset_suggestion'); ?> </h1> <?php midcom_show_style('dataset_suggestion_item_detailed_view'); ?> <form action="" method="post"> <input type="submit" class="delete" name="midcom_baseclasses_components_handler_crud_deleteok" value="<?php echo $data['l10n_midcom']->get('delete'); ?> " /> <input type="submit" class="cancel" name="midcom_baseclasses_components_handler_crud_deletecancel" value="<?php echo $data['l10n_midcom']->get('cancel'); ?> " /> </form>
<div class="sidebar"> <?php midcom_show_style("show-person-account"); ?> </div> <div class="main"> <?php $data['view']->display_view(); ?> </div>
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_delete($handler_id, array &$data) { $data['article'] =& $this->_article; $nap = new midcom_helper_nav(); $node = $nap->get_node($this->_article->topic); $data['topic_url'] = $node[MIDCOM_NAV_FULLURL]; $data['topic_name'] = $node[MIDCOM_NAV_NAME]; $data['delete_url'] = "{$node[MIDCOM_NAV_FULLURL]}delete/{$this->_article->guid}/"; midcom_show_style('admin-delete-link'); }