tab.client.php 878 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. global $_,$myUser,$conf;
  3. User::check_access('client','read');
  4. Plugin::need('client/Client');
  5. require_once(__DIR__.SLASH.'Element.class.php');
  6. $client = Client::getById($_['id']);
  7. $relativeDirectory = empty($conf->get('document_client_directory')) ? 'Clients'.SLASH.'{{slug}}' : $conf->get('document_client_directory');
  8. $relativeDirectory = str_replace('{{slug}}',$client->slug,$relativeDirectory);
  9. $clientDirectory = Element::root().$relativeDirectory;
  10. if(!file_exists($clientDirectory)) mkdir($clientDirectory,0755,true);
  11. $element = Element::fromPath($clientDirectory);
  12. $element->author = $myUser->login;
  13. $element->save();
  14. ?>
  15. <div class="p-2">
  16. <div style="background-color: #ffffff;" data-type="library"
  17. data-root-label="C:"
  18. data-root="<?php echo $relativeDirectory;?>"
  19. data-tree-panel="false"
  20. data-search-panel="true"
  21. data-detail-panel="true"
  22. ></div>
  23. </div>