$devname = substr($devname, 0, 10) . "<strong>...</strong>" . basename($devname); } echo "<td><div><i class='glyphicon glyphicon-cd hdd'></i><span style='margin:4px;'></span>{$devname}</div></td>"; if ($mounted) { echo "<td><i class='glyphicon glyphicon-save hdd'></i><span style='margin:4px;'><a title='Browse Iso File Share.' href='/Shares/Browse?dir={$mount[mountpoint]}'>{$mount[mountpoint]}</a></td>"; } else { $mount_point = basename($mount[mountpoint]); echo "<td><form title='Click to change Iso File Mount Point.' method='POST' action='/plugins/{$plugin}/UnassignedDevices.php?action=change_iso_mountpoint&device={$mount[device]}' target='progressFrame' style='display:inline;margin:0;padding:0;'>\n\t\t\t\t\t<i class='glyphicon glyphicon-save hdd'></i><span style='margin:4px;'></span><span class='text exec'><a>{$mount[mountpoint]}</a></span>\n\t\t\t\t\t<input class='input' type='text' name='mountpoint' value='{$mount_point}' hidden />\n\t\t\t\t\t</form></td>"; } echo "<td><span style='width:auto;text-align:right;'>" . ($mounted ? "<button type='button' style='padding:2px 7px 2px 7px;' onclick=\"disk_op(this, 'umount','{$mount[device]}');\"><i class='glyphicon glyphicon-export'></i> Unmount</button>" : "<button type='button' style='padding:2px 7px 2px 7px;' onclick=\"disk_op(this, 'mount','{$mount[device]}');\"><i class='glyphicon glyphicon-import'></i> Mount</button>") . "</span></td>"; echo $mounted ? "<td><i class='glyphicon glyphicon-remove hdd'></i></td>" : "<td><a class='exec' style='color:#CC0000;font-weight:bold;' onclick='remove_iso_config(\"{$mount[device]}\");' title='Remove Iso FIle Share.'> <i class='glyphicon glyphicon-remove hdd'></i></a></td>"; echo "<td><span>" . my_scale($mount['size'], $unit) . " {$unit}</span></td>"; echo render_used_and_free($mount); echo "<td title='Turn on to Mount Device when Array is Started.'><input type='checkbox' class='iso_automount' device='{$mount[device]}' " . ($mount['automount'] ? 'checked' : '') . "></td>"; echo "<td><a title='View Iso File Share Log.' href='/Main/ViewLog?i=" . urlencode($mount['device']) . "&l=" . urlencode(basename($mount['mountpoint'])) . "'><img src='/plugins/{$plugin}/icons/view_log.png' style='cursor:pointer;width:16px;'></a></td>"; echo "<td><a title='Edit Iso File Share Script.' href='/Main/EditScript?i=" . urlencode($mount['device']) . "&l=" . urlencode(basename($mount['mountpoint'])) . "'><img src='/plugins/{$plugin}/icons/edit_script.png' style='cursor:pointer;width:16px;" . (get_iso_config($mount['device'], "command_bg") == "true" ? "" : "opacity: 0.4;") . "'></a></td>"; echo "</tr>"; $odd = $odd == "odd" ? "even" : "odd"; } } if (!count($samba_mounts) && !count($iso_mounts)) { echo "<tr><td colspan='12' style='text-align:center;font-weight:bold;'>No Remote SMB/NFS or Iso File Shares configured.</td></tr>"; } echo "</tbody></table><button type='button' onclick='add_samba_share();'>Add Remote SMB/NFS Share</button>"; echo "<button type='button' onclick='add_iso_share();'>Add Iso File Share</button></div>"; $config_file = $GLOBALS["paths"]["config_file"]; $config = is_file($config_file) ? @parse_ini_file($config_file, true) : array(); $disks_serials = array(); foreach ($disks as $disk) { $disks_serials[] = $disk['partitions'][0]['serial']; }
function is_iso_automount($sn) { $auto = get_iso_config($sn, "automount"); return $auto ? $auto == "yes" ? TRUE : FALSE : TRUE; }