本文整理汇总了PHP中Area类的典型用法代码示例。如果您正苦于以下问题:PHP Area类的具体用法?PHP Area怎么用?PHP Area使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Area类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PlantillaEncabezado
function PlantillaEncabezado($title)
{
$area = new Area($_SESSION['session'][5]);
?>
<table id="cabecera" cellpadding="0" cellspacing="0" width="100%" style="margin:0px;">
<tr>
<td class="superior"><img src="public_root/imgs/cabecera.jpg" alt="cabecera" border="0" style="margin:0px" width="1000" height="80"/> </td>
</tr>
<tr>
<td class="vertical_line">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="home"> </td>
<td align="left" class="usuario"><?php
echo ucwords($_SESSION['session'][1]);
?>
</td>
<td align="center" class="titulo"><?php
echo $title;
?>
- <?php
echo $area->getNombre();
?>
</td>
<td align="right" class="cerrar_sesion"><a href="#" onclick="javascript:eliminar_sesion()">CERRAR SESION</a></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
示例2: getCommentCountString
/**
* Returns a formatted text for the number of comments in the first comment block in the "Entry Comments" area
* @param string $singular_format
* @param string $plural_format
* @param string $disabled_message
* @return string
*/
public function getCommentCountString($singular_format, $plural_format, $disabled_message = '')
{
$count = 0;
$comments_enabled = false;
$c = $this->getCollectionObject();
$a = new Area('Blog Post Footer');
$blocks = $a->getAreaBlocksArray($c);
if (is_array($blocks) && count($blocks) > 0) {
foreach ($blocks as $b) {
if ($b->getBlockTypeHandle() == 'guestbook') {
$controller = $b->getInstance();
$count = $controller->getEntryCount($c->getCollectionID());
$comments_enabled = true;
break;
// stop at the fist guestbook block found
}
}
}
if ($comments_enabled) {
$format = $count == 1 ? $singular_format : $plural_format;
return sprintf($format, $count);
} else {
return $disabled_message;
}
}
示例3: deleting
/**
* @param Area $area
*/
public function deleting(Area $area)
{
$area->groups->each(function ($m) {
$m->delete();
});
$area->categories()->delete();
$area->sponsors()->detach();
}
示例4: insert
/**
* Inseri um registro na tabela
*
* @parametro TematicaMySql tematica
*/
public function insert(Area $area)
{
$sql = "INSERT INTO {$this->table} (nome) VALUES ( :nome)";
$nome = $area->getNome();
$stmt = ConnectionFactory::prepare($sql);
$stmt->bindParam(':nome', $nome);
return $stmt->execute();
}
示例5: listaroptions
function listaroptions()
{
$id = $_REQUEST['id'];
$area = new Area();
$data = $area->listadoOptionsarea($id);
$tot = count($data);
for ($i = 0; $i < $tot; $i++) {
echo '<option value="' . $data[$i]['idarea'] . '">' . $data[$i]['nombre'];
}
}
示例6: cargar
/**
*
* @param desde
* @param numeroElementos
*/
public function cargar($desde = 0, $numeroElementos = 0)
{
$db = FabricaBaseDatos::crear();
$select = $db->select()->from('area')->limit($numeroElementos, $desde);
$rows = $db->fetchAll($select);
foreach ($rows as $row) {
$unArea = new Area($row['id_area']);
$unArea->set_nombre($row['nombre']);
$unArea->set_descripcion($row['descripcion']);
array_push($this->_elementos, $unArea);
}
return true;
}
示例7: getAreaHelper
/**
* @return Area
*/
protected function getAreaHelper()
{
if (null === $this->areaHelper) {
if (method_exists($this->view, 'plugin')) {
$this->areaHelper = $this->view->plugin($this->defaultAreaHelper);
}
if (!$this->areaHelper instanceof Area) {
$this->areaHelper = new Area();
$this->areaHelper->setView($this->getView());
}
}
return $this->areaHelper;
}
示例8: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
$rules = array("areaId" => "required", "areaName" => "required");
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('/area/create')->withErrors($validator);
}
//
$area = new Area();
$area->areaID = Input::get('areaId');
$area->areaName = Input::get('areaName');
$area->save();
return Redirect::to('/area');
}
示例9: cargar
/**
*
* @param desde
* @param numeroElementos
*/
public function cargar($desde = 0, $numeroElementos = 0)
{
if ($this->_idUsuario) {
$db = FabricaBaseDatos::crear();
$select = $db->select()->from('v_usuario_area')->limit($numeroElementos, $desde)->where('id_usuario = ?', $this->_idUsuario);
$rows = $db->fetchAll($select);
foreach ($rows as $row) {
$unArea = new Area($row['id_area']);
$unArea->set_nombre($row['nombre_area']);
$unArea->set_descripcion($row['descripcion_area']);
$this->_areas->add($unArea);
}
}
return true;
}
示例10: actionGet_route
public function actionGet_route()
{
$criteria = new CDbCriteria();
$criteria->limit = 8;
$area = Area::model()->findAll($criteria);
$html = '<ul class="local_trip_pro" id="local_trip_content_list" data-blockid="recommend_localjoin">';
for ($j = 0; $j < count($area); $j++) {
if ($j) {
$html .= '<li class="local_trip_pro_li wq_clearfix hide" data-content="lj' . $j . '" style="display:none;">';
} else {
$html .= '<li class="local_trip_pro_li wq_clearfix" data-content="lj' . $j . '">';
}
$criteria1 = new CDbCriteria();
$criteria1->condition = "(style & 4) !=0";
$criteria1->addCondition('area ="' . $area[$j]->name . '"', 'AND');
$criteria1->limit = 3;
$route = Route::model()->findAll($criteria1);
for ($i = 0; $i < count($route); $i++) {
if ($i) {
$html .= '<a class="local_trip_right img_slide_animte_wrapper" href="';
} else {
$html .= '<a class="local_trip_left_l img_slide_animte_wrapper" href="';
}
if ($i) {
$html .= '#" target="_blank"> <img class="local_trip_img_s img_slide_animte first_page" src="' . $route[$i]->source . '" data-original="' . $route[$i]->source . '" style="display: block;"> <span class="local_trip_mask_s"></span> <span class="local_trip_txt_s" title="' . $route[$i]->name . '">' . $route[$i]->name . '</span>' . '<span class="local_trip_price_s font_size12"><span class="font_size16">' . $route[$i]->price . '</span>元/人起</span></a>';
} else {
$html .= '#" target="_blank"> <img class="local_trip_img_l img_slide_animte first_page" alt=" ' . $route[$i]->name . '" src="' . $route[$i]->source . '" data-original="' . $route[$i]->source . '" style="display: block;"> <span class="local_trip_mask_l"></span> <span class="local_trip_bl"></span><span class="local_trip_txt_l" title="' . $route[$i]->name . '">' . $route[$i]->name . '</span>' . '<span class="local_trip_price_l font_size14 font_color_orange"><span class="font_size28">' . $route[$i]->price . '</span>元/人起</span></a>';
}
}
$html .= '</li>';
}
$html .= '</ul>';
echo $html;
}
示例11: actionWeather
/**
* 根据地区woeid获取雅虎天气
* 获取woeid http://sugg.us.search.yahoo.net/gossip-gl-location/?appid=weather&output=xml&command=地名(如香港)
* 匹配规则:preg_match('/woeid=(\d+)\&lon=.*?\&lat=.*?\&s=.*?\&c=.*?\&country_woeid/si', $_return,$match);
* 获取天气:https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.media.weather%20where%20woeid%20in(12523356%2C90717580%2C20069923)&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=
*/
public function actionWeather()
{
ini_set('memory_limit', '256M');
ini_set('max_execution_time', '1800');
$areas = Area::model()->findAll(array('select' => 'woeid', 'condition' => 'woeid>0 AND theorder=3'));
$woeids = array_keys(CHtml::listData($areas, 'woeid', ''));
$woeidsStr = join(',', $woeids);
$dir = Yii::app()->basePath . '/runtime/weather';
$totalDir = $dir . '/total.log';
zmf::createUploadDir($dir);
$start = microtime(true);
if ($woeidsStr != '') {
$url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.media.weather%20where%20woeid%20in({$woeidsStr})&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env";
$json = zmf::curlget($url);
file_put_contents($totalDir, $json);
}
$dataArr = CJSON::decode($json, true);
$data = $dataArr['query'];
if (!$data) {
exit('Failed');
}
$results = $data['results']['result'];
$detailDir = $dir . '/detail/';
zmf::createUploadDir($detailDir);
foreach ($results as $result) {
if ($result['location']['woeid']) {
$_dir = $detailDir . $result['location']['woeid'] . '.log';
file_put_contents($_dir, CJSON::encode($result));
}
}
echo microtime(true) - $start . '--<br/>';
}
示例12: getList
public static function getList()
{
$model = Area::model();
$command = $model->getDbConnection()->CreateCommand();
$tableName = $model->tableName();
return $command->select()->from($tableName)->order('create_time DESC')->queryAll();
}
示例13: getInstance
public static function getInstance()
{
if (!Area::$instance) {
Area::$instance = new Area();
}
return Area::$instance;
}
示例14: get_layout_blocks
private function get_layout_blocks($cObj, $aHandle)
{
$blocks = array();
$area = new Area($aHandle);
$layouts = $area->getAreaLayouts($cObj);
//returns empty array if no layouts
foreach ($layouts as $layout) {
$maxCell = $layout->getMaxCellNumber();
for ($i = 1; $i <= $maxCell; $i++) {
$cellAreaHandle = $layout->getCellAreaHandle($i);
$cellBlocks = $cObj->getBlocks($cellAreaHandle);
$blocks = array_merge($blocks, $cellBlocks);
}
}
return $blocks;
}
示例15: setPermissionObject
public function setPermissionObject(Area $a)
{
$ax = $a;
if ($a->isGlobalArea()) {
$cx = Stack::getByName($a->getAreaHandle());
$a = Area::get($cx, STACKS_AREA_NAME);
}
$this->permissionObject = $a;
// if the area overrides the collection permissions explicitly (with a one on the override column) we check
if ($a->overrideCollectionPermissions()) {
$this->permissionObjectToCheck = $a;
} else {
if ($a->getAreaCollectionInheritID() > 0) {
// in theory we're supposed to be inheriting some permissions from an area with the same handle,
// set on the collection id specified above (inheritid). however, if someone's come along and
// reverted that area to the page's permissions, there won't be any permissions, and we
// won't see anything. so we have to check
$areac = Page::getByID($a->getAreaCollectionInheritID());
$inheritArea = Area::get($areac, $a->getAreaHandlE());
if (is_object($inheritArea) && $inheritArea->overrideCollectionPermissions()) {
// okay, so that area is still around, still has set permissions on it. So we
// pass our current area to our grouplist, userinfolist objects, knowing that they will
// smartly inherit the correct items.
$this->permissionObjectToCheck = $inheritArea;
}
}
if (!$this->permissionObjectToCheck) {
$this->permissionObjectToCheck = $a->getAreaCollectionObject();
}
}
}