/**
  * Saves newOptions to database and sets/caches current options for direct usage
  * respects multiuser
  *
  * @param array $newOptions
  */
 public static function updateUserOptions($newOptions = array())
 {
     if (!is_user_logged_in()) {
         return;
     }
     if (empty($newOptions)) {
         $newOptions = self::toArray();
     } else {
         $newOptions = wp_parse_args($newOptions, self::toArray());
     }
     $user = wp_get_current_user();
     $key = sprintf("%s%s", $user->ID, self::KEYS_IDENTIFIER);
     $oldOptions = get_option($key, false);
     if ($newOptions != $oldOptions) {
         update_option($key, $newOptions);
         self::$_options = $newOptions;
     }
 }
 /**
  * Returns content of current file
  *
  * @return string
  */
 public function getCurrentFileContent()
 {
     if (!$this->getCurrentFile()) {
         return '';
     }
     if (User_Options::LINEOUTPUTORDER_FILO == User_Options::getLineOutputOrder()) {
         $content = implode(array_reverse(file(Log_Viewer_Admin::transformFilePath($this->getCurrentFile()))));
     } else {
         $content = file_get_contents(Log_Viewer_Admin::transformFilePath($this->getCurrentFile()), false);
     }
     return $content;
 }
Example #3
0
							<dd><?php 
    echo date_i18n(get_option('date_format') . ' ' . get_option('time_format'), filemtime($realfile));
    ?>
</dd>
						</dl>
					</div>
				</div>
			</div>

		</div><!-- fileedit-sub -->

	<?php 
}
// showEditSection?
?>

	<?php 
if (User_Options::getAutoRefresh() === 1) {
    ?>
		<script type="text/javascript">
			setTimeout( "window.location.replace(document.URL);", <?php 
    echo User_Options::getAutoRefreshIntervall() * 1000;
    ?>
 );
		</script>
	<?php 
}
?>

</div>