コード例 #1
0
ファイル: Cabinet.php プロジェクト: HaldunA/phpwebsite
 public static function getTag($id)
 {
     PHPWS_Core::initModClass('filecabinet', 'File_Assoc.php');
     $file_assoc = new FC_File_Assoc($id);
     return $file_assoc->getTag();
 }
コード例 #2
0
ファイル: update.php プロジェクト: HaldunA/phpwebsite
function moveBlockImages()
{
    require_once PHPWS_SOURCE_DIR . 'core/class/Form.php';
    require_once PHPWS_SOURCE_DIR . 'mod/block/class/Block_Item.php';
    require_once PHPWS_SOURCE_DIR . 'mod/filecabinet/class/File_Assoc.php';
    require_once PHPWS_SOURCE_DIR . 'mod/filecabinet/class/Cabinet.php';
    $db = Database::newDB();
    $block = $db->addTable('block');
    $db->setConditional($block->getFieldConditional('file_id', 0, '>'));
    $db->loadSelectStatement();
    while ($block = $db->fetchObject('Block_Item')) {
        $file = new FC_File_Assoc($block->file_id);
        $file->_use_style = false;
        $tag = $file->getTag();
        $old_content = $block->getContent();
        $new_content = "<div>{$tag}</div>" . $old_content;
        $block->setContent($new_content);
        $block->save();
    }
}