function SaveData() { global $langmessage, $addonPathData; if (!isset($_REQUEST['index'])) { return $langmessage['OOPS'] . ' - nothing to save!'; } $index = $_REQUEST['index']; $configFile = $addonPathData . '/ec_pagedata.php'; $pagedata = self::LoadData(); if ($_REQUEST) { if (array_key_exists("datafilter", $_REQUEST)) { $_REQUEST["datafilter"] = array_diff($_REQUEST["datafilter"], array('')); $pagedata[$index]['datafilter'] = implode(",", $_REQUEST["datafilter"]); } else { $pagedata[$index]['datafilter'] = ""; } } $pagedata[$index]['image_url'] = urlencode($_REQUEST['custom_img']); //save added opts $temp = new Catalog_Easy(); $temp->getConfig(); if (isset($temp->addon_name) and $temp->addon_name != "") { foreach ($temp->addon_name as $name) { $name = str_replace(' ', '_', $name); if (array_key_exists($name, $_REQUEST)) { $pagedata[$index][$name] = $_REQUEST[$name]; } } } if (gpFiles::SaveArray($configFile, 'pagedata', $pagedata)) { return $langmessage['SAVED']; } else { return $langmessage['OOPS']; } }
function CheckifNav($indexofparent) { global $gp_titles; $page_label = common::GetLabelIndex($indexofparent); if (isset($this->catpages) and $this->catpages != "") { foreach ($this->catpages as $catpage) { if (mb_strtolower($page_label) == mb_strtolower($catpage['label'])) { if ($catpage['navi'] and $catpage['source'] == 0) { return true; } } if (mb_strtolower($page_label) == mb_strtolower($catpage['sourcepages'])) { if ($catpage['navi'] and $catpage['source'] == 1) { return true; } } if (mb_strtolower($page_label) == mb_strtolower($catpage['sourcepages'])) { if ($catpage['navi'] and $catpage['source'] == 2) { $this->another_parent = $indexofparent; $index = Catalog_Easy::array_find_deep($gp_titles, $catpage['label']); $page_index = $index[0]; $this->page_cat = $page_index; return true; } } } } return false; }