Prev | Current Page 451 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


CHAPTER 11 ?–  CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 351
Figure 11-6. Edit Department Details and Edit Product Details buttons in TShirtShop
Exercise: Implementing In-Store Administration Links
1. Open the tshirtshop.css file from the styles folder, and add the following style definitions:
div.yui-b div form.edit-form
{
margin: 0;
padding: 0;
}
.edit-form
{
margin: 0;
padding: 0 0 10px 0;
}
2. Open presentation/templates/department.tpl, and edit it like this:
{* department.tpl *}
{load_presentation_object filename="department" assign="obj"}

{$obj->mName}


CHAPTER 11 ?–  CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 352

{$obj->mDescription}


{if $obj->mShowEditButton}

value="{$obj->mEditButtonCaption}" />

{/if}
{include file="products_list.tpl"}
3. Add the following highlighted members to the Department class in presentation/department.php:
// Deals with retrieving department details
class Department
{
// Public variables for the smarty template
public $mName;
public $mDescription;
public $mEditActionTarget;
public $mEditAction;
public $mEditButtonCaption;
public $mShowEditButton;
4. Also in presentation/department.php, add the following piece of code at the end of the constructor of
the Department class.


Pages:
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
angielski on-line agencja detektywistyczna detektyw gdańsk Pozycjonowanie przechowalnie