public static function execute() { $installed_modules = ProductAttributes::getInstalled(); $installed = array(); foreach ( $installed_modules['entries'] as $module ) { $installed[] = $module['code']; } $result = array('entries' => array()); $DLpa = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Admin/Module/ProductAttribute'); $DLpa->setIncludeDirectories(false); foreach ( $DLpa->getFiles() as $file ) { $module = substr($file['name'], 0, strrpos($file['name'], '.')); if ( !in_array($module, $installed) ) { $class = 'osCommerce\\OM\\Core\\Site\\Admin\\Module\\ProductAttribute\\' . $module; $OSCOM_PA = new $class(); $result['entries'][] = array('code' => $OSCOM_PA->getCode(), 'title' => $OSCOM_PA->getTitle()); } } $result['total'] = count($result['entries']); return $result; }
public static function execute(ApplicationAbstract $application) { $data = HTML::sanitize(basename($_GET['code'])); if ( ProductAttributes::install($data) ) { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success'); } else { Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error'); } OSCOM::redirect(OSCOM::getLink()); }
public static function execute() { if ( !isset($_GET['search']) ) { $_GET['search'] = ''; } if ( !empty($_GET['search']) ) { $result = ProductAttributes::findInstalled($_GET['search']); } else { $result = ProductAttributes::getInstalled(); } $result['rpcStatus'] = RPC::STATUS_SUCCESS; echo json_encode($result); }
public static function execute($search) { $modules = ProductAttributes::getUninstalled(); $result = array('entries' => array()); foreach ( $modules['entries'] as $module ) { if ( (stripos($module['code'], $search) !== false) || (stripos($module['title'], $search) !== false) ) { $result['entries'][] = $module; } } $result['total'] = count($result['entries']); return $result; }
</td> </tr> </table> <?php if ( !$new_product && ($OSCOM_ObjectInfo->getInt('has_children') === 1) ) { echo HTML::hiddenField('products_tax_class_id', 0) . HTML::hiddenField('products_price', 0) . HTML::hiddenField('products_model') . HTML::hiddenField('products_quantity', 0), HTML::hiddenField('products_weight', 0), HTML::hiddenField('products_weight_class', 0); } ?> <h4><?php echo OSCOM::getDef('subsection_attributes'); ?></h4> <fieldset> <?php $installed = ProductAttributes::getInstalled(); foreach ( $installed['entries'] as $pa ) { $pamo = 'osCommerce\\OM\\Core\\Site\\Admin\\Module\\ProductAttribute\\' . $pa['code']; $pam = new $pamo(); echo '<p><label for="pa_' . $pa['code'] . '">' . $pa['title'] . '</label>' . $pam->getInputField(!$new_product && isset($attributes[$pa['id']]) ? $attributes[$pa['id']] : null) . '</p>'; } ?> </fieldset> </div> </div> <script>