<?php if (!defined('OC_ADMIN') || OC_ADMIN !== true) { exit('Access is not allowed.'); } $dao_preference = new Preference(); $webid = Params::getParam('webid'); $option = Params::getParam('option'); if ($option == 'stepone') { $dao_preference->update(array("s_value" => $webid), array("s_section" => "plugin-yandex_maps", "s_name" => "yandex_maps_key")); echo '<div style="text-align:center; font-size:22px; background-color:#00bb00;"><p>' . __('Congratulations. The plugin is now configured', 'yandex_map') . '.</p></div>'; } else { $webid = osc_yandex_map_key(); } ?> <form action="<?php osc_admin_base_url(true); ?> " method="get"> <input type="hidden" name="page" value="plugins" /> <input type="hidden" name="action" value="renderplugin" /> <input type="hidden" name="file" value="yandex_maps/admin.php" /> <input type="hidden" name="option" value="stepone" /> <div> <p> <?php _e('Please enter your Yandex.Map ', 'yandex_maps'); ?> <label for="id" style="font-weight: bold;"><?php _e('API key', 'yandex_maps');
<script src="http://api-maps.yandex.ru/1.1/index.xml?key=<?php echo osc_yandex_map_key(); ?> " type="text/javascript"></script> <div style="width: 100%; float:left; margin:20px 0 10px 0px"> <div id="itemMap" style="width: 100%; height: 300px; width: 600px;"></div> </div> <script type="text/javascript"> <?php $addr = array(); if ($item['s_zip'] != '' && $item['s_zip'] != null) { $addr[] = $item['s_zip']; } if ($item['s_country'] != '' && $item['s_country'] != null) { $addr[] = $item['s_country']; } if ($item['s_region'] != '' && $item['s_region'] != null) { $addr[] = $item['s_region']; } if ($item['s_city'] != '' && $item['s_city'] != null) { $addr[] = $item['s_city']; } if ($item['s_address'] != '' && $item['s_address'] != null) { $addr[] = $item['s_address']; } $address = implode(", ", $addr); ?> YMaps.jQuery(function () { // Создание экземпляра карты и его привязка к созданному контейнеру