Example #1
0
 public static function getArticle()
 {
     $file = File::getFiles(ROOT_PATH . self::ARTICLE_DIR, true);
     usort($file, function ($a, $b) {
         $a = explode('.', $a);
         $b = explode('.', $b);
         return intval($a[0]) > intval($b[0]) ? -1 : 1;
     });
     $result = array();
     foreach ($file as $f) {
         $c = File::read(ROOT_PATH . self::ARTICLE_DIR . '/' . $f);
         $c = json_decode($c, true);
         $tmp = array('id' => $f, 'title' => Crypt::DeCrypt($c['title'], uniqid()));
         $result[] = $tmp;
     }
     return $result;
 }
Example #2
0
File: lint.php Project: rsms/phpab
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
require_once '../lib/base/boot.php';
$php = Process::resolveBinary('php');
$lib = new File('../lib');
$allOK = true;
$scrollTo = '<script type="text/javascript">window.scrollTo(0,100000);</script>';
foreach ($lib->getFiles(true) as $file) {
    $path = $file->getAbsolutePath();
    if (strrchr($path, '.') == '.php') {
        $cmd = "{$php} -l '{$path}' 2>&1";
        #print "$cmd<br />";
        $out = `{$cmd}`;
        $shortPath = basename(dirname($path)) . '/' . basename($path);
        if (strpos($out, 'No syntax errors') !== false) {
            print '<span style="color:#8c8">' . $shortPath . '</span><br />';
        } else {
            print '<span style="color:#a00">' . $shortPath . '</span><br />' . '<pre style="border:1px solid #ddd;padding:7px;margin-bottom:10px;">' . htmlentities($out) . '</pre>';
            $allOK = false;
        }
        print $scrollTo;
        flush();
    }
Example #3
0
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
</section>
<section>
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                 <div class="masonry-items">
                    <?php 
$file = new File();
$dir = root . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR . "gallery";
$files = $file->getFiles(realpath($dir));
foreach ($files as $file) {
    ?>
                        <div class="masonry-item item">
                            <div class="thumb">
                                <img class="img-responsive" src="<?php 
    echo Comman::getController("dynamicImage");
    ?>
?src=<?php 
    echo Comman::getUrlByDirectoryPath($dir) . DS . $file;
    ?>
&w=370&h=277&zc=0" alt="featured project"  width="476">
                            </div>
                            <div class="overlay text-center">
                                <div class="display-table">
                                    <div class="display-table-cell"><i class="fa fa-link"></i></div>
<?php

// This is the file library shown on User profile
$dir = new File();
$path = User::USER_DIR . $model->id;
$files = $dir->getFiles($path, 1);
$count = 0;
$imgExtentions = array('jpeg', '.png', '.jpg', '.gif', '.png');
$ignore = array('.tmb', '.dll');
$items = array();
foreach ($files as $file) {
    $fileExt = strtolower(substr($file, -4, 4));
    if (!is_dir('.' . $path . '/' . $file)) {
        $fileName = $file;
        if (in_array($fileExt, $imgExtentions)) {
            //$fileName = '<img  style="min-width: 150px; min-height="100px" src="' . $path .'/'. $file . '" alt="picture"/>';
            $items[] = array('image' => $path . '/' . $file, 'label' => $file, 'caption' => '');
        }
        if (!in_array($fileExt, $ignore)) {
            /*echo '<li class="span2" style="display:inline">';
            			echo CHtml::link( $fileName, array( $path . '/' . $file ),array( 'class'=>'filename thumbnail', 'rel'=>'fancybox' ) );
            		echo '</li>';*/
        }
        $count++;
    }
}
$this->widget('bootstrap.widgets.BootCarousel', array('items' => $items, 'events' => array('slide' => "js:function() { console.log('Carousel slide.'); }", 'slid' => "js:function() { console.log('Carousel slid.'); }")));
 function getFiles($id_fk, $wf_type = 'transaction')
 {
     return parent::getFiles($id_fk, $this->getType());
 }