Code Duplication    Length = 8-10 lines in 3 locations

includes/librairies/eav/attributes_set.class.php 1 location

@@ 115-122 (lines=8) @@
112
			$query = $wpdb->update(self::getDbTable(), array('status'=>'moderated'), array('id'=>sanitize_key($id)));
113
			wpshop_tools::wpshop_safe_redirect(admin_url('admin.php?page=' . self::getListingSlug() . "&action=edit&id=" . sanitize_key($id)));
114
		}
115
		if(($action != '') && ($action == 'saveok') && ($saveditem > 0)){
116
			$editedElement = self::getElement($saveditem);
117
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully saved', 'wpshop'), '<span class="bold" >' . $editedElement->name . '</span>');
118
		}
119
		elseif(($action != '') && ($action == 'deleteok') && ($saveditem > 0)){
120
			$editedElement = self::getElement($saveditem, "'deleted'");
121
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully deleted', 'wpshop'), '<span class="bold" >' . $editedElement->name . '</span>');
122
		}
123
124
		/*	Define the database operation type from action launched by the user	 */
125
		/*************************			GENERIC				****************************/

includes/librairies/eav/attributes.class.php 1 location

@@ 128-135 (lines=8) @@
125
				wpshop_tools::wpshop_safe_redirect(admin_url('admin.php?page=' . self::getListingSlug() . "&action=edit&id=" . $id));
126
			}
127
		}
128
		if(($action != '') && ($action == 'saveok') && ($saveditem > 0)){
129
			$editedElement = self::getElement($saveditem);
130
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully saved', 'wpshop'), '<span class="bold" >' . $editedElement->code . '</span>');
131
		}
132
		elseif(($action != '') && ($action == 'deleteok') && ($saveditem > 0)){
133
			$editedElement = self::getElement($saveditem, "'deleted'");
134
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully deleted', 'wpshop'), '<span class="bold" >' . $editedElement->code . '</span>');
135
		}
136
137
		$attribute_parameter = !empty( $_REQUEST[self::getDbTable()] ) ? (array)$_REQUEST[self::getDbTable()] : array();
138
		 if ( !empty($set_section) ) unset($attribute_parameter['set_section']);

includes/librairies/eav/attributes_unit.class.php 1 location

@@ 155-164 (lines=10) @@
152
		/****************************************************************************/
153
		$action = isset($_REQUEST['action']) ? wpshop_tools::varSanitizer($_REQUEST['action']) : 'add';
154
		$saveditem = isset($_REQUEST['saveditem']) ? wpshop_tools::varSanitizer($_REQUEST['saveditem']) : '';
155
		if(($action != '') && ($action == 'saveok') && ($saveditem > 0))
156
		{
157
			$editedElement = self::getElement($saveditem);
158
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully saved', 'wpshop'), '<span class="bold" >' . $editedElement->code . '</span>');
159
		}
160
		elseif(($action != '') && ($action == 'deleteok') && ($saveditem > 0))
161
		{
162
			$editedElement = self::getElement($saveditem, "'deleted'");
163
			$pageMessage = '<img src="' . WPSHOP_SUCCES_ICON . '" alt="action success" class="wpshopPageMessage_Icon" />' . sprintf(__('%s succesfully deleted', 'wpshop'), '<span class="bold" >' . $editedElement->code . '</span>');
164
		}
165
166
		/*	Define the database operation type from action launched by the user	 */
167
		$attribute_group_parameter = (!empty($_REQUEST[self::getDbTable()])) ? (array) $_REQUEST[self::getDbTable()] : array();