示例#1
0
 public function __construct($type)
 {
     // confirm message
     self::$confirm_message = sprintf(' onclick = "return confirm(\'%s\');"', __('You are about to overwrite existing translations. Are you sure?', 'wp-lingotek'));
     // row actions
     self::$actions = array('upload' => array('action' => __('Upload to Lingotek', 'wp-lingotek'), 'progress' => __('Uploading...', 'wp-lingotek'), 'description' => __('Upload this item to Lingotek TMS', 'wp-lingotek')), 'request' => array('action' => __('Request translations', 'wp-lingotek'), 'progress' => __('Requesting translations...', 'wp-lingotek'), 'description' => __('Request translations of this item to Lingotek TMS', 'wp-lingotek')), 'status' => array('action' => __('Update translations status', 'wp-lingotek'), 'progress' => __('Updating translations status...', 'wp-lingotek'), 'description' => __('Update translations status of this item in Lingotek TMS', 'wp-lingotek')), 'download' => array('action' => __('Download translations', 'wp-lingotek'), 'progress' => __('Downloading translations...', 'wp-lingotek'), 'description' => __('Download translations of this item from Lingotek TMS', 'wp-lingotek')), 'delete' => array('action' => __('Disassociate translations', 'wp-lingotek'), 'progress' => __('Disassociating translations...', 'wp-lingotek'), 'description' => __('Disassociate the translations of this item from Lingotek TMS', 'wp-lingotek')));
     // action icons
     self::$icons = array('upload' => array('title' => __('Upload Now', 'wp-lingotek'), 'icon' => 'upload'), 'importing' => array('title' => __('Importing source', 'wp-lingotek'), 'icon' => 'clock'), 'uploaded' => array('title' => __('Source uploaded', 'wp-lingotek'), 'icon' => 'yes'), 'request' => array('title' => __('Request a translation', 'wp-lingotek'), 'icon' => 'plus'), 'pending' => array('title' => __('In Progress', 'wp-lingotek'), 'icon' => 'clock'), 'ready' => array('title' => __('Ready to download', 'wp-lingotek'), 'icon' => 'download'), 'current' => array('title' => __('Current', 'wp-lingotek'), 'icon' => 'edit'), 'not-current' => array('title' => __('The target translation is no longer current as the source content has been updated', 'wp-lingotek'), 'icon' => 'edit'), 'error' => array('title' => __('There was an error contacting Lingotek', 'wp-lingotek'), 'icon' => 'warning'));
     $this->type = $type;
     $this->pllm = $GLOBALS['polylang']->model;
     $this->lgtm = $GLOBALS['wp_lingotek']->model;
     add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
     foreach (array_keys(self::$actions) as $action) {
         add_action('wp_ajax_lingotek_progress_' . $this->type . '_' . $action, array(&$this, 'ajax_' . $action));
     }
 }