Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
keyword_extraction.php
1 <?php
16  define('SQ_SYSTEM_ROOT', dirname(dirname(dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])))))));
17  require_once SQ_SYSTEM_ROOT.'/core/include/init.inc';
18  require_once SQ_SYSTEM_ROOT.'/core/lib/html_form/html_form.inc';
19  if (!isset($_GET['assetid'])) return FALSE;
20 
21  assert_valid_assetid($_GET['assetid']);
22  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($_GET['assetid']);
23  if (is_null($asset) || !$asset->writeAccess()) exit();
24 ?>
25 
26 <html>
27  <head>
28  <title>'<?php echo $asset->attr('name') ?>' Keyword Extraction</title>
29  <style>
30  body {
31  background-color: #FFFFFF;
32  }
33 
34  body, p, td, ul, li, input, select, textarea{
35  color: #000000;
36  font-family: Arial, Verdana Helvetica, sans-serif;
37  font-size: 11px;
38  }
39 
40  fieldset {
41  padding: 0px 10px 5px 5px;
42  border: 1px solid #E0E0E0;
43  }
44 
45  legend {
46  color: #2086EA;
47  }
48  </style>
49  </head>
50 
51  <body>
52  <?php
53  require_once dirname(__FILE__).'/../../../../../core/include/backend_outputter.inc';
54  $o = new Backend_Outputter();
55 
56  $o->openSection(translate('keyword_extraction_for', translate('asset_format', $asset->attr('name'), $asset->id)));
57  $o->openField('');
58  ?>
59  <p><?php echo translate('kewords_for_asset', translate('asset_format', $asset->attr('name'), $asset->id)); ?></p>
60  <p><?php echo translate('use_keywords_in_metadata_fields'); ?></p>
61 
62  <p>
63  <fieldset>
64  <legend><b><?php echo translate('extracted_keywords'); ?></b></legend>
65  <?php
66 $sm = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('search_manager');
67 if (empty($sm)) {
68  echo translate('keyword_list_not_available');
69 } else {
70 
71 $keywords = $sm->extractKeywords($asset);
72 print implode(', ', $keywords);
73 }
74 ?>
75  </fieldset>
76  </p>
77 <?php
78 $o->openField('', 'commit');
79 normal_button('cancel', translate('close_window'), 'window.close()');
80 $o->closeSection();
81 $o->paint();
82 ?>
83  </body>
84 </html>