本文整理汇总了PHP中Layout::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::getByID方法的具体用法?PHP Layout::getByID怎么用?PHP Layout::getByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::getByID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFile
static function getFile($id)
{
$l = new Layout();
$l->getByID($id);
if ($l->layout_file != "") {
return $l->layout_file;
} else {
return 0;
}
}
示例2: t
}
}
if (!$validLayout || !$cp->canEditPageContents() || !$ap->canAddLayoutToArea()) {
$jsonData['msg'] = t('Access Denied.');
} elseif (!is_object($layout)) {
$jsonData['msg'] = t('Error: Layout not found');
} else {
switch ($_GET['task']) {
case 'lock':
$layout->locked = intval($_REQUEST['lock']) ? 1 : 0;
$saved = $layout->save();
$jsonData['success'] = intval($saved);
break;
case 'move':
$cvalID = intval($_REQUEST['cvalID']);
$layout = Layout::getByID($_REQUEST['layoutID']);
$db = Loader::db();
$direction = $_REQUEST['direction'];
// Get array of layouts for the current (published) page
//$oldLayouts = $a->getAreaLayouts($c);
// Get array of layouts for the working (unsaved) page
$newLayouts = $a->getAreaLayouts($nvc);
// Iterate through layouts, looking for the one we need to change
for ($i = 0; $i < count($newLayouts); $i++) {
$layout = $newLayouts[$i];
// Check if this layout is the one we need to change
if ($layout->areaNameNumber == $_REQUEST['areaNameNumber']) {
// If so, adjust the position values
if ($direction == 'up' && $i > 0) {
$prevLayout = $newLayouts[$i - 1];
$layout->position = $prevLayout->position;
示例3: simpan
function simpan()
{
// pr($_POST);
$succ = 0;
$id = tin($_POST['id']);
$val = tin($_POST['val']);
$l = new Layout();
$l->getByID($id);
if ($l->layout_file != "") {
$l->layout_file = $val;
$l->load = 1;
$succ = $l->save();
} else {
$l1 = new Layout();
$l1->layout_id = $id;
$l1->layout_file = $val;
$succ = $l1->save();
}
if ($succ) {
echo Lang::t("Success");
} else {
echo Lang::t("Failed");
}
}