예제 #1
0
파일: index.php 프로젝트: stuhin/phpMVC
    public function content($model)
    {
        ?>
    <!-- START CONTENT -->
    <table class="table">
      <tr>
        <td colspan="5" style="text-align: right;">
          <form action="/filetinymce/upload-file" class="form-horizontal" enctype="multipart/form-data" method="post" role="form">
            <a href="/filetinymce/create-folder/<?php 
        echo substr($model->path, 0, -1);
        ?>
" class="btn btn-default"><?php 
        echo Language::$CREATE_FOLDER[Config::$LANGUAGE];
        ?>
</a>
            <input type="hidden" name="Path" value="<?php 
        echo $model->path;
        ?>
"/>
            <input name="File" type="file" title="<?php 
        echo Language::$SELECT_FILE[Config::$LANGUAGE];
        ?>
" data-filename-placement="inside" />
            <input class="btn btn-primary" type="submit" value="<?php 
        echo Language::$SAVE_TO_SERVER[Config::$LANGUAGE];
        ?>
" />
          </form>
        </td>
      </tr>
      <tr>
        <td colspan="5">
          <span class='glyphicon glyphicon-folder-open'></span>&nbsp;&nbsp;
          <?php 
        for ($i = 0; $i < count($model->parentFolders); $i++) {
            ?>
            <?php 
            if ($i == 0) {
                ?>
              <?php 
                echo $model->parentFolders[$i][1];
                ?>
 /
            <?php 
            } else {
                if ($i < count($model->parentFolders) - 1) {
                    ?>
              <a href="<?php 
                    echo $model->parentFolders[$i][0];
                    ?>
"><?php 
                    echo $model->parentFolders[$i][1];
                    ?>
</a> /
            <?php 
                } else {
                    ?>
              <?php 
                    echo $model->parentFolders[$i][1];
                    ?>
            <?php 
                }
            }
            ?>
          <?php 
        }
        ?>
        </td>
      </tr>
      <?php 
        $i = 0;
        ?>
      <?php 
        foreach ($model->files as $file) {
            ?>
        <?php 
            if (!in_array($file, array(".", "..")) && is_dir($model->path . $file)) {
                ?>
          <tr>
            <td>
              <span class="glyphicon glyphicon-folder-close"></span>
            </td>
            <td>
              <a id="link_<?php 
                echo $i;
                ?>
" href="/filetinymce/index/<?php 
                echo $model->path . $file;
                ?>
"><?php 
                echo $file;
                ?>
</a>
              <input type="hidden" id="oldname_<?php 
                echo $i;
                ?>
" value="<?php 
                echo $file;
                ?>
"/>
              <input type="text" id="newname_<?php 
                echo $i;
                ?>
" value="<?php 
                echo $file;
                ?>
" class="form-control width_full" style="display:none;"/>
            </td>
            <td>
              <div id="rename_<?php 
                echo $i;
                ?>
" style="display:none;">
                <a class="edit" title="<?php 
                echo Language::$SAVE[Config::$LANGUAGE];
                ?>
" href="javascript:rename(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-ok"></span>
                </a>
                &nbsp;&nbsp;
                <a class="delete" title="<?php 
                echo Language::$CANCEL[Config::$LANGUAGE];
                ?>
" href="javascript:cancel(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-remove"></span>
                </a>
              </div>
              <div id="edit_<?php 
                echo $i;
                ?>
">
                <a class="edit" title="<?php 
                echo Language::$RENAME[Config::$LANGUAGE];
                ?>
" href="javascript:go_rename(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-pencil"></span>
                </a>
                &nbsp;&nbsp;
                <a class="delete" title="<?php 
                echo Language::$DELETE_FOLDER[Config::$LANGUAGE];
                ?>
" href="/filetinymce/delete-folder/<?php 
                echo $model->path . $file;
                ?>
" onclick="return confirm('<?php 
                echo Language::$ARE_YOU_SURE[Config::$LANGUAGE];
                ?>
');">
                  <span class="glyphicon glyphicon-remove"></span>
                </a>
              </div>
            </td>
            <td>
              <span><?php 
                echo date(Language::$DATE_FORMAT[Config::$LANGUAGE], filemtime($model->path . $file));
                ?>
</span>
            </td>
            <td></td>
          </tr>
          <?php 
                $i++;
                ?>
        <?php 
            }
            ?>
      <?php 
        }
        ?>
      <?php 
        foreach ($model->files as $file) {
            ?>
        <?php 
            if (is_file($model->path . $file) && FileHelper::isImage($file)) {
                ?>
          <tr>
            <td>
              <a href="javascript:get_image('<?php 
                echo Config::$SUB_FOLDER . '/' . $model->path . $file;
                ?>
')"><img src="<?php 
                echo Config::$SUB_FOLDER . '/' . $model->path . $file;
                ?>
" style="max-width:200px;max-height:100px;"/></a>
            </td>
            <td>
              <a id="link_<?php 
                echo $i;
                ?>
" href="javascript:get_image('<?php 
                echo Config::$SUB_FOLDER . '/' . $model->path . $file;
                ?>
')"><?php 
                echo $file;
                ?>
</a>
              <input type="hidden" id="oldname_<?php 
                echo $i;
                ?>
" value="<?php 
                echo $file;
                ?>
"/>
              <input type="text" id="newname_<?php 
                echo $i;
                ?>
" value="<?php 
                echo $file;
                ?>
" class="form-control width_full" style="display:none;"/>
            </td>
            <td>
              <div id="rename_<?php 
                echo $i;
                ?>
" style="display:none;">
                <a class="edit" title="<?php 
                echo Language::$SAVE[Config::$LANGUAGE];
                ?>
" href="javascript:rename(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-ok"></span>
                </a>
                &nbsp;&nbsp;
                <a class="delete" title="<?php 
                echo Language::$CANCEL[Config::$LANGUAGE];
                ?>
" href="javascript:cancel(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-remove"></span>
                </a>
              </div>
              <div id="edit_<?php 
                echo $i;
                ?>
">
                <a class="edit" title="<?php 
                echo Language::$RENAME[Config::$LANGUAGE];
                ?>
" href="javascript:go_rename(<?php 
                echo $i;
                ?>
);">
                  <span class="glyphicon glyphicon-pencil"></span>
                </a>
                &nbsp;&nbsp;
                <a class="delete" title="<?php 
                echo Language::$DELETE_FILE[Config::$LANGUAGE];
                ?>
" href="/filetinymce/delete-file/<?php 
                echo $model->path . $file;
                ?>
" onclick="return confirm('<?php 
                echo Language::$ARE_YOU_SURE[Config::$LANGUAGE];
                ?>
');">
                  <span class="glyphicon glyphicon-remove"></span>
                </a>
              </div>
            </td>
            <td>
              <span><?php 
                echo date(Language::$DATE_FORMAT[Config::$LANGUAGE], filemtime($model->path . $file));
                ?>
</span>
            </td>
            <td><?php 
                echo FileHelper::getFileSize(filesize($model->path . $file));
                ?>
</td>
          </tr>
          <?php 
                $i++;
                ?>
        <?php 
            }
            ?>
      <?php 
        }
        ?>
    </table>
    <form id="Rename" method="post" action="/filetinymce/rename">
      <input type="hidden" name="OldName" id="OldName" value=""/>
      <input type="hidden" name="NewName" id="NewName" value=""/>
      <input type="hidden" name="Path" value="<?php 
        echo $model->path;
        ?>
"/>
    </form>
    <!-- END CONTENT -->
  <?php 
    }
예제 #2
0
파일: edit.php 프로젝트: stuhin/phpMVC
 public function javascript($model)
 {
     ?>
     <?php 
     echo FileHelper::getScriptForEditFile($model->extension);
     ?>
 <?php 
 }