Example #1
0
        function display_listing_table($destinations, $edit_url, $delete_url)
        {
            ?>
			<table class="widefat">
				<thead>
				<tr class="form-field">
					<th class="snapshot-col-delete"><?php 
            _e('Delete', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-name"><?php 
            _e('Name', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-server"><?php 
            _e('Host', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-login"><?php 
            _e('Login', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-directory"><?php 
            _e('Directory', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-used"><?php 
            _e('Used', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
				</tr>
				<thead>
				<tbody>
				<?php 
            if (isset($destinations) && count($destinations)) {
                //echo "destinations<pre>"; print_r($destinations); echo "</pre>";
                foreach ($destinations as $idx => $item) {
                    //echo "idx=[". $idx ."] destination<pre>"; print_r($item); echo "</pre>";
                    if (!isset($row_class)) {
                        $row_class = "";
                    }
                    $row_class = $row_class == '' ? 'alternate' : '';
                    ?>
						<tr class="<?php 
                    echo $row_class;
                    if (isset($item['type'])) {
                        echo ' snapshot-row-filter-type-' . $item['type'];
                    }
                    ?>
">
							<td class="snapshot-col-delete" style="width:5px;"><input type="checkbox"
							                                                          name="delete-bulk-destination[<?php 
                    echo $idx;
                    ?>
]"
							                                                          id="delete-bulk-destination-<?php 
                    echo $idx;
                    ?>
">
							</td>

							<td class="snapshot-col-name"><a
									href="<?php 
                    echo $edit_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
"><?php 
                    echo stripslashes($item['name']);
                    ?>
</a>

								<div class="row-actions" style="margin:0; padding:0;">
									<span class="edit"><a href="<?php 
                    echo $edit_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
"><?php 
                    _e('edit', SNAPSHOT_I18N_DOMAIN);
                    ?>
</a></span> | <span class="delete"><a
											href="<?php 
                    echo $delete_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
&amp;snapshot-noonce-field=<?php 
                    echo wp_create_nonce('snapshot-delete-destination');
                    ?>
"><?php 
                    _e('delete', SNAPSHOT_I18N_DOMAIN);
                    ?>
</a></span>
								</div>
							</td>
							<td class="snapshot-col-server"><?php 
                    if (isset($item['address'])) {
                        echo $item['address'];
                    }
                    ?>
</td>
							<td class="snapshot-col-username"><?php 
                    if (isset($item['username'])) {
                        echo $item['username'];
                    }
                    ?>
</td>
							<td class="snapshot-col-username"><?php 
                    if (isset($item['directory'])) {
                        echo $item['directory'];
                    }
                    ?>
</td>

							<td class="snapshot-col-used"><?php 
                    Snapshot_Model_Destination::show_destination_item_count($idx);
                    ?>
</td>
						</tr>
					<?php 
                }
            } else {
                ?>
					<tr class="form-field">
					<td colspan="4"><?php 
                _e('No FTP Destinations', SNAPSHOT_I18N_DOMAIN);
                ?>
</td></tr><?php 
            }
            ?>
				</tbody>
			</table>
			<?php 
            if (isset($destinations) && count($destinations)) {
                ?>
				<div class="tablenav">
					<div class="alignleft actions">
						<input class="button-secondary" type="submit"
						       value="<?php 
                _e('Delete Destination', SNAPSHOT_I18N_DOMAIN);
                ?>
"/>
					</div>
				</div>
			<?php 
            }
        }
Example #2
0
        function display_listing_table($destinations, $edit_url, $delete_url)
        {
            ?>
			<table class="widefat">
				<thead>
				<tr class="form-field">
					<th class="snapshot-col-delete"><?php 
            _e('Delete', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-name"><?php 
            _e('Name', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-login"><?php 
            _e('Login', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-authorized"><?php 
            _e('Authorized', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-directory"><?php 
            _e('Directory', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
					<th class="snapshot-col-used"><?php 
            _e('Used', SNAPSHOT_I18N_DOMAIN);
            ?>
</th>
				</tr>
				<thead>
				<tbody>
				<?php 
            if (isset($destinations) && count($destinations)) {
                foreach ($destinations as $idx => $item) {
                    if (!isset($row_class)) {
                        $row_class = "";
                    }
                    $row_class = $row_class == '' ? 'alternate' : '';
                    ?>
						<tr class="<?php 
                    echo $row_class;
                    if (isset($item['type'])) {
                        echo ' snapshot-row-filter-type-' . $item['type'];
                    }
                    ?>
">
							<td class="snapshot-col-delete"><input type="checkbox"
							                                       name="delete-bulk-destination[<?php 
                    echo $idx;
                    ?>
]"
							                                       id="delete-bulk-destination-<?php 
                    echo $idx;
                    ?>
">
							</td>

							<td class="snapshot-col-name"><a
									href="<?php 
                    echo $edit_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
"><?php 
                    echo stripslashes($item['name']);
                    ?>
</a>

								<div class="row-actions" style="margin:0; padding:0;">
									<span class="edit"><a href="<?php 
                    echo $edit_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
"><?php 
                    _e('edit', SNAPSHOT_I18N_DOMAIN);
                    ?>
</a></span> | <span class="delete"><a
											href="<?php 
                    echo $delete_url;
                    ?>
item=<?php 
                    echo $idx;
                    ?>
&amp;snapshot-noonce-field=<?php 
                    echo wp_create_nonce('snapshot-delete-destination');
                    ?>
"><?php 
                    _e('delete', SNAPSHOT_I18N_DOMAIN);
                    ?>
</a></span>
								</div>
							</td>
							<td class="snapshot-col-login"><?php 
                    if (isset($item['account_info']['display_name'])) {
                        echo $item['account_info']['display_name'];
                        if (isset($item['account_info']['email'])) {
                            echo ' (' . $item['account_info']['email'] . ')';
                        }
                    }
                    ?>
</td>
							<td class="snapshot-col-authorized"><?php 
                    if (isset($item['tokens']['access']['token']) && isset($item['tokens']['access']['token_secret'])) {
                        _e('Yes', SNAPSHOT_I18N_DOMAIN);
                    } else {
                        _e('Yes', SNAPSHOT_I18N_DOMAIN);
                    }
                    ?>
</td>
							<td class="snapshot-col-directory"><?php 
                    if (isset($item['directory'])) {
                        echo $item['directory'];
                    }
                    ?>
</td>
							<td class="snapshot-col-used"><?php 
                    Snapshot_Model_Destination::show_destination_item_count($idx);
                    ?>
</td>
						</tr>
					<?php 
                }
            } else {
                ?>
					<tr class="form-field">
					<td colspan="4"><?php 
                _e('No Dropbox Destinations', SNAPSHOT_I18N_DOMAIN);
                ?>
</td></tr><?php 
            }
            ?>
				</tbody>
			</table>
			<?php 
            if (isset($destinations) && count($destinations)) {
                ?>
				<div class="tablenav">
					<div class="alignleft actions">
						<input class="button-secondary" type="submit"
						       value="<?php 
                _e('Delete Destination', SNAPSHOT_I18N_DOMAIN);
                ?>
"/>
					</div>
				</div>
			<?php 
            }
            ?>
		<?php 
        }