コード例 #1
0
ファイル: City.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name', 'stateId', 'cityStdCode'], 'required'], [['stateId', 'status', 'isFg', 'priority', 'parentCityId', 'createdBy', 'updatedBy'], 'integer'], [['createdOn', 'updatedOn'], 'safe'], [['name'], 'string', 'max' => 255], [['alias'], 'string', 'max' => 100], [['ip'], 'string', 'max' => 15], [['name'], 'unique', 'targetAttribute' => ['name', 'stateId']], ['name', 'filter', 'filter' => 'trim'], ['name', 'unique'], ['name', 'string', 'min' => 3, 'max' => 60], ['cityStdCode', 'string', 'min' => 2, 'max' => 6], ['cityStdCode', 'common\\validators\\NumberIntegerValidator'], ['name', 'common\\validators\\StringValidator'], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier helper
         return HTMLPurifier::process($value);
     }]];
 }
コード例 #2
0
ファイル: Source.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name'], 'required'], [['createdOn'], 'safe'], [['status'], 'integer'], [['name'], 'string', 'max' => 100], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier helper
         return HTMLPurifier::process($value);
     }], [['name'], 'common\\validators\\StringValidator'], [['name'], 'unique']];
 }
コード例 #3
0
ファイル: Cuisine.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name'], 'required'], [['Id', 'status', 'createdBy', 'updatedBy'], 'integer'], [['desc'], 'string'], [['createdOn', 'updatedOn'], 'safe'], [['name'], 'string', 'max' => 100], [['ip'], 'string', 'max' => 15], [['alias', 'searchAlias'], 'string', 'max' => 255], [['name', 'desc'], 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier helper
         return HTMLPurifier::process($value);
     }], [['name'], 'common\\validators\\CuisineValidator'], [['name'], 'unique']];
 }
コード例 #4
0
ファイル: Theatre.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name', 'cityId', 'address', 'zoneId', 'localityId'], 'required'], [['cityId', 'state', 'status', 'createdBy', 'updatedBy', 'noofscreens'], 'integer'], [['gpsLat'], 'number', 'max' => 91], [['gpsLong'], 'number', 'max' => 181], [['createdOn', 'updatedOn', 'hotelId'], 'safe'], [['address', 'guid'], 'string', 'min' => 6, 'max' => 128], [['tollfree', 'bookingNumber'], 'string', 'max' => 12], [['name'], 'string', 'min' => 3, 'max' => 128], [['email', 'website', 'facebookUrl'], 'string', 'min' => 6, 'max' => 100], [['pincode'], 'number', 'min' => 100000, 'max' => 999999], [['landmark'], 'string', 'max' => 150], [['ip'], 'string', 'max' => 15], ['email', 'email'], [['name'], 'filter', 'filter' => 'trim'], ['name', 'common\\validators\\EntitynameValidator'], ['email', 'email'], ['website', 'url'], ['facebookUrl', 'url'], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['tollfree', 'common\\validators\\NumberValidator'], ['bookingNumber', 'common\\validators\\NumberValidator'], [['name', 'landmark'], 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
 }
コード例 #5
0
ファイル: Hotels.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['type', 'cityId', 'localityId', 'createdBy', 'updatedBy', 'status'], 'integer'], [['cityId'], 'required'], [['createdOn', 'updatedOn', 'parent_city_id'], 'safe'], [['name'], 'string', 'max' => 100], [['name'], 'unique', 'targetAttribute' => ['name', 'cityId']], [['name'], 'common\\validators\\CuisineValidator'], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier helper
         return HTMLPurifier::process($value);
     }]];
 }
コード例 #6
0
ファイル: Locality.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['cityId', 'zoneId', 'name'], 'required', 'message' => '{attribute} can not be empty.'], [['cityId', 'status', 'isFg', 'pin', 'createdBy', 'updatedBy'], 'integer'], [['createdOn', 'updatedOn'], 'safe'], [['gpsLat', 'gpsLong'], 'string', 'min' => 3, 'max' => 15], [['nearBy'], 'string', 'max' => 500], [['ip'], 'string', 'max' => 15], [['name', 'alias'], 'filter', 'filter' => 'trim'], [['name'], 'unique', 'targetAttribute' => ['name', 'cityId', 'zoneId']], [['name', 'alias'], 'string', 'min' => 3, 'max' => 60], ['name', 'common\\validators\\AlphanumericValidator'], ['alias', 'common\\validators\\AliasnameValidator'], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier helper
         return HTMLPurifier::process($value);
     }]];
 }
コード例 #7
0
ファイル: Movie.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name', 'launguageId'], 'required'], [['synopsis', 'review'], 'string'], [['status', 'state', 'length', 'toiMovieId', 'launguageId'], 'integer'], [['releaseDate', 'createdOn', 'updatedOn', 'cast', 'synopsis', 'review', 'status', 'guid', 'starRating'], 'safe'], [['parentalGuidance'], 'string', 'max' => 5], [['alias', 'tagline', 'movieDirector', 'musicDirector'], 'string', 'max' => 100], [['guid'], 'string', 'max' => 512], [['length'], 'number', 'max' => 240], [['toiMovieId'], 'number'], [['name'], 'common\\validators\\EntitynameValidator'], [['canonicalUrl'], 'url'], ['movieDirector', 'common\\validators\\StringWithCommaSeparatedValidator'], ['musicDirector', 'common\\validators\\StringWithCommaSeparatedValidator'], ['cast', 'common\\validators\\StringWithCommaSeparatedValidator'], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
 }
コード例 #8
0
 /**
  * 富文本过滤
  * @param $attribute
  * @param array $params
  */
 public function purify($attribute, $params = array())
 {
     //不做进一步判断params的合法性
     if (isset($params['Attr.AllowedFrameTargets'])) {
         $params['Attr.AllowedFrameTargets'] = array('_blank');
     }
     $this->{$attribute} = HTMLPurifier::process($this->{$attribute}, $params);
 }
コード例 #9
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['name', 'cityId', 'sourceId', 'description', 'type', 'startDate', 'category'], 'required', 'message' => '{attribute} can not be empty.'], [['pincode'], 'required', 'message' => 'Venue type can not be empty.'], [['price'], 'number', 'max' => 200000], [['tollfree'], 'number'], ['url', 'url'], ['shopurl', 'url'], ['description', 'string'], ['description', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }], [['startDate', 'endDate', 'startTime', 'endTime', 'createdOn', 'updatedOn', 'multipleTimings', 'ip', 'type', 'tag', 'isRecursive', 'status', 'price', 'multitag'], 'safe'], [['pincode', 'contactName', 'email', 'url', 'shopurl'], 'string', 'max' => 100], [['name'], 'common\\validators\\EntitynameValidator'], [['name'], 'string', 'min' => 2, 'max' => 100], [['oldGuid', 'guid'], 'string', 'max' => 512], ['email', 'email'], ['name', 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }]];
 }
コード例 #10
0
ファイル: Comment.php プロジェクト: simplator/threads
 public function purify($attribute, $allow = [])
 {
     $config = HTMLPurifier_Config::createDefault();
     $config->set('AutoFormat.AutoParagraph', true);
     //$config->set('HTML.AllowedElements', '');
     //$config->set('HTML.AllowedElements', explode(',', 'b,br,p,i,u'));
     $purifier = new HTMLPurifier($config);
     $this->{$attribute} = $purifier->process($this->{$attribute}, $config);
     return true;
 }
コード例 #11
0
ファイル: detail.php プロジェクト: ThijsBosch/batboxes
		<?php 
    }
    ?>
	<?php 
}
?>
	<?php 
if ($visitModel->remarks) {
    ?>
		<tr>
			<td><?php 
    echo $visitModel->getAttributeLabel('remarks');
    ?>
</td>
			<td><?php 
    echo HTMLPurifier::process($visit->remarks);
    ?>
</td>
		</tr>
	<?php 
}
?>
</table>

<h2>
	<?php 
echo Yii::t('app', 'Waarnemingen');
?>
	<?php 
if (Yii::$app->user->can('createObservation', ['visit' => $visit])) {
    ?>
コード例 #12
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['state', 'sourceId', 'cityId', 'zoneId', 'pin', 'entityType', 'priceForTwo', 'capacity', 'hotelId', 'status', 'healthStatus', 'createdBy', 'updatedBy'], 'integer'], ['localityId', 'integer', 'message' => 'Please select {attribute}'], [['description'], 'string'], [['gpsLat', 'gpsLong', 'coverFee', 'entryFee', 'ladiesFee', 'popularityScore', 'popularityScroreParams'], 'number'], [['createdOn', 'updatedOn', 'launchdate', 'popularpubs', 'state', 'verificationStatus', 'remarks', 'tag', 'chainId'], 'safe'], [['name', 'address', 'landmark', 'alias', 'website', 'facebook', 'tips', 'famousFor', 'specialities'], 'string', 'max' => 255], [['owner', 'manager', 'email'], 'string', 'max' => 100], [['guid', 'old_guid'], 'string', 'max' => 512], [['name', 'entityType', 'cityId', 'localityId', 'address', 'landmark', 'priceForTwo', 'gpsLat', 'gpsLong', 'cuisines'], 'required'], [['name', 'description'], 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }], [['name'], 'common\\validators\\EntitynameValidator'], [['landmark'], 'common\\validators\\EntitynameValidator'], [['address', 'landmark', 'manager'], 'string', 'min' => 6, 'max' => 128], [['name'], 'string', 'min' => 2, 'max' => 100], [['gpsLat'], 'number', 'max' => 91], [['gpsLong'], 'number', 'max' => 181], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['website', 'url'], ['facebook', 'url'], [['capacity'], 'number', 'max' => 999], [['pin'], 'number', 'max' => 999999, 'min' => 100000], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
 }
コード例 #13
0
ファイル: detail.php プロジェクト: ThijsBosch/batboxes
				<?php 
}
?>
			</table>
		</div>
	</div>
	
	<?php 
if ($project->remarks) {
    ?>
		<h1><?php 
    echo Yii::t('app', 'Samenvatting');
    ?>
</h1>
		<?php 
    echo nl2br(HTMLPurifier::process($project->remarks));
    ?>
	<?php 
}
?>
	
	<h1><?php 
echo Yii::t('app', 'Kasten');
?>
</h1>
	<?php 
if (Yii::$app->user->can('boxRights', ['project' => $project])) {
    ?>
		<?php 
    echo Html::a(Yii::t('app', 'Kast toevoegen'), Url::toRoute(['boxes/form', 'project_id' => $project->id]), ['class' => 'btn btn-info']);
    ?>
コード例 #14
0
ファイル: index.php プロジェクト: apurey/cmf
<?php

/* @var $this yii\web\View */
/* @var $dp app\modules\page\models\Page */
use yii\helpers\HtmlPurifier;
$this->title = $dp->title;
$this->registerMetaTag(['name' => 'keywords', 'content' => $dp->keywords]);
$this->registerMetaTag(['name' => 'description', 'content' => $dp->description]);
if ($this->beginCache('page', ['duration' => 60, 'variations' => ['id' => $dp->id]])) {
    echo HTMLPurifier::process($dp->text, ['Attr.AllowedFrameTargets' => ['_blank', '_self', '_parent', '_top']]);
    $this->endCache();
}
コード例 #15
0
ファイル: view.php プロジェクト: rajanishtimes/partnerapi
 */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="event-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
$dataArray = $model->getAttributes();
$dataArray['phone'] = implode(', ', $model->getPhone());
$dataArray['mobile'] = implode(', ', $model->getMobile());
$dataArray['cityname'] = common\models\City::findOne($model->cityId)->name;
$dataArray['createdBy'] = common\models\User::findOne($model->createdBy)->firstname;
$dataArray['updatedBy'] = common\models\User::findOne($model->updatedBy)->firstname;
$dataArray['sourcename'] = $model->sourcename;
$dataArray['description'] = strip_tags(HTMLPurifier::process($model->description));
$dataArray['guid'] = 'http://timescity.com' . $model->guid;
?>

    <?php 
echo DetailView::widget(['model' => $dataArray, 'attributes' => ['name', ['attribute' => 'cityname', 'label' => 'City'], ['attribute' => 'sourcename', 'label' => 'Source'], ['attribute' => 'startDate', 'label' => 'Start Date', 'format' => 'date'], ['attribute' => 'endDate', 'label' => 'End Date', 'format' => 'date'], ['attribute' => 'startTime', 'label' => 'Start Time'], ['attribute' => 'endTime', 'label' => 'End Time'], 'description:ntext', 'phone', 'mobile', 'contactName', 'email:email', ['attribute' => 'url', 'label' => 'Event URL/Website', 'format' => 'url'], ['attribute' => 'shopurl', 'label' => 'FB URL', 'format' => 'url'], 'price', 'guid:url', 'createdOn', 'createdBy', 'updatedOn', 'updatedBy']]);
?>
    
    <?php 
echo WorkflowButtonsView::widget(['view' => $this, 'model' => $model]);
?>
</div>
コード例 #16
0
ファイル: detail.php プロジェクト: ThijsBosch/batboxes
						<tr>
							<td><?php 
        echo $observation->getAttributeLabel('manure_collected');
        ?>
</td>
							<td><?php 
        echo Html::encode($observation->getManureCollected());
        ?>
						</tr>
						<tr>
							<td><?php 
        echo $observation->getAttributeLabel('manure_collection');
        ?>
</td>
							<td><?php 
        echo HTMLPurifier::process($observation->manure_collection);
        ?>
						</tr>
						<tr>
							<td><?php 
        echo $observation->getAttributeLabel('manure_size');
        ?>
</td>
							<td><?php 
        echo Html::encode($observation->getManureSize());
        ?>
						</tr>
						<tr>
							<td><?php 
        echo $observation->getAttributeLabel('manure_quantity');
        ?>
コード例 #17
0
ファイル: detail.php プロジェクト: ThijsBosch/batboxes
?>
" alt="box_picture">
		</div>
	</div>
	
	<?php 
if ($box->remarks) {
    ?>
		<div class="row">
			<div class="col-xs-12">
				<h2><?php 
    echo $box->getAttributeLabel('remarks');
    ?>
</h2>
				<?php 
    echo HTMLPurifier::process($box->remarks);
    ?>
			</div>
		</div>
	<?php 
}
?>
	
	<div class="row">
		<div class="col-xs-12">
			<h2><?php 
echo $box->getAttributeLabel('location');
?>
</h2>
			<div id="map" style="width: 100%; height: 250px;"></div>
			<script src="https://maps.googleapis.com/maps/api/js?v=3&libraries=geometry"></script> 
コード例 #18
0
 /**
  * 富文本过滤
  * @param $content
  * @param array $params
  *
  * @return string
  * @throws CMSException
  */
 public static function HTMLPurify($content, $params = array())
 {
     if (!is_array($params)) {
         throw new CMSException('params 参数类型错误!', -1);
     }
     if (isset($params['Attr.AllowedFrameTargets'])) {
         $params['Attr.AllowedFrameTargets'] = array('_blank');
     }
     return HTMLPurifier::process($content, $params);
 }
コード例 #19
0
ファイル: Venue.php プロジェクト: rajanishtimes/partnerapi
 /**
  * @inheritdocredirecturl
  */
 public function rules()
 {
     return [[['name', 'cityId', 'zoneId', 'localityId', 'venueType', 'address', 'gpsLat', 'gpsLong'], 'required'], [['categoryId', 'cityId', 'capacity', 'IsReccomended', 'status', 'flag', 'createdBy', 'updatedBy', 'csvUpload'], 'integer'], [['tollfree'], 'string', 'min' => 11, 'max' => 11], [['description'], 'string'], [['startTime', 'endTime', 'createdOn', 'updatedOn', 'state', 'brand', 'mall', 'csvRemarks'], 'safe'], [['name', 'address', 'landmark', 'contactName', 'email'], 'string', 'min' => 6, 'max' => 128], [['url', 'facebookUrl', 'seatType', 'reservationInfo', 'oldGuid', 'guid'], 'string', 'min' => 6, 'max' => 100], [['ip'], 'string', 'max' => 20], [['name'], 'filter', 'filter' => 'trim'], ['name', 'common\\validators\\AlphanumericValidator'], ['email', 'email'], [['gpsLat'], 'number', 'max' => 91], [['gpsLong'], 'number', 'max' => 181], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['tollfree', 'common\\validators\\NumberValidator'], ['url', 'url'], ['facebookUrl', 'url'], [['name', 'description'], 'filter', 'filter' => function ($value) {
         // here we are using HTML purifier
         return HTMLPurifier::process($value);
     }], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
 }