/** * Return The complete output page code * * @return string The complete html page output */ public static function display_page() { $pageAddButton = false; $pageMessage = $addButtonLink = $pageFormButton = $pageIcon = $pageIconTitle = $pageIconAlt = $objectType = ''; $outputType = 'listing'; $objectToEdit = isset($_REQUEST['id']) ? wpshop_tools::varSanitizer($_REQUEST['id']) : ''; $pageSlug = isset($_REQUEST['page']) ? wpshop_tools::varSanitizer($_REQUEST['page']) : ''; $action = isset($_REQUEST['action']) ? wpshop_tools::varSanitizer($_REQUEST['action']) : ''; /* Select the content to add to the page looking for the parameter */ switch ($pageSlug) { case WPSHOP_URL_SLUG_ATTRIBUTE_LISTING: $objectType = new wpshop_attributes(); $current_user_can_edit = current_user_can('wpshop_edit_attributes'); $current_user_can_add = current_user_can('wpshop_add_attributes'); $current_user_can_delete = current_user_can('wpshop_delete_attributes'); if (current_user_can('wpshop_add_attributes')) { $pageAddButton = true; } break; case WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING: $objectType = new wpshop_attributes_set(); $current_user_can_edit = current_user_can('wpshop_edit_attribute_set'); $current_user_can_add = current_user_can('wpshop_add_attribute_set'); $current_user_can_delete = current_user_can('wpshop_delete_attribute_set'); if (current_user_can('wpshop_add_attribute_set')) { $pageAddButton = true; } break; case WPSHOP_URL_SLUG_SHORTCODES: $pageAddButton = false; $current_user_can_edit = false; $objectType = new wps_shortcodes_ctr(); break; case WPSHOP_URL_SLUG_MESSAGES: $pageAddButton = false; $objectType = new wpshop_messages(); $current_user_can_edit = true; if (!empty($_GET['mid'])) { $action = 'edit'; } break; default: $pageTitle = sprintf(__('You have to add this page into %s at line %s', 'wpshop'), __FILE__, __LINE__ - 4); $pageAddButton = false; break; } if ($objectType != '') { if ($action != '' && ($action == 'edit' && $current_user_can_edit || $action == 'add' && $current_user_can_add || $action == 'delete' && $current_user_can_delete)) { $outputType = 'adding'; } $objectType->elementAction(); $pageIcon = self::getPageIconInformation('path', $objectType); $pageIconTitle = self::getPageIconInformation('title', $objectType); $pageIconAlt = self::getPageIconInformation('alt', $objectType); if ($outputType == 'listing') { $pageContent = $objectType->elementList(); } elseif ($outputType == 'adding') { $pageAddButton = false; $pageFormButton = $objectType->getPageFormButton($objectToEdit); $pageContent = $objectType->elementEdition($objectToEdit); } $pageTitle = $objectType->pageTitle(); $pageMessage = $objectType->pageMessage; if (in_array($objectType->getEditionSlug(), array(WPSHOP_URL_SLUG_ATTRIBUTE_LISTING, WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING))) { $addButtonLink = admin_url('admin.php?page=' . $objectType->getEditionSlug() . '&action=add'); } else { $addButtonLink = admin_url('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES . '&page=' . $objectType->getEditionSlug() . '&action=add'); } } /* Page content header */ wpshop_display::displayPageHeader($pageTitle, $pageIcon, $pageIconTitle, $pageIconAlt, $pageAddButton, $addButtonLink, $pageMessage, $pageSlug); /* Page content */ echo $pageContent; /* Page content footer */ wpshop_display::displayPageFooter($pageFormButton); }
alert(wpshopConvertAccentTojs("<?php _e('Default attributes translation has been updated', 'wpshop'); ?> ")); } else { alert(wpshopConvertAccentTojs("<?php _e('An error occured while attempting to repair default attributes', 'wpshop'); ?> ")); } }, 'json'); }); }); </script><?php echo wpshop_display::displayPageFooter(false); $tpl_element['wpshop_admin_tools_main_page'] = ob_get_contents(); ob_end_clean(); ob_start(); ?> <div id="wps_tools_mas_action_message_copy_betwwen_attributes" ></div><form method="post" id="wps_tools_mass_update_form" action="<?php echo admin_url('admin-ajax.php'); ?> " ><input type="hidden" name="action" value="wps_mass_action_update_attribute" /><?php _e('Copy the different values of a given attribute into another attribute for products', 'wpshop'); ?> <br/><?php echo sprintf(__('Copy values from %s to %s', 'wpshop'), '{WPSHOP_ATTRIBUTE_LIST_FROM}', '{WPSHOP_ATTRIBUTE_LIST_TO}'); ?> <select name="wps_entity_to_transfert" > <option value="wpshop_product" ><?php