AAAAPK >\(VR
view.html.phpnu W+A max_rating = VmConfig::get('vm_maximum_rating_scale',5);
$this->assignRef('max_rating', $this->max_rating);
$model = VmModel::getModel();
$this->SetViewTitle('REVIEW_RATE' );
/* Get the task */
$task = JRequest::getWord('task');
switch ($task) {
case 'listreviews':
/* Get the data */
$this->addStandardDefaultViewLists($model);
$virtuemart_product_id = JRequest::getVar('virtuemart_product_id',array(),'', 'array');
if(is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0){
$virtuemart_product_id = (int)$virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int)$virtuemart_product_id;
}
$reviewslist = $model->getReviews($virtuemart_product_id);
$lists = array();
$lists['filter_order'] = $mainframe->getUserStateFromRequest($option.'filter_order', 'filter_order', '', 'cmd');
$lists['filter_order_Dir'] = $mainframe->getUserStateFromRequest($option.'filter_order_Dir', 'filter_order_Dir', '', 'word');
$this->assignRef('reviewslist', $reviewslist);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
$this->addStandardDefaultViewCommands(false,true);
break;
case 'edit':
/* Get the data */
$rating = $model->getRating($cids);
$this->addStandardEditViewCommands();
/* Assign the data */
$this->assignRef('rating', $rating);
break;
case 'edit_review':
JToolBarHelper::divider();
/* Get the data */
$rating = $model->getReview($cids);
if(!empty($rating)){
$this->SetViewTitle('REVIEW_RATE',$rating->product_name." (". $rating->customer.")" );
JToolBarHelper::customX('saveReview', 'save', 'save', JText::_('COM_VIRTUEMART_SAVE'), false);
JToolBarHelper::customX('applyReview', 'apply', 'apply', JText::_('COM_VIRTUEMART_APPLY'), false);
} else {
$this->SetViewTitle('REVIEW_RATE','ERROR' );
}
JToolBarHelper::customX('cancelEditReview', 'cancel', 'cancel', JText::_('COM_VIRTUEMART_CANCEL'), false);
/* Assign the data */
$this->assignRef('rating', $rating);
break;
default:
$this->addStandardDefaultViewCommands(false, true);
$this->addStandardDefaultViewLists($model);
$ratingslist = $model->getRatings();
$this->assignRef('ratingslist', $ratingslist);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
break;
}
parent::display($tpl);
}
}
// pure php no closing tag
PK >\
index.htmlnu W+A PK >\) tmpl/.htaccessnu W+A