| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/news/components/com_simple_review/templates/default/userreview/ |
Upload File : |
<?php
/**
* $Id$
*
* Copyright (C) 2005-2009 Rowan Youngson
*
* This file is part of Simple Review.
*
* Simple Review is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Simple Review is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Simple Review. If not, see <http://www.gnu.org/licenses/>.
*/
// ensure this file is being included by a parent file
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
/*
function GetName()
{
return str_replace('.php', '', basename(__FILE__));
}
function _GetReviewString($key)
{
return $this->ReviewModule->GetString($key, _SR_ADDON_TYPE_MODULE, 'Review_Module');
}*/
$bridge =& $this->ReviewModule->_AddonManager->Bridge;
$option = $bridge->Option;
$jsRootUrl = $bridge->SiteUrl.'components/'.$option.'/javascript/';
$adminUrl = $bridge->SiteUrl.'administrator/components/'.$option.'/';
$jsFile = $adminUrl.'addons/modules/Review_Module/Review_Module.Admin.js';
$bridge->IncludeJQuery();
$bridge->IncludeJQueryUI();
$bridge->IncludeJSLink($jsFile);
$bridge->IncludeJSLink($jsRootUrl.'jquery.validate.min.js');
$bridge->IncludeJSLink($jsRootUrl.'jquery.metadata.min.js');
$saveTask = new stdClass();
$saveTask->none = '';
$saveTask->apply = 'UserReview_Apply';
$saveTask->save = 'UserReview_Save';
if($this->Values == null)
{
$this->Values = array();
}
$values = $this->Values;
$homeUrl = $this->UserReviewModule->GetUrl(0, '&task=UserReview_Home');
$mainframe = &JFactory::getApplication();
$pathway = &$mainframe->getPathWay();
$pathway->addItem('User Reviews', $homeUrl);
$pathway->addItem('Write', '');
$mainframe->triggerEvent('onBBCode_RenderForm', array('document.forms.userReviewForm.content', &$Form) );
$categoryID = intval($values['categoryID'], 10);//$bridge->GetParameter($_POST ,'categoryID', -1, 'int');
if($categoryID < 1)
{
die('Invalid category.');
}
$submitTask = $bridge->GetParameter($_POST ,'submitTask', $saveTask->none, 'int');
$maxRating = $this->ReviewModule->GetSetting('MaxRating');
$useStarRating = $this->ReviewModule->GetSetting('UseStarRating') == '1';
$showAlias = $this->UserReviewModule->GetSetting('ShowAlias') == '1';
if($useStarRating)
{
$bridge->IncludeJSLink($jsRootUrl.'jquery.rateit.min.js');
?>
<script type="text/javascript">
jQuery(function(){
var scaleRated = function(value){
return value * (maxrating / 5);
};
var maxrating = '<?php echo $maxRating;?>';
var rated = scaleRated(<?php echo $values['score'];?>);
var rateittext = jQuery("#rateittext");
var setRated = function(value){
rated = scaleRated(value ? value : 0);
};
rateittext.text(rated);
jQuery("#rateit").bind('rated', function (event, value) { setRated(value); rateittext.text(rated); });
jQuery("#rateit").bind('hover', function (event, value) { rateittext.text(value ? scaleRated(value) : rated); });
jQuery("#rateit").bind('reset', function () { rated = 0; rateittext.text(rated); });
});
</script>
<?php
}
echo SRHtmlControls::ImageSearch();
?>
<style type="text/css">
.buttonToolbar
{
text-align:right;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function()
{
var messages = {};
messages.score = {
required: "<?php echo $this->_GetReviewString('FormWarningValidRating');?>",
range: jQuery.format("<?php echo $this->_GetReviewString('FormWarningRatingBounds');?>"),
score: "<?php echo $this->_GetReviewString('FormWarningValidRating');?>",
number: "<?php echo $this->_GetReviewString('FormWarningValidRating');?>"
};
<?php
$titleToValidateCount = 1;
foreach($values['titles'] as $revTitle):
?>
var messageName = '<?php echo "title$titleToValidateCount";?>';
messages[messageName] = {
required: "<?php echo $this->_GetReviewString('FormWarningMandatoryTitle1');?>",
range: jQuery.format("<?php echo $this->_GetReviewString('FormWarningRatingBounds');?>"),
<?php echo "title$titleToValidateCount";?>: "<?php echo $this->_GetReviewString('FormWarningValidRating');?>",
number: "<?php echo $this->_GetReviewString('FormWarningValidRating');?>",
url: "<?php echo $this->_GetReviewString('FormWarningUrl');?>"
};
<?php
$titleToValidateCount++;
endforeach;
?>
jQuery("#userReviewForm").validate({
errorLabelContainer: jQuery("#userReviewForm div.errorContainer"),
messages: messages
});
var task = { apply: '<?php echo $saveTask->apply;?>', save: '<?php echo $saveTask->save;?>'};
var submitForm = function(event, saveTask)
{
event.preventDefault();
jQuery("#task").val(saveTask);
jQuery("#userReviewForm").submit();
};
jQuery("#btnCancel").click(function(event)
{
//submitForm(event, task.cancel);
window.location = "<?php echo $homeUrl;?>";
return false;
});
jQuery("#btnApply").click(function(event)
{
submitForm(event, task.apply);
});
jQuery("#btnSave").click(function(event)
{
submitForm(event, task.save);
});
jQuery("#userReviewForm").submit(function(event)
{
if(!jQuery(this).valid())
{
return false;
}
return true;
});
var thumbnailURL = jQuery("#thumbnailURL");
var imageURL = jQuery("#imageURL");
jQuery("#bthSearchThumbnailURL").click(function(event)
{
event.preventDefault();
SRCore.SearchImage.Search(thumbnailURL.val(), function(x){thumbnailURL.val(x);})
});
jQuery("#bthSearchImageURL").click(function(event)
{
event.preventDefault();
SRCore.SearchImage.Search(imageURL.val(), function(x){imageURL.val(x);})
});
});
</script>
<!-- todo -->
<link rel="stylesheet" href="administrator/templates/system/css/system.css" type="text/css" />
<link href="administrator/templates/khepri/css/template.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="administrator/templates/khepri/css/ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lte IE 6]>
<link href="administrator/templates/khepri/css/ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="administrator/templates/khepri/css/rounded.css" />
<!-- todo end -->
<form name='userReviewForm' id='userReviewForm' class='userReviewForm' method="post">
<div class='buttonToolbar'>
<button id='btnSave'>Save</button>
<button id='btnApply'>Apply</button>
<button id='btnCancel'>Cancel</button>
</div>
<fieldset class="fieldsetUserReview">
<div class="errorContainer" style="display:none"></div>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top">
<table class="userReviewForm">
<tbody>
<tr>
<!-- name -->
<td class="firstCol"><label for="name"><?php echo $this->Tips->nameTip;?></label></td>
<td colspan="3">
<div class="titleText">
<input type="text" name="name" id="name" class="{required:true} inputbox" size="52" value="<?php echo $values['name']; ?>"/>
</div>
</td>
</tr>
<?php if($showAlias): ?>
<tr>
<!-- page name -->
<td class="firstCol"><label for="pageName"><?php echo $this->Tips->pageNameTip;?></label></td>
<td colspan="3">
<div class="titleText">
<input type="text" name="pageName" id="pageName" class="inputbox" size="52" value="<?php echo $values['pageName']; ?>"/>
</div>
</td>
</tr>
<?php endif;?>
<tr>
<!-- award -->
<td class="firstCol"><label for="awardID"><?php echo $this->Tips->awardListTip;?></label></td>
<td class="awardCol"><div class="titleText"><?php echo $this->AwardsList;?></div></td>
<!-- rating -->
<td class="ratingLabelCol"><label for="score"><?php echo $this->Tips->ratingTip;?></label></td>
<td class="ratingCol">
<div class="titleText">
<input type="text" name="score" id="score" class="{required:true,number:true, range:[0,<?php echo $maxRating;?>]} inputbox" value="<?php echo $values['score']; ?>" size='12'/>
<?php if($useStarRating):?>
<div id="rateit" class="rateit bigstars" data-rateit-backingfld="#score" data-rateit-starwidth="23" data-rateit-starheight="22"></div> <span id="rateittext">0</span>
<?php endif;?>
/ <?php echo $maxRating;?>
</div>
</td>
</tr>
</tbody>
</table>
<table class="userReviewForm">
<tbody>
<tr>
<!-- thumbnail -->
<td class="firstCol"><label for="thumbnailURL"><?php echo $this->Tips->thumbnailTip;?></label></td>
<td>
<div class="titleText">
<input type="text" name="thumbnailURL" id="thumbnailURL" class="{required:false,maxlength:255}" value="<?php echo $values['thumbnailURL']; ?>" size="71"/>
</div>
<button id="bthSearchThumbnailURL">Search</button>
</td>
</tr>
<tr>
<!-- image -->
<td class="firstCol"><label for="imageURL"><?php echo $this->Tips->imageTip;?></label></td>
<td>
<div class="titleText">
<input type="text" name="imageURL" id="imageURL" class="{required:false,maxlength:255}" value="<?php echo $values['imageURL']; ?>" size="71"/>
</div>
<button id="bthSearchImageURL">Search</button>
</td>
</tr>
<tr>
<!-- blurb -->
<td class="firstCol"><label for="blurb"><?php echo $this->Tips->blurbTip;?></label></td>
<td><div class="titleText"><textarea name="blurb" id="blurb" cols="62" rows="4"><?php echo $values['blurb']; ?></textarea></div></td>
</tr>
</tbody>
</table>
<table class="userReviewForm">
<tbody>
<?php
$titleCount = 1;
foreach($values['titles'] as $titleContainer)
{
$title = ReviewTitleHelper::GetTitle($titleCount, $titleContainer->category, $titleContainer->review);
echo"<tr>";
echo $title->Setup();
echo"</tr>";
$titleCount++;
}
?>
</tbody>
</table>
<table class="userReviewForm content">
<tbody>
<tr>
<td style="text-align:center">
<?php echo $Form;?>
<textarea id='content' name='content' style="height:500px; width:99%" cols="75"><?php echo $values['content']; ?></textarea>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="categoryID" id="categoryID" value="<?php echo $categoryID;?>"/>
<input type="hidden" name="task" id="task" value="<?php echo $submitTask;?>"/>
</fieldset>
</form>