plugin.xml.php 840 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. define('IN_T',true);
  3. require("../../../source/include/init.php");
  4. $arr = array();
  5. $refer = $_SERVER['HTTP_REFERER'];
  6. if (!empty($refer)) {
  7. $viewid = substr($refer,strrpos($refer,"/")+1);
  8. $custom_right = $Db->query('SELECT p.custom_right_button FROM '.$Base->table('pano_config').' p LEFT JOIN '.$Base->table('worksmain').' w ON p.pk_works_main = w.pk_works_main WHERE w.view_uuid = "'.$viewid.'"',"One");
  9. if (!empty($custom_right)) {
  10. $arr = $Json->decode($custom_right);
  11. $arr = $arr['linkSettings'];
  12. }
  13. }
  14. foreach ($arr as &$v) {
  15. $v['name'] = Common::guid(16);
  16. if (Common::is_mobile($v['content'])) {
  17. $v['content'] = 'tel://'.$v['content'];
  18. }else if(!(strpos("http://",$v['content'])===0)){
  19. $v['content'] = 'http://'.$v['content'];
  20. }
  21. }
  22. $tp->assign('arr',$arr);
  23. $tp->display('plugin.xml');
  24. ?>