Skip to content

Commit

Permalink
Merge pull request #1552 from RyanThompson/feature/initial_folder_con…
Browse files Browse the repository at this point in the history
…tents

Feature/initial folder contents
  • Loading branch information
jerel committed Jul 24, 2012
2 parents 9a77abb + d7f0d55 commit 0efb533
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions system/cms/modules/files/controllers/admin.php
Expand Up @@ -104,6 +104,18 @@ public function new_folder()
echo json_encode($result);
}

/**
* Set the initial folder ID to load contents for
*
* Accepts the parent id and sets it as flash data
*/
public function initial_folder_contents($id)
{
$this->session->set_flashdata('initial_folder_contents', $id);

redirect(site_url('admin/files'));
}

/**
* Get all files and folders within a folder
*
Expand Down
12 changes: 11 additions & 1 deletion system/cms/modules/files/views/admin/index.php
Expand Up @@ -134,4 +134,14 @@
</ul>
</div>

</section>
</section>

<?php if ( $this->session->flashdata('initial_folder_contents') ): ?>
<script type="text/javascript">
$(document).ready(function(){

// Load the flash data ID
setTimeout(function(){pyro.files.folder_contents(<?php echo $this->session->flashdata('initial_folder_contents'); ?>);}, '1000');
});
</script>
<?php endif; ?>

0 comments on commit 0efb533

Please sign in to comment.