예제 #1
0
 private function clonePageLangData($source_id, $target_id)
 {
     //echo 'run cloning';
     foreach (WebAPL\Language::getList() as $lang) {
         $source = PostLang::where(array('lang_id' => $lang->id, 'post_id' => $source_id))->get()->first();
         $target = PostLang::where(array('lang_id' => $lang->id, 'post_id' => $target_id))->get()->first();
         if ($source && $target) {
             $target->title = $source->title;
             $target->uri = PostLang::uniqURI($source_id, $source->uri);
             $target->save();
         } else {
             throw new Exception("Undefined source or target on cloning: source#{$source_id}, target#{$target_id}");
         }
     }
 }
예제 #2
0
파일: main.php 프로젝트: vcorobceanu/WebAPL
" class="navbar-brand">
                                <img src="<?php 
echo res('assets/img/logo.png');
?>
" style="margin-right: 128px;" alt="">
                            </a>
                        </header>
                        <div class="topnav">
                            <div class="btn-group">
                                <a data-placement="bottom" data-original-title="Fullscreen" data-toggle="tooltip" class="btn btn-default btn-sm" id="toggleFullScreen">
                                    <i class="glyphicon glyphicon-fullscreen"></i>
                                </a>
                            </div>
                            <div class="btn-group">
                                <?php 
foreach (WebAPL\Language::getList() as $lang) {
    ?>
                                    <a data-placement="bottom" data-original-title="E-mail" data-toggle="tooltip" href="<?php 
    echo url("home/changelang/" . $lang->ext);
    ?>
" class="btn btn-default btn-sm <?php 
    echo $lang->id == WebAPL\Language::getId() ? 'active' : '';
    ?>
">
                                        <?php 
    echo strtoupper($lang->ext);
    ?>
                                    </a>
                                <?php 
}
?>