コード例 #1
0
ファイル: manageapppriv.html.php プロジェクト: leowh/colla
                if (validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 1, 1))) {
                    $rightName .= strtoupper(substr($name, 1, 1));
                }
                ?>
              <?php 
                if (validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 1, 1))) {
                    $rightName .= strtoupper(substr($name, 1, 3));
                }
                ?>
              <?php 
                if (!validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 3, 1))) {
                    $rightName .= strtoupper(substr($name, 3, 1));
                }
                ?>
              <?php 
                if (!validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 3, 1))) {
                    $rightName .= substr($name, 3, 3);
                }
                ?>
              <i class='icon icon-default' style="background-color: hsl(<?php 
                echo $right['id'] * 47 % 360;
                ?>
, 100%, 40%)"> <span><?php 
                echo $rightName;
                ?>
 </span></i>
              <?php 
            }
            ?>
              <?php 
            echo html::checkbox('apps', array($code => $right['name']), $right['right'] == '1' ? $code : '');
コード例 #2
0
ファイル: control.php プロジェクト: leowh/colla
 /**
  * Print block. 
  * 
  * @param  int    $index 
  * @access public
  * @return void
  */
 public function printBlock($index)
 {
     $block = $this->block->getBlock($index);
     if (empty($block)) {
         return false;
     }
     $html = '';
     if ($block->block == 'html') {
         $html = "<div class='article-content'>" . htmlspecialchars_decode($block->params->html) . '</div>';
     } elseif ($block->block == 'rss') {
         $html = $this->block->getRss($block);
     } elseif ($block->source != '') {
         $html = $this->block->getEntry($block);
     } elseif ($block->block == 'allEntries') {
         $entries = $this->loadModel('entry')->getEntries();
         $html = "<div id='allEntriesBlock' class='all-entries'><table class='table'><tr>";
         foreach ($entries as $entry) {
             $class = !$entry->buildin ? "class='iframe'" : '';
             $size = $entry->size != 'max' ? json_decode($entry->size) : '';
             $width = isset($size->width) ? "width={$size->width}" : '';
             $height = isset($size->height) ? "height={$size->height}" : '';
             $image = html::image($entry->logo, "width=18");
             if (!$entry->logo) {
                 $hue = $entry->id * 47 % 360;
                 $name = $entry->abbr ? $entry->abbr : $entry->name;
                 $entryName = validater::checkCode(substr($name, 0, 1)) ? strtoupper(substr($name, 0, 1)) : substr($name, 0, 3);
                 if (validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 1, 1))) {
                     $entryName .= strtoupper(substr($name, 1, 1));
                 }
                 if (validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 1, 1))) {
                     $entryName .= strtoupper(substr($name, 1, 3));
                 }
                 if (!validater::checkCode(substr($name, 0, 1)) and validater::checkCode(substr($name, 3, 1))) {
                     $entryName .= strtoupper(substr($name, 3, 1));
                 }
                 if (!validater::checkCode(substr($name, 0, 1)) and !validater::checkCode(substr($name, 3, 1))) {
                     $entryName .= substr($name, 3, 3);
                 }
                 $image = "<i class='icon icon-default' style='background-color: hsl({$hue}, 100%, 40%)'> <span>" . $entryName . "</span></i> ";
             }
             $html .= "<td class='pull-left' width='33%'>" . html::a($entry->login, $image . $entry->name, "{$class} {$width} {$height}") . "</td>";
         }
         $html .= "</tr></table></div>";
     } elseif ($block->block == 'dynamic') {
         $html = $this->fetch('block', 'dynamic');
     }
     die($html);
 }