Ejemplo n.º 1
0
            if ($SMObj->getUserLoginID() == "") {
                die($LangUI->_('You do not have sufficient privileges to save/load shopping lists.'));
            }
            $saveListObj = new ShoppingList();
            foreach ($useLayout as $section) {
                for ($i = 0; $i < count($items); $i++) {
                    $ingObj = $items[$i];
                    if ($section == '' || $ingObj->location == $section) {
                        $removeKey = "remove_item_" . $ingObj->id;
                        if (!isset($_REQUEST[$removeKey]) || $_REQUEST[$removeKey] != "yes") {
                            $saveListObj->addIngredient($ingObj);
                        }
                    }
                }
            }
            $saveListObj->saveAsCurrentList();
            echo "<br/><br/>List Saved";
        }
    }
}
/*
	Puts the List in a string so that displaying it can be delayed
*/
function makeHtmlList(&$items, $section, $remove = '')
{
    global $units, $LangUI, $printedItems;
    $html = array();
    $removeItem = array();
    // loop through the sections
    for ($i = 0; $i < count($items); $i++) {
        $ingObj = $items[$i];