Exemplo n.º 1
0
$categories = \Pasteque\CategoriesService::getAll();
//Title
echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Categories", PLUGIN_NAME)));
//Buttons
$buttons = \Pasteque\addButton(\i18n('Add a category', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "category_edit"));
$buttons .= \Pasteque\importButton(\i18n('Import categories', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "categoriesManagement"));
echo \Pasteque\row(\Pasteque\buttonGroup($buttons));
//Information
\Pasteque\tpl_msg_box($message, $error);
//Counter
echo \Pasteque\row(\Pasteque\counterDiv(\i18n("%d categories", PLUGIN_NAME, count($categories))));
if (count($categories) == 0) {
    echo \Pasteque\errorDiv(\i18n("No category found", PLUGIN_NAME));
} else {
    $content[0][0] = \i18n("Category.label");
    $i = 1;
    foreach ($categories as $category) {
        if ($category->hasImage) {
            $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category&id=" . $category->id;
        } else {
            $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category";
        }
        $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, 'category_edit', array("id" => $category->id)));
        $btn_group .= \Pasteque\deleteButton(\i18n('Delete', PLUGIN_NAME), \Pasteque\get_current_url() . "&delete-cat=" . $category->id);
        $content[$i][0] .= "<img class=\"img img-thumbnail thumbnail pull-left\" src=\"?" . $imgSrc . "\">";
        $content[$i][0] .= $category->label;
        $content[$i][0] .= \Pasteque\buttonGroup($btn_group, "pull-right");
        $i++;
    }
    echo \Pasteque\row(\Pasteque\standardTable($content));
}
Exemplo n.º 2
0
    if (\Pasteque\CompositionsService::delete($_POST['delete-comp'])) {
        $message = \i18n("Changes saved");
    } else {
        $error = \i18n("Unable to save changes");
    }
}
$compositions = \Pasteque\CompositionsService::getAll();
//Title
echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Compositions", PLUGIN_NAME)));
//Buttons
$buttons = \Pasteque\addButton(\i18n("Add composition", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "composition_edit"));
echo \Pasteque\row(\Pasteque\buttonGroup($buttons));
//Information
\Pasteque\tpl_msg_box($message, $error);
//Counter
echo \Pasteque\row(\Pasteque\counterDiv(\i18n("%d compositions", PLUGIN_NAME, count($compositions))));
if (count($compositions) == 0) {
    echo \Pasteque\errorDiv(\i18n("No category found", PLUGIN_NAME));
} else {
    $content[0][0] = \i18n("Composition.label");
    $i = 1;
    foreach ($compositions as $composition) {
        if ($composition->hasImage) {
            $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product&id=" . $composition->id;
        } else {
            $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product";
        }
        $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "composition_edit", array("productId" => $composition->id)));
        $btn_group .= \Pasteque\deleteButton(\i18n('Delete', PLUGIN_NAME), \Pasteque\get_current_url() . "&delete-comp=" . $composition->id);
        $content[$i][0] .= "<img class=\"img img-thumbnail thumbnail pull-left\" src=\"?" . $imgSrc . "\">";
        $content[$i][0] .= $composition->label;
Exemplo n.º 3
0
<?php 
$pp_id = null;
if ($cfg['pp_sandbox']) {
    $pp_id = $cfg['pp_sandbox_id'];
} else {
    $pp_id = $cfg['pp_user_id'];
}
foreach ($modules as $module) {
    echo "\t\t\t<tr>\n";
    displayModule($module, $activatedModules, $pp_id, $cfg['pp_sandbox']);
    echo "\t\t\t</tr>\n";
}
?>
		</tbody>
	</table>

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="<?php 
echo \Pasteque\esc_attr($pp_id);
?>
" />
<input type="hidden" name="display" value="1" />
<input type="image" src="https://www.sandbox.paypal.com/fr_FR/FR/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !" />
<img alt="" border="0" src="https://www.sandbox.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1" />
</div>
</form>

<?php 
\Pasteque\row(\Pasteque\alertDiv(\i18n("Once payment is validated, the modules will be activated in a short moment.", PLUGIN_NAME)));