function getTranslated($l = null) { $T = $this->get($l); if (!(string) $T) { foreach (L::all() as $l) { $T = $this->get($l); if ((string) $T) { break; } } } return $T; }
function getTranslated($lang = null) { if ($lang === null) { $lang = L(); } $T = $this->get($lang); if (!$T->get()) { foreach (L::all() as $l) { if ($l === $lang) { continue; } $T = $this->get($l); if ((string) $T) { break; } } } return $T; }
static function colAddRight($pid, $col) { $Cont = Page($pid); $cols = min((int) $Cont->SET['cols']->v, 15); $rows = min((int) $Cont->SET['rows']->v, 100); $cols = max($cols, 1); $rows = max($rows, 1); for ($i = 0; $i < $rows; $i++) { $r = $rows - 1 - $i; for ($c = $cols - 1; $c; $c--) { if ($c > $col) { $T1 = $Cont->text($r . '_' . $c); $T2 = $Cont->text($r . '_' . ($c + 1)); foreach (L::all() as $l) { $T2->get($l)->set($T1->get($l)); $T1->get($l)->set(''); } } } } $Cont->SET['cols'] = $cols + 1; }
<?php } ?> <?php } ?> <?php } ?> <?php if (count(L::all()) > 1) { ?> <li> <span class=item style="padding:6px 16px; text-align:right"> <?php foreach (L::all() as $l) { if (L() === $l) { continue; } ?> <a href="<?php echo Url()->addParam('changeLanguage', $l); ?> "><?php echo $l; ?> </a> <?php } ?> </span>
function urlsSeoGen() { foreach (L::all() as $l) { $this->urlSeoGen($l); } }